How to have a contour with 4-connectivity?

Dear all,
I have a contour that shown below. Two of the corners are with 8-connectivity. Is there a way to make all the corners satisfy 4-connectivity?
Best,
Meshoo

 Accepted Answer

Meghana Dinesh
Meghana Dinesh on 26 Nov 2015
Edited: Meghana Dinesh on 26 Nov 2015
Fill the image ( imfill). Use bwboundaries with conn = 4.

1 Comment

I was thinking if there is a direct way to restore those missing pixels. Thank you.

Sign in to comment.

More Answers (0)

Categories

Asked:

on 26 Nov 2015

Commented:

on 27 Nov 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!