How to get smooth boundary connected image?

6 ビュー (過去 30 日間)
Alex Grame
Alex Grame 2019 年 1 月 23 日
コメント済み: Image Analyst 2019 年 1 月 24 日
Hi exprts! I am trying to smooth the boundries of the binary image. I applied convex hull technique but it does not work. Can you please suggest what technique should i use to get the desired result? Your suggestion will be appreciated . Thank you so much
[Below is the required result]
Ground-Truth.png
[This is my effort]
untitled.png

回答 (3 件)

Image Analyst
Image Analyst 2019 年 1 月 23 日
Another way is to use sgolayfilt() or activecontour(). Demos attached.
Or you could simply blur the image and then threshold at 0.5
width = 11;
kernel = ones(width) / width^2;
blurryImage = conv2(double(binaryImage), kernel, 'same');
binaryImage = blurryImage > 0.5;
  1 件のコメント
Image Analyst
Image Analyst 2019 年 1 月 24 日
Alex, are you still there?

サインインしてコメントする。


KSSV
KSSV 2019 年 1 月 23 日
編集済み: KSSV 2019 年 1 月 23 日
Use boundary
I = imread('Letter_c.svg.png') ;
[nx,ny,nt] = size(I) ;
[y,x] = find(I(:,:,1)==255) ;
I1 = zeros(nx,ny) ;
[X,Y] = meshgrid(1:ny,1:nx) ;
idx = boundary(x,y) ;
idx = inpolygon(X(:),Y(:),x(idx),y(idx)) ;
I1(idx) = 255 ;
imshow(I1)
untitled.png

guru mahesh M
guru mahesh M 2019 年 1 月 24 日
yes , this solution has been almost reaches the point which you desired to get.
but my suggestion will be not to use the bplot() function inside the function bodys . it will need extea memory for running .
Note : Better to use the command(argv,argc*[]) function included , so that it is very efficent code that make your design very comfortable .......
  1 件のコメント
Image Analyst
Image Analyst 2019 年 1 月 24 日
guru I think you answered the wrong question. Nobody here used bplot OR a function in their Answer. And your comment about using command() doesn't seem to make sense here.

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by