P
P
plpm2018-10-26 22:16:28
Algorithms
plpm, 2018-10-26 22:16:28

Algorithm for replacing individual pixels from a graphic image?

Change everything in the image to white except for "gnome".
5bd37a3ca4c6a543902935.png
Interested in the algorithm itself - not the formula.
I did not find anything else, except for examples for opencv and ImageMagic - with ready-made functions (which do not reveal the essence).
Preferably perl GD, or PHP, C++, C .

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xmoonlight, 2018-10-26
@xmoonlight

Removing noise on an image using php?
1. You need to find rectangular areas with a continuous contour.
And those areas (that cluster) that will occupy the maximum (by area) size - these will be the letters of the inscription.
2. You can find the maximum number of black pixels that are on one straight line.
Then, find the boundaries of the inscription by determining the period (letter spacing).

A
Alexander Skusnov, 2018-10-27
@AlexSku

1) find an object consisting of touching black pixels
2) find an enclosing frame (X range, Y range)
3) remove small objects (paint white)
There is an Image Processing toolbox in MatLab, the regionprops function .
(it is possible that it is desirable to invert the colors first, since black is usually considered a background)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question