Basic Pixel / Cell Counting Algorithm

Good night:)

I am currently playing with the DevIL library, which allows me to load an image and check RGB values ​​per pixel. Just like in a personal training project, I am trying to write a very basic OCR system for several images that I made in Photoshop.

I successfully remove all distortions in the image, and I have text and numbers. I'm not currently looking for an advanced neural network that learns at the input. I want to start quite easily and so I decided to identify the individual characters and count the pixels in these characters.

I have two problems:

  • Identification of individual characters.
  • Most importantly: I need an algorithm for counting connected pixels (of the same color) without counting the pixels that I previously counted. I have no math background, so this is the biggest problem for me.

Any help on this is appreciated, thanks.

edit:

I marked this question as C ++, because that is what I am currently using. However, pseudo-code or easy-to-read code from another language is also beautiful.

+3
source share
3 answers

fill fill algorithm will work to count the included pixels if you have images filtered to simple black and white bitmaps.

, , , , .

.

+2

, , GPL OCR lib, gocr.

+1

, , IMHO Vigra ( !) - ++, DevIL.

+1

Source: https://habr.com/ru/post/1703865/


All Articles