Obtaining coordinates of pixels lighted at specific color
Hi everyone, I am working on an app using OpenCV249 on android and would like to find means to obtain the coordinates of the pixels that are lighted at a specific color relative to the image. For instance if I draw a green dot using android's canvas and drawables on an image, is there a way to obtain the coordinates of that green dot relative to the image?
And if this process is extended to more complicated random sketches, ie circles or rectangles, is there a way to obtain those points as well? Do note that I am developing for android, thanks!
How did you draw it? If you draw it, I am afraid that you need its coordinates. If you have some colors and you need to fing the coordinate, then I think you shall use HSV and get the saturation and then the moments would help you.
Basically when you draw something first in software then you know exactly what color is being used by its RGB values. So why not apply basic thresholding of the image on those values? That will render a binary mask of everything you have drawn.
Hi @thdrksdfthmn thanks for replying. Pls pardon me I don quite get what you said. I drew it using the android's Canvas and Drawables method with the finger as the input. So you can imagine it as a doodling app. I can't seem to find methods on the java api that deals with HSV and moments, do you mind elaborating abit more on your approach?
For conversion you can see this. But maybe there is a better to do as Steven sais... thresholding