I am trying to find a way to search for colors in images. Here's a simplified example:
tree = ExampleData[{"TestImage", "Tree"}]
I see there blue there, so I want xy place somewhere in this sea of โโpixels. Suppose I am looking for a specific shade of blue that I can provide approximately approximate RGB values โโfor:
Manipulate[Graphics[{RGBColor[r, g, b], Disk[]}], {r, 0, 1}, {g, 0, 1}, {b, 0, 1}]
and now I want to find the coordinates of some pixels that have this value, or close enough. Nearest
could do this:
Nearest[ImageData[tree], {0.32, 0.65, .8}]
but not ... it generates a very big conclusion ...
This is done in reverse:
ImageValue[tree, {90, 90}]
itโs normal if I already have numbers or you can click on the image. As soon as I find out the location of the colors, I can pass this on to functions that require โmarkers,โ such as RegionBinarize
.
I believe that there must be a Mathematica function for this, but she cannot find it yet ...