Removing unwanted components in a binary image?

조회 수: 4 (최근 30일)
Srinidhi Gorityala
Srinidhi Gorityala 2020년 2월 16일
댓글: KALYAN ACHARJYA 2020년 2월 17일
Heloo... am working on pothole images. Below is the binary image of pothole attached and i wanted to remove the unwanted components sorrounding the pothole and i want only the pothole image as the output without any unwanted areas, could anyone help me?
thanks in advance...:)
  댓글 수: 2
KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 2월 16일
Can you point out pothole in the image? Use paint or any
Srinidhi Gorityala
Srinidhi Gorityala 2020년 2월 16일
Thanks for responding @KALYAN ACHARJYA.. The highlighted one is the pothole image and remaining are the cracks on the road.

댓글을 달려면 로그인하십시오.

답변 (2개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 2월 16일
편집: KALYAN ACHARJYA 2020년 2월 16일
BW=bwareafilt(bw_im,1);
result=bw_im-BW;
imshow(result);
If you are more interested to control the small area objects use this function
  댓글 수: 2
Srinidhi Gorityala
Srinidhi Gorityala 2020년 2월 16일
@KALYAN ACHARJYA... i have used the below code by using bwareopen and my output seems to be the attached image but i wanted to remove the highlighted ones because those are cracks on the road. The below color image is the original pothole image.
thankyou...
original image
KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 2월 17일
Apply imclose on the resultant binary image with proper structuring element objects

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2020년 2월 16일
You need to define what you want. For example, do you want just the largest blob with bwareafilt(bw, 1)? Or blobs larger than a certain area with bwareaopen(bw, someArea)? Do you want to fill holes with imfill(bw, 'holes')? Also you should make sure your initial segmentation gives the pothole(s) as white, not black, since binary operations are done on true/white/1 valued pixels, not false/black/0 valued objects.

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by