How could I make the discontinuous contour of an image consistant?

后端 未结 6 1272
孤街浪徒
孤街浪徒 2021-02-04 15:32

In the task, I got an discontinuous edge image, how could make it closed? in other word make the curve continuous. And the shape could be any kind, cause this the coutour shadow

6条回答
  •  南笙
    南笙 (楼主)
    2021-02-04 16:25

    You can try using distance transform

    % binarize
    im=rgb2gray(im); im=im>100;
    
    % Distance transform
    bd=bwdist(im);
    maxDist = 5;
    bd(bd

提交回复
热议问题