![]() |
| ||
| counting pixels in an image(ocr) I have a small image with a black background and red lines in it and I need to count the red pixels. I know I need PIL, but I'm not sure which method to use. Then once I have the counts I need to equate them to a character, so if the red lines in the image form a circle and have x amount of red pixels, its = '0', and if the image forms a straight line and is found to have x amount of pixels it's = 'l'. import Image Any suggestions? |
| ||
| Re: counting pixels in an image(ocr) Could you test how many pixels are red? Because a circle will require many more pixels to draw then a line. I know when getting colours i used something like: import Image |
| ||
| Re: counting pixels in an image(ocr) Played around with it a little ... # use PIL to count pixels in letters I and O |
| All times are GMT -4. The time now is 10:53 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC