Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

how can do process on some objects in an image?

조회 수: 1 (최근 30일)
jack nn
jack nn 2015년 7월 16일
마감: MATLAB Answer Bot 2021년 8월 20일
hi everybody I have a homework that I could not solve this.I hope you can help me. I have a binary image that includes some objects. I want to do some process on these object distinc..I thought maybe regionprobs can help me...Is there any idea? for example if this is my image I want to do my process(for example imdilate) on just 3 blob of this objects.
thanks
  댓글 수: 5
jack nn
jack nn 2015년 7월 16일
I searched and I know this:
if true
[labeledImage, numberOfBlobs] = bwlabel(binaryImage);
end
but when I want to see for example first blob and I used this code:
if true
figure,imshow(labeledImage(1));
end
I couldn't see the first blob :(
jack nn
jack nn 2015년 7월 16일
thanks dear I found the answer.
this is the answer:
if true
[labeledImage, ~] = bwlabel(binaryImage);
blobMeasurements = regionprops(labeledImage,'all');
numberOfBlobs = size(blobMeasurements, 1);
for i=1: numberOfBlobs
thisBlobsPixels = blobMeasurements(i).PixelIdxList;
m=zeros(512);
m(thisBlobsPixels)=1;
end

답변 (0개)

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by