Posts

Showing posts with the label javacv

Recognize White Text with Black Shadow on White Background

Image
Recognize White Text with Black Shadow on White Background I'm trying to extract text from images. The text is always white, but the background can vary and also be white, resulting in the following output when only considering pixel color: As you can see, the white background will "eat up" the letter it surrounds, as is particularly the case with the first "G" and the second to last "go". Now my idea to tackle this problem was to take the black shadow of the text into consideration, which after all also seems to be the reason why the "G" is still readable to us humans. However, I don't know how to go about this, and I also can't find any ressources online. This is what I've tried so far: Since the shadow is to the lower right, I check if there are black pixels within the three pixels down or to the right. This gives us the following result: It's already better than the first output, but there are still many false positives, t...