segmentation problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

segmentation problem

zoom
Hi, I'm trying to apply image segmentation to a video. So first I've obtained the frames and now I plan to create a code that can do the segmentation (black and white) automatically to all frames. Last part will be creating the video with the segmented frames.

The problem is that the object I want to segment is not easy, I've tried some plugins with Fiji and no one can segment exactly the image.
I attach the images so you can see the problem.



My idea is to use any kind of libraries to solve the problem. For example one step could be to do the segmentation and then if there are more particles in the picture discard which are smaller than the main one...
Do you know which libraries to use and the functions?

Thank you
   
Reply | Threaded
Open this post in threaded view
|

Re: segmentation problem

zoom
here I post one solution by scripting

from ij import IJ

imp =IJ.getImage()
print imp


IJ.run("Enhance Contrast", "saturated=0.4");
IJ.run("Bandpass Filter...", "filter_large=40 filter_small=3 suppress=None tolerance=5 autoscale saturate");
IJ.run("Sharpen");
IJ.run("Find Edges");
IJ.run("Despeckle");
IJ.run("Level Sets");
IJ.makePolygon(273,189,22,137,5,122,11,33,245,44);
IJ.run("Level Sets", "method=[Active Contours] use_fast_marching use_level_sets grey_value_threshold=50 distance_threshold=0.50 advection=2.20 propagation=1 curvature=1 grayscale=30 convergence=0.0050 region=outside");

What I can't is to make the selection with the script, does anybody know how to do it?