Fill area between two connected components in MATLAB

前端 未结 3 2015
我寻月下人不归
我寻月下人不归 2021-02-06 09:07

I have a binary image that represents a number in MATLAB:

\"image

I\'d like to fill all the d

3条回答
  •  佛祖请我去吃肉
    2021-02-06 09:36

    Assuming the top-left pixel is always outside the regions to filled:

    Work across the top line, copying pixels to the output image

    When you come to a white pixel followed by a black pixel in the input image, start setting white pixels in the output image, until you come to black pixel followed by a white pixel.

提交回复
热议问题