how to clean the background noise, separated the object and background in dilate and erode ....

1 次查看(过去 30 天)
this is my code :
BWs=edge(image1,'canny'); se90=strel('line',3,90); se0=strel('line',3,0); BWsdil=imdilate(BWs,[se90 se0]); BWdfill=imfill(BWsdil,'holes'); BWnobord=imclearborder(BWdfill,1); seD=strel('disk',3); BWfinal=imerode(BWnobord, seD); BWfinal=imerode(BWfinal, seD); BWfinal=invertimage(BWfinal); axes(handles.axes1); imshow(BWfinal); imagemorfologi1=BWfinal; gambar=(imagemorfologi1); nama = strcat('image/dilasierosi/dilasi_',as,'.jpg'); imwrite(gambar,nama); end
and the this is a result : (maybe you can download this, if you want to help me ...)
so, what the problem is? yes I like how the background in order to dilate and erote results are not visible and only the passage of object that looks ... so please help me, thanks before.... ( maybe if the object black the background is white , or if the object white the background is black ).... that something missing in my code and must be added .... ?
  3 个评论
Image Analyst
Image Analyst 2011-8-15
Why are you starting a new thread? This seems just like your thread: http://www.mathworks.com/matlabcentral/answers/13665-how-to-make-im-using-dilate-and-erode-in-matlab-and-then-i-want-to-separate-the-background-and

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Segmentation and Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by