S
S
sswwssww2019-11-12 21:27:11
Python
sswwssww, 2019-11-12 21:27:11

How to recognize text of a certain color?

There is a picture: 5dcaf7f00c414115205264.jpeg
You need to get only text from it. The text is black, gray or dark gray, my idea is that I want to process the image using opencv in such a way as to "remove" those parts that do not fall into the "gray-black" range, and then run the converted image through the text recognition algorithm . I want to ask two questions: 1) I know that cv2 has an inRange method that can be passed a range of colors, but I don't know how to correctly specify the colors (gray, dark gray) that I need. 2) Tell me, what is generally better to use the preprocessing approach? I'm sure there are better options than mine.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
U235U235, 2019-11-17
@sswwssww

You can also binarize and then remove elements that are too large in area.
In the same imagemagick, this is done elementarily.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question