<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>增强视觉 &#124; 计算机视觉 增强现实 &#187; 轨迹识别</title>
	<atom:link href="http://www.cvchina.info/tag/%e8%bd%a8%e8%bf%b9%e8%af%86%e5%88%ab/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cvchina.info</link>
	<description>计算机视觉，增强现实最新资讯</description>
	<lastBuildDate>Mon, 06 Feb 2012 06:34:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>转：基于Aforge的手势字符识别</title>
		<link>http://www.cvchina.info/2010/07/29/aforge-based-gesture-oc/</link>
		<comments>http://www.cvchina.info/2010/07/29/aforge-based-gesture-oc/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 12:11:28 +0000</pubDate>
		<dc:creator>cvchina</dc:creator>
				<category><![CDATA[新闻]]></category>
		<category><![CDATA[aforge]]></category>
		<category><![CDATA[gesture]]></category>
		<category><![CDATA[ocr]]></category>
		<category><![CDATA[手势]]></category>
		<category><![CDATA[轨迹识别]]></category>

		<guid isPermaLink="false">http://www.cvchina.info/?p=1590</guid>
		<description><![CDATA[还是来自hellogv，呵呵。 Afroge我是第一次看到，孤陋寡闻了。下面是一点介绍。 AForge.NET is an open source C# framework designed for developers and researchers in the fields of Computer Vision and Artificial Intelligence &#8211; image processing, neural networks, genetic algorithms, fuzzy logic, machine learning, robotics, etc. The framework is comprised by the set of libraries and sample applications, which demonstrate their features: AForge.Imaging &#8211; library [...]]]></description>
			<content:encoded><![CDATA[<p><strong>还是来自</strong><a href="http://blog.csdn.net/hellogv/archive/2010/05/04/5554691.aspx" target="_blank"><strong>hellogv</strong></a><strong>，呵呵。</strong></p>
<p><a href="http://www.aforgenet.com/framework/" target="_blank">Afroge</a>我是第一次看到，孤陋寡闻了。下面是一点介绍。</p>
<p><span style="font-family: Verdana; line-height: normal; -webkit-border-horizontal-spacing: 10px; -webkit-border-vertical-spacing: 10px;"> </span></p>
<blockquote>
<p style="font-family: Verdana; font-size: 10pt; color: black;"><strong><a href="http://www.cvchina.info/tag/aforge/" class="st_tag internal_tag" rel="tag" title="标签 aforge 下的日志">AForge</a>.NET</strong> is an open source C# framework designed for developers and researchers in the fields of Computer Vision and Artificial Intelligence &#8211; image processing, neural networks, genetic algorithms, fuzzy logic, machine learning, robotics, etc.</p>
<p style="font-family: Verdana; font-size: 10pt; color: black;">The framework is comprised by the set of libraries and sample applications, which demonstrate their features:</p>
<ul>
<li style="font-family: Verdana; font-size: 10pt; color: black; margin-bottom: 5px;">AForge.Imaging &#8211; library with image processing routines and filters;</li>
<li style="font-family: Verdana; font-size: 10pt; color: black; margin-bottom: 5px;">AForge.Vision &#8211; computer vision library;</li>
<li style="font-family: Verdana; font-size: 10pt; color: black; margin-bottom: 5px;">AForge.Video &#8211; set of libraries for video processing;</li>
<li style="font-family: Verdana; font-size: 10pt; color: black; margin-bottom: 5px;">AForge.Neuro &#8211; neural networks computation library;</li>
<li style="font-family: Verdana; font-size: 10pt; color: black; margin-bottom: 5px;">AForge.Genetic &#8211; evolution programming library;</li>
<li style="font-family: Verdana; font-size: 10pt; color: black; margin-bottom: 5px;">AForge.Fuzzy &#8211; fuzzy computations library;</li>
<li style="font-family: Verdana; font-size: 10pt; color: black; margin-bottom: 5px;">AForge.Robotics &#8211; library providing support of some robotics kits;</li>
<li style="font-family: Verdana; font-size: 10pt; color: black; margin-bottom: 5px;">AForge.MachineLearning &#8211; machine learning library;</li>
</ul>
<li style="font-family: Verdana; font-size: 10pt; color: black; margin-bottom: 5px;">etc.</li>
</blockquote>
<p><span style="font-family: verdana, sans-serif; line-height: 21px; font-size: 14px;"> </span></p>
<p style="margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;"><span style="line-height: 21px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 24px; font-size: medium;"><span style="font-size: small;">我实现手势识别的原理很简单：捕捉运动物体+手写识别，把运动的物体的轨迹记录下来，然后通过手写识别引擎去搜索数据中最匹配的数据，从而知道“写”的是什么。目前常见的开源手写识别引擎有</span><span style="line-height: normal; font-weight: normal; word-spacing: 0px; text-transform: none; color: #000000; text-indent: 0px; font-style: normal; white-space: normal; letter-spacing: normal; border-collapse: separate; font-variant: normal; orphans: 2; widows: 2;"><span style="line-height: 19px; color: #666666; text-align: justify;"><span style="font-size: small;">zinnia，</span><span style="line-height: normal; font-weight: normal; word-spacing: 0px; text-transform: none; color: #000000; text-indent: 0px; font-style: normal; white-space: normal; letter-spacing: normal; border-collapse: separate; font-variant: normal; orphans: 2; widows: 2;"><span style="line-height: 19px; color: #666666; text-align: justify;"><span style="font-size: small;">wagomu</span></span></span><span style="font-size: small;"> </span></span></span><span style="font-size: small;">这些，不过小弟我比较业余，只把网上的比较常见的手写识别代码改进一下，只能识别字母和数字，真想通过摄像头隔空“手写”的朋友就要多花时间玩玩上面提到的几个开源手写类库了。</span></span></span></span></span></span></span></span></span></span></span></p>
<p style="margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;"><span style="line-height: 21px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 24px;"><span style="font-size: small;"> 本文介绍的手写识别：先在一个固定大小的画板上，用鼠标画下某图形，输入该图形对应的字母，程序把画板上的字母特征点都保存下来特征数据库(相当于学习记忆)，然后再在画板上画出类似该字母的图形，程序就通过新画的特征点搜索特征数据库从而找出最类似的字母。</span></span></span></span></span></span></span></span></span></span></span></p>
<p style="margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;"><span style="line-height: 21px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 24px; font-size: medium;"><span id="more-1590"></span><span style="font-size: x-small;"><span style="font-size: small;"><br />
</span> </span></span></span></span></span></span></span></span></span></span></span></p>
<p style="margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;"><span style="line-height: 21px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 24px; font-size: medium;"><span style="font-size: small;">接下来贴出核心代码，详细的代码请到这里下载：</span><a style="text-decoration: none; color: #336699;" href="http://download.csdn.net/source/2312865"><span style="font-size: small;">http://download.csdn.net/source/2312865</span></a></span></span></span></span></span></span></span></span></span></span></p>
<p style="margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;"><span style="line-height: 21px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px;"><span style="font-size: small;"> </span></span></span></span></span></span></span></span></span></span></p>
<p style="margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;"><span style="line-height: 21px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 19px; font-size: small;"><span style="line-height: 19px; font-family: 'comic sans ms', sans-serif;"><span style="line-height: 24px;"><span style="font-size: small;">GetBMPContext()是把画板中的图形的特征分析出来，Learn()是把特征与特定的字母/数字对应起来保存到数据库，Recognise()是把当前画板的图形特征从数据库中搜索，从而找出对应的字母/数字。</span></span></span></span></span></span></span></span></span></span></span></p>
<div>
<div>
<div>
<div><span style="font-family: monospace;"><span style="line-height: normal; white-space: pre-wrap;"></p>
<div id="_mcePaste">const int SCAN_GAP = 10;</div>
<div id="_mcePaste">private String GetBMPContext(Bitmap bmp)</div>
<div id="_mcePaste">{</div>
<div id="_mcePaste">Boolean bool1stScan = true;</div>
<div id="_mcePaste">int ax = 0, ay = 0, bx = 0, by = 0;</div>
<div id="_mcePaste">String result = &#8220;&#8221;;</div>
<div id="_mcePaste">for (int i = 1; i &lt; bmp.Width; i = i + SCAN_GAP)</div>
<div id="_mcePaste">{</div>
<div id="_mcePaste">for (int j = 1; j &lt; bmp.Height; j = j + SCAN_GAP)</div>
<div id="_mcePaste">{</div>
<div id="_mcePaste">if (bmp.GetPixel(i, j).ToArgb() == Color.Black.ToArgb())</div>
<div id="_mcePaste">{</div>
<div id="_mcePaste">if (bool1stScan == false)</div>
<div id="_mcePaste">{</div>
<div id="_mcePaste">if (i &lt;= ax) ax = i;</div>
<div id="_mcePaste">if (i &gt;= bx) bx = i;</div>
<div id="_mcePaste">if (j &lt;= ay) ay = j;</div>
<div id="_mcePaste">if (j &gt;= by) by = j;</div>
<div id="_mcePaste">}</div>
<div id="_mcePaste">else</div>
<div id="_mcePaste">{</div>
<div id="_mcePaste">bool1stScan = false;</div>
<div id="_mcePaste">ax = i;</div>
<div id="_mcePaste">bx = i;</div>
<div id="_mcePaste">ay = j;</div>
<div id="_mcePaste">by = j;</div>
<div id="_mcePaste">}</div>
<div id="_mcePaste">}</div>
<div id="_mcePaste">}</div>
<div id="_mcePaste">}</div>
<div id="_mcePaste">Bitmap bmp2 = new Bitmap(20, 20);</div>
<div id="_mcePaste">Graphics g2 = Graphics.FromImage((Image)bmp2);</div>
<div id="_mcePaste">g2.Clear(Color.White);</div>
<div id="_mcePaste">g2.DrawImage(bmp, new Rectangle(0, 0, bmp2.Width, bmp2.Height),</div>
<div id="_mcePaste">new Rectangle(0, 0, bmp.Width, bmp.Height), GraphicsUnit.Pixel);</div>
<div id="_mcePaste">g2.Dispose();</div>
<div id="_mcePaste">//            pictureBox1.Image = bmp2;</div>
<div id="_mcePaste">int a = 0, b = 0;</div>
<div id="_mcePaste">for (int i = 0; i &lt; bmp2.Width; i++)</div>
<div id="_mcePaste">{</div>
<div id="_mcePaste">for (int j = 0; j &lt; bmp2.Height; j++)</div>
<div id="_mcePaste">{</div>
<div id="_mcePaste">if (bmp2.GetPixel(i, j).ToArgb() == Color.Black.ToArgb())</div>
<div id="_mcePaste">result = result + &#8220;0&#8243;;</div>
<div id="_mcePaste">else</div>
<div id="_mcePaste">result = result + &#8220;1&#8243;;</div>
<div id="_mcePaste">}</div>
<div id="_mcePaste">}</div>
<div id="_mcePaste">return result;</div>
<div id="_mcePaste">}</div>
<div id="_mcePaste">public void Learn(String name)</div>
<div id="_mcePaste">{</div>
<div id="_mcePaste">StreamWriter sw = new StreamWriter(fileName, true);</div>
<div id="_mcePaste">sw.WriteLine(name + &#8221; &#8221; + GetBMPContext(bmpDraw));</div>
<div id="_mcePaste">sw.Close();</div>
<div id="_mcePaste">}</div>
<div id="_mcePaste">public String Recognise()</div>
<div id="_mcePaste">{</div>
<div id="_mcePaste">String current = GetBMPContext(bmpDraw);</div>
<div id="_mcePaste">StreamReader sr = new StreamReader(fileName);</div>
<div id="_mcePaste">int max = 0;</div>
<div id="_mcePaste">String result = &#8220;&#8221;;</div>
<div id="_mcePaste">while (sr.EndOfStream == false)</div>
<div id="_mcePaste">{</div>
<div id="_mcePaste">String[] key = sr.ReadLine().Split(&#8216; &#8216;);</div>
<div id="_mcePaste">String name = key[0];</div>
<div id="_mcePaste">String data = key[1];</div>
<div id="_mcePaste">int match = 0;</div>
<div id="_mcePaste">for (int i = 0; i &lt; current.Length; i++)</div>
<div id="_mcePaste">{</div>
<div id="_mcePaste">if (current[i] == data[i])</div>
<div id="_mcePaste">match++;</div>
<div id="_mcePaste">}</div>
<div id="_mcePaste">if (match &gt;= max)</div>
<div id="_mcePaste">{</div>
<div id="_mcePaste">result = name;</div>
<div id="_mcePaste">max = match;</div>
<div id="_mcePaste">}</div>
<div id="_mcePaste">//Trace.WriteLine(result + &#8220;:&#8221; + match + &#8220;,&#8221; + max);</div>
<div id="_mcePaste">}</div>
<div id="_mcePaste">sr.Close();</div>
<div id="_mcePaste">return result;</div>
<div id="_mcePaste">}</div>
<p></span></span></div>
</div>
</div>
</div>

	Tags: <a href="http://www.cvchina.info/tag/aforge/" title="aforge" rel="tag">aforge</a>, <a href="http://www.cvchina.info/tag/gesture/" title="gesture" rel="tag">gesture</a>, <a href="http://www.cvchina.info/tag/ocr/" title="ocr" rel="tag">ocr</a>, <a href="http://www.cvchina.info/tag/%e6%89%8b%e5%8a%bf/" title="手势" rel="tag">手势</a>, <a href="http://www.cvchina.info/category/news/" title="新闻" rel="tag">新闻</a>, <a href="http://www.cvchina.info/tag/%e8%bd%a8%e8%bf%b9%e8%af%86%e5%88%ab/" title="轨迹识别" rel="tag">轨迹识别</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.cvchina.info/2010/07/29/aforge-based-gesture-oc/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

