<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5359977293724070721</id><updated>2026-04-07T04:12:43.780-07:00</updated><category term="hog"/><category term="icdar"/><category term="machine learning"/><category term="ocr"/><category term="phog"/><category term="random forest"/><category term="recognition"/><category term="tesseract"/><title type='text'>Computer Vision</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://computervisionlab.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5359977293724070721/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://computervisionlab.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Long Long</name><uri>http://www.blogger.com/profile/10379954930509460232</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5359977293724070721.post-3124593328680549369</id><published>2011-12-22T12:28:00.000-08:00</published><updated>2012-02-05T09:20:14.035-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hog"/><category scheme="http://www.blogger.com/atom/ns#" term="icdar"/><category scheme="http://www.blogger.com/atom/ns#" term="machine learning"/><category scheme="http://www.blogger.com/atom/ns#" term="ocr"/><category scheme="http://www.blogger.com/atom/ns#" term="phog"/><category scheme="http://www.blogger.com/atom/ns#" term="random forest"/><category scheme="http://www.blogger.com/atom/ns#" term="recognition"/><category scheme="http://www.blogger.com/atom/ns#" term="tesseract"/><title type='text'>OCR module</title><content type='html'>Today, I would like to show you my first OCR module. This system is based on &lt;a href=&quot;http://en.wikipedia.org/wiki/Histogram_of_oriented_gradients&quot;&gt;HOG&lt;/a&gt; and &lt;a href=&quot;http://www.robots.ox.ac.uk/~vgg/research/caltech/phog.html&quot;&gt;PHOG&lt;/a&gt; features, &amp;nbsp;I used&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Random_forest&quot;&gt;Random Forest&lt;/a&gt; to recognition. Besides, I did some comparative of my recognition rate with the&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/tesseract-ocr/&quot;&gt;Tesseract&lt;/a&gt; OCR system (without any preprocessing).&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Features&lt;/u&gt;:&lt;br /&gt;
&lt;br /&gt;
The HOG features extractor module is the follow:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Resize the character image to patch of 32x32 pixels (see the examples below).&lt;/li&gt;
&lt;li&gt;Calculate the magnitude and the orientation of the gradient of axis-X and axis-Y.&lt;/li&gt;
&lt;li&gt;Split the magnitude and the orientation matrix into 8x8 cells. Extract the HOG of these cells and grouping them a block of 2x2 cells and then it&#39;ll be normalized.&lt;/li&gt;
&lt;li&gt;Concact all block HOG features.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7PCYZQbhR1w8Ro0W_z7pqRq_OwIQWwYbLdzxE0f15ywSTES1b2s8Qx4rxkqEHx1U68tkoe9c0MsKWWzUMICJVkhyab6AssfNQoHhliDMWWl6zlDyK0JRClR_0x4E8E1bGctmxldL33Bgv/s1600/006121.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7PCYZQbhR1w8Ro0W_z7pqRq_OwIQWwYbLdzxE0f15ywSTES1b2s8Qx4rxkqEHx1U68tkoe9c0MsKWWzUMICJVkhyab6AssfNQoHhliDMWWl6zlDyK0JRClR_0x4E8E1bGctmxldL33Bgv/s1600/006121.jpg&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggST97iizqjNz525FofHdkdmKwbiuFh4lTMC6Om2BiiXiBUPGMVOQMSqoDU0hngc8meVEUAE02kilErwwsyr-QUdxydcB7qlCZZNDbm78-5DxMc_GgB-ctqhwo6r4oef2M5zwYxd9SPoXd/s1600/006123.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggST97iizqjNz525FofHdkdmKwbiuFh4lTMC6Om2BiiXiBUPGMVOQMSqoDU0hngc8meVEUAE02kilErwwsyr-QUdxydcB7qlCZZNDbm78-5DxMc_GgB-ctqhwo6r4oef2M5zwYxd9SPoXd/s1600/006123.jpg&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfR1qil94U2G-Um4oQgfIWxbkVErQWMttNVaZbB22B4l0HfbgFQ2tltQle48Jb0iFEJtIHPkZuKyUlDtB9CpIh8EjwABvRHB5T0tto7JBztHQuEYoGK03-3i4O8gEgGjius2UgpMIeLj7Z/s1600/006080.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfR1qil94U2G-Um4oQgfIWxbkVErQWMttNVaZbB22B4l0HfbgFQ2tltQle48Jb0iFEJtIHPkZuKyUlDtB9CpIh8EjwABvRHB5T0tto7JBztHQuEYoGK03-3i4O8gEgGjius2UgpMIeLj7Z/s1600/006080.jpg&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4piXhdGLrEf1eozbrD3Jjk5hw9uhePcVS7rezPk_I8m44g-_8E34GXxGTI8C1lmY5_8_mMsoO6OtyFvTz6U6wCTSjAYFByeLids6JenaXVvP3RGgcqlqwK1cjsv9K1JQqlhZgaiPVDzcy/s1600/005902.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4piXhdGLrEf1eozbrD3Jjk5hw9uhePcVS7rezPk_I8m44g-_8E34GXxGTI8C1lmY5_8_mMsoO6OtyFvTz6U6wCTSjAYFByeLids6JenaXVvP3RGgcqlqwK1cjsv9K1JQqlhZgaiPVDzcy/s1600/005902.jpg&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJid9WDrVI07TnLKvFqzL76Tfl_z86V68MP5Z5AN13Xysb0oOIpuDYptJbVpJ-88XmllSynP5-mbWpZCWVCC5C20n-Ykri2v_qsHAfs8eiiEoSy3R1rQmBVbtxLM4GnRtnoydBsoiMi_cj/s1600/005906.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJid9WDrVI07TnLKvFqzL76Tfl_z86V68MP5Z5AN13Xysb0oOIpuDYptJbVpJ-88XmllSynP5-mbWpZCWVCC5C20n-Ykri2v_qsHAfs8eiiEoSy3R1rQmBVbtxLM4GnRtnoydBsoiMi_cj/s1600/005906.jpg&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzbkSJvEMmQI6SU6YMuX3MhkBpdUClwr90qVX0ekfjYLuOLAwgTx_Hw2nLv1ie3y8WFTUsEC7c92awjUhqk5bOjr6HknS1TLTX6MhoUXG8zPvXKddTX2mj_XEWMPAoBaPjxBbWzEWYwGPv/s1600/005849.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzbkSJvEMmQI6SU6YMuX3MhkBpdUClwr90qVX0ekfjYLuOLAwgTx_Hw2nLv1ie3y8WFTUsEC7c92awjUhqk5bOjr6HknS1TLTX6MhoUXG8zPvXKddTX2mj_XEWMPAoBaPjxBbWzEWYwGPv/s1600/005849.jpg&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmEBwsZwpjySzpwITZW9jWDCLw34MboCDVqs_ASje-g8qVMPa6WZyVjXRDXJxXu0FxZN5Cd13VcXUB2jtA3Y1Wb0DMqspEhw_g38nKEWoeroFF-ZT-x-ec5aCYH-HrFQimfpgL5mHx8hX4/s1600/005928.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmEBwsZwpjySzpwITZW9jWDCLw34MboCDVqs_ASje-g8qVMPa6WZyVjXRDXJxXu0FxZN5Cd13VcXUB2jtA3Y1Wb0DMqspEhw_g38nKEWoeroFF-ZT-x-ec5aCYH-HrFQimfpgL5mHx8hX4/s1600/005928.jpg&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYPP4SsdwciNI5xArdR0Ay8Tio4Gb8vzIaAdWjXspAHZkiUblhWm7L7_UU4SgBHx3Djj3_SBbIc_6D5xcveDDkx2RZVAzP5Fnu_PqDJwTIbhObAe1XCjYsdFd9WpWoH4WK9bHhQj-m3_Db/s1600/005977.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYPP4SsdwciNI5xArdR0Ay8Tio4Gb8vzIaAdWjXspAHZkiUblhWm7L7_UU4SgBHx3Djj3_SBbIc_6D5xcveDDkx2RZVAzP5Fnu_PqDJwTIbhObAe1XCjYsdFd9WpWoH4WK9bHhQj-m3_Db/s1600/005977.jpg&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsp80g8vIFBlm5x5RM0swqSzKWUTNUxoT5LCtpUQzu51jOSjHFRDfQrpsdTMCPhESJimXosKUpTfz4i8PLB3hD6KZyThl9fabU9LP247beR-CkkAnHoHEXfMHk_0GjcIScFqK79GR-ttcO/s1600/005916.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsp80g8vIFBlm5x5RM0swqSzKWUTNUxoT5LCtpUQzu51jOSjHFRDfQrpsdTMCPhESJimXosKUpTfz4i8PLB3hD6KZyThl9fabU9LP247beR-CkkAnHoHEXfMHk_0GjcIScFqK79GR-ttcO/s1600/005916.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Figure 1) Samples of ICDAR 2003 data set. Easy and hard samples (a, a, p, C, R, S, E, i, E).&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
And, the PHOG features module is similar to HOG features: do the same procedure for every pyramid level but without grouping cells into blocks.&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Experiment setup:&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ICDAR 2003 database provide training and testing data set. In these two sets there are 71 classes. I used 100 trees with depth of 50 &amp;nbsp;for recognition.&amp;nbsp;Below, in the figure below shows the accuracy rate vs number of orientation bins.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgww1A_-IKh1Y99JfBn6jgnSsBfVcSqtY8omv1lhqyYynnKJRrXs57jz6VKpDctDgA7MpkktNiWrn0q3DtN_7-YMMXBMSr1sZ4PYf8OBiwLp5R7bJURbHGK41J5m5B2Z8cmpCMXKbz44Rr/s1600/RTree_HOG_vs_PHOG.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;361&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgww1A_-IKh1Y99JfBn6jgnSsBfVcSqtY8omv1lhqyYynnKJRrXs57jz6VKpDctDgA7MpkktNiWrn0q3DtN_7-YMMXBMSr1sZ4PYf8OBiwLp5R7bJURbHGK41J5m5B2Z8cmpCMXKbz44Rr/s640/RTree_HOG_vs_PHOG.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
After looking at these accuracy rate, there are two points to discuss. The first one, the Tesseract library is not good to recognize natural scene characters, since it is trained with scanned documents. The second one, it seems that HOG features code characters better than PHOG. Maybe the grouping cells into block stage is more discriminative than pyramid grouping stage.&lt;br /&gt;
&lt;br /&gt;
Finally, the best accuracy rate of HOG and PHOG-RandomForest is about &amp;nbsp;71% and 61% respectly (quantified with 10 bins), and Tesseract achieves 37.25%.&lt;br /&gt;
&lt;br /&gt;
My best accuracy rate richs 71%, however the &lt;a href=&quot;http://ai.stanford.edu/~ang/papers/icdar01-TextRecognitionUnsupervisedFeatureLearning.pdf&quot;&gt;Stanford University result&lt;/a&gt;&amp;nbsp;show 81.7%.</content><link rel='replies' type='application/atom+xml' href='http://computervisionlab.blogspot.com/feeds/3124593328680549369/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://computervisionlab.blogspot.com/2011/12/ocr-module.html#comment-form' title='5 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5359977293724070721/posts/default/3124593328680549369'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5359977293724070721/posts/default/3124593328680549369'/><link rel='alternate' type='text/html' href='http://computervisionlab.blogspot.com/2011/12/ocr-module.html' title='OCR module'/><author><name>Long Long</name><uri>http://www.blogger.com/profile/10379954930509460232</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7PCYZQbhR1w8Ro0W_z7pqRq_OwIQWwYbLdzxE0f15ywSTES1b2s8Qx4rxkqEHx1U68tkoe9c0MsKWWzUMICJVkhyab6AssfNQoHhliDMWWl6zlDyK0JRClR_0x4E8E1bGctmxldL33Bgv/s72-c/006121.jpg" height="72" width="72"/><thr:total>5</thr:total></entry></feed>