how to connect disjoint pixels on image borders?

S
sara · Feb 6, 2024 · 1.9K views
Question
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  
Expert Answer
Profile picture of John Williams
John Williams PhD Expert
Answered Aug 27, 2026
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.
100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!