Filling gaps in shape edges

后端 未结 4 952
名媛妹妹
名媛妹妹 2020-12-15 01:27

Is there an algorithm that would perform well in terms of filling holes like those on the sample image? Dilation doesn\'t work well, cause before I eventually manage to conn

4条回答
  •  抹茶落季
    2020-12-15 01:54

    After you get the thickened image, you can recover your "thin" shape using skeletonization. I found an implementation of skeletonization here.

    If you want avoid too much thickening (as it distorts the image and parts of the shape merge together), use mild erosion and skeletonization alternatively until you get the holes filled.

提交回复
热议问题