How to remove dust particle in image leaving behind only nematodes

I tried imageJ and computer vision to eliminate dust particles in the image and maintain nematodes structure could not get effective solution. Valuables suggestion and solution appreciated.

Hi

If this was okay then you could explore the following lead:

run("Invert");
run("RGB to CMYK");
run("Stack to Images");
selectWindow("C");
setAutoThreshold("Yen");
//run("Threshold...");
setOption("BlackBackground", false);
run("Convert to Mask");
run("Analyze Particles...", "size=3000-50000 circularity=0.00-0.20 display exclude add");type 

Thank you

Hi Mathew, Thank you for your macro its ahead to solution. However, I got different result for same image, aim is to capture colorful nematodes only. Could you help me to solve this problem :slightly_smiling_face:

Hi @amaze
Works for the first frame.
You will need to analyze each line to understand
Hope this helps.
Thank you

run("Invert");
run("RGB to CMYK");
run("Stack to Images");
selectWindow("C");
setAutoThreshold("Yen");
//run("Threshold...");
setOption("BlackBackground", false);
run("Convert to Mask");
run("Analyze Particles...", "size=3000-50000 circularity=0.00-0.20 display exclude add");
roiManager("Select", 3);
roiManager("Delete");
roiManager("Select", newArray(0,1,2));
roiManager("Combine");
roiManager("Add");
setBackgroundColor(255, 255, 255);
run("Clear Outside");
roiManager("Show All without labels");
roiManager("Show None");
roiManager("Select", 3);

Thanks Mathew, for your support. I really appreciate you.