M
M
muk-crew2016-01-26 18:54:29
PHP
muk-crew, 2016-01-26 18:54:29

How to determine the presence of text on the photo using php?

You need to write a php script to determine the presence of text in the photo (in this case, these will be phone numbers) in the attachment of examples of such photos.
As you can see from the example photos, there are 2 types (where the phone number is displayed using different fonts in red and yellow)
Advise scripts or classes where to dig ...
There is no point in using ORC, since it is only necessary to determine the presence of a phone number in the photo.
Regarding the algorithm, there is an idea to use filtering by contrasts, but there is a problem with the implementation (what?).
I will be glad to any advice), if there is a desire, I am ready to pay denyushka for implementation. ))
e8f43cc879b04c26b4a3b8ae0ed2ff89.jpgd6ae3fcd7f294086a176d41f784abe91.jpgb689532e36c64c4684953cbebfb5aa81.jpg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
Curly Brace, 2016-01-26
@stasuss

well, as an option - line-by-line scanning and calculation of the average color value (for example, in stripes of 128 pixels high, such as the average text size) and if we notice a sharp jump in a yellow or red tint, then we draw conclusions. you can file an additional recheck, determine exactly the dimensions of this "off-scale" area

S
Sergey Sokolov, 2016-01-26
@sergiks

Assuming that phones always write in solid color, without translucency, you can:

  1. build a color histogram
    This will allow us to judge that with a high probability such a picture contains a telephone number (well, or a stylish TV table). The method will skip translucent phones, because they will not have a "separate" pronounced color.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question