MATLAB: Can anyone provide a code for converting an connected binary component labelling into a 4-connected labelling?

duplicate postimage processingImage Processing Toolboxmachine vision

I want to convert this 8 connected binary image into a 4 connected image and also label it !!

Best Answer

  • I already answered this in your duplicate question You said that you did not want to use the MATLAB function that does it, bwlabel(), and so I provided you with a Wikipedia link which has the algorithm that you can program up yourself from scratch: So I'm puzzled as to why you're asking again. You said "I want to convert..." rather than "I want someone to give me their code..." so I gave you the recipe where you can do it. Is that not correct?