How to coordinates from the image by color code?

Hi guys,

I am researching a solution to find X,Y coordinates from the image by giving color.

Here is my image:
Result_find_polygon.tif (2.1 MB)

There are a few polygon shape in red. I want to find coordinates bigger polygon by red color.

Can you suggest us easy way using ImageJ tools?

Thank you.

Hi
@tugsjargal

I invite you to read this page:
https://imagej.nih.gov/ij/docs/guide/146-30.html#toc-Subsection-30.7

A workflow:

img=getImageID();
run("Duplicate...", "title=temp");
run("RGB to CMYK");
selectWindow("CMYK_temp");
run("Stack to Images");
selectWindow("Y");
setAutoThreshold("Default dark");
//run("Threshold...");
setOption("BlackBackground", true);
run("Convert to Mask");

run("Set Measurements...", "area mean centroid center feret's redirect=None decimal=3");
run("Analyze Particles...", "size=1000-Infinity display add");
roiManager("Select", 0);
roiManager("Measure");
a=getResult("XM",0);
b=getResult("YM",0);
print("XM=",a);
print("YM=",b);

@Mathew

Wow, It is amazing. Thank you so much.

1 Like