Image Segmentation of binary image

조회 수: 3 (최근 30일)
Sadeq Ebrahimi
Sadeq Ebrahimi 2019년 12월 28일
답변: Image Analyst 2019년 12월 29일
Hi,
I'm trying to identify the banana from the other fruits in an binary Image so that the result only show the banana, I used se=strel('disk',25) but the area of orange was larger so the result show the orange not banana. can you help me with the problem.
Thank you in advance.
  댓글 수: 6
KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 12월 29일
As you already located the roi (red boundary), is there any issue now?
Sadeq Ebrahimi
Sadeq Ebrahimi 2019년 12월 29일
yes, delete all the other fruits and only show banana in binary

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

채택된 답변

Image Analyst
Image Analyst 2019년 12월 29일
This looks like homework, not a real world problem. So I'll give you hints. Use the color thresholder app on the Apps tab to create a mask for yellow. Then use regionprops() to find out which blobs have a major axis some factor longer than the minor axis:
labeledImage = bwlabel(binaryImage);
props = regionprops(labeledImage, 'MajorAxisLength', 'MinorAxisLength');
aspectRatios = [props.MajorAxisLength] ./ [props.MinorAxisLength]
bananas = aspectRatios > 2; % Or whatever.
% Extract binary image of just the banana blobs
bananasImage = ismember(bananas, find(bananas));

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by