How to detect polygon line from the image?

Hi guys,

I am researching a way to find polygon line (first inside polygon line from the center) from the image.

  1. Here is my original image:

  1. Here is my mission:

Do you have any tool or calculation method for this case ?

Thanks in advance.

I thought this has already been answered here:

2 Likes

Hi
@tugsjargal
@Bio7
I learn and I allow myself to propose this macro.

run("Duplicate...", "title=1");
run("Duplicate...", "title=2");
run("8-bit");
run("Unsharp Mask...", "radius=100 mask=0.60");
run("Morphological Segmentation");
wait(3000);
selectWindow("Morphological Segmentation");
//setTool("multipoint");
call("inra.ijpb.plugins.MorphologicalSegmentation.setInputImageType", "object");
call("inra.ijpb.plugins.MorphologicalSegmentation.setGradientRadius", "1");
call("inra.ijpb.plugins.MorphologicalSegmentation.setGradientType", "Morphological");
wait(1000);
call("inra.ijpb.plugins.MorphologicalSegmentation.segment", "tolerance=16.0", "calculateDams=true", "connectivity=4");
wait(10000);
call("inra.ijpb.plugins.MorphologicalSegmentation.createResultImage");
wait(10000);
run("RGB to CMYK");
selectWindow("CMYK_2-overlaid-basins");
run("Stack to Images");
selectWindow("Y");
setAutoThreshold("Mean dark");
//run("Threshold...");
run("Convert to Mask");
run("Erode");
run("Analyze Particles...", "size=60000-Infinity display include add in_situ");
selectWindow("1");
roiManager("Show All without labels");
roiManager("Select", 0);
roiManager("Set Color", "red");
roiManager("Set Line Width", 3);
roiManager("Show None");
run("Flatten");

For morpholib specialists: is there the right (scientifically) to redo an RGB with morpholib?

2 Likes

Hey @Mathew

You are amazing!

Thank you so much.