R
R
rmelnychuk2017-08-30 11:42:20
Images
rmelnychuk, 2017-08-30 11:42:20

Algorithm for finding monochromatic places in a picture?

I'm making an application to overlay text on an image.
I need to determine the places where I can overlay text.
At the moment, I can only determine if nearby pixels are similar, using this - https://stackoverflow.com/questions/1725505/findin...
Can someone advise in which direction to move? What algorithms to look at?
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
SolidMinus, 2017-08-30
@rmelnychuk

As already said on SO. The difference between a set of pixels is RMSE. It is also the Minkowski distance with p=2. You can p (degrees) by others. This will change the "sensitivity" to differences. Experiment.
https://ru.wikipedia.org/wiki/%D0%A0%D0%B0%D1%81%D...
width = 0
height = 0
Take image[i][j] pixel, compare with those around the edges image[i][j + 1] image[i][j - 1] if they are similar, then add to heigth = heigth + n, the number of pixels that are similar around. Then you repeat the same for these same pixels that are similar, if there is where to go, you add again.
When widthXheigth = appropriate for the text size, then you've found the right place.
In general, I think something in this direction is needed.

G
GavriKos, 2017-08-30
@GavriKos

It is necessary to move in the direction of answering the question "what is a monochromatic place in the picture." I would advise you to translate the picture into HSL - it is much easier to determine the tone there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question