How to get smooth boundary connected image?

12 vues (au cours des 30 derniers jours)
Alex Grame
Alex Grame le 23 Jan 2019
Commenté : Image Analyst le 24 Jan 2019
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

Réponses (3)

Image Analyst
Image Analyst le 23 Jan 2019
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 commentaire
Image Analyst
Image Analyst le 24 Jan 2019
Alex, are you still there?

Connectez-vous pour commenter.


KSSV
KSSV le 23 Jan 2019
Modifié(e) : KSSV le 23 Jan 2019
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 le 24 Jan 2019
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 commentaire
Image Analyst
Image Analyst le 24 Jan 2019
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.

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by