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

조회 수: 5 (최근 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에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by