MATLAB: How to connect disjoint pixels on image borders

disjoint border pixelsImage Processing Toolboxmorphology

i have an image,i used open close by reconstruction,and then sobel edge detector,it detect edge ,but it has some disjoint parts,pixels are not connected in some parts,i want to use connected component labeling and watershed segmentation,so first i should make a connected border,then use imfill,to fill the area between borders,and watershed to segment them,is there any function i call to connect pixels which are close to each other?when i use sobel on original image,it detects border,but by too many dots,which are not connected,like some one draw borders by dots,when i use open close on image,the border is much better,but still has some disjoint parts,thank you so much

Best Answer

What is "open close"? There is imopen() and imclose() but usually you do one or the other. I don't know exactly what operations you did (functions that you called) when you say you did "open close". That's not standard terminology.
You can use imclose() to connect nearby pixels.
How did you do Sobel? Did you use edge() or imgradient()? You should use imgradient() and then you can choose your own threshold. Choose a lower threshold to make the edges more connected.
Related Question