how can do process on some objects in an image?

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 件のコメント

chef13
chef13 2015 年 7 月 16 日
編集済み: chef13 2015 年 7 月 16 日
It is not clear to me what do you want to do.
Do you want to count the objects in the image? Do you want their size ? Or something else.
Could you be more precise?
jack nn
jack nn 2015 年 7 月 16 日
編集済み: jack nn 2015 年 7 月 16 日
I mean that I want to do my process on each blob Separately...for example in this image I have 10 blob so I want to do my process like below:
if true
for i=1:10
do_process(blob(i))
end
end
I hope this is clear...thanks dear
chef13
chef13 2015 年 7 月 16 日
Start by identifying the number of blobs. Are you already able to do that?
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 件)

この質問は閉じられています。

タグ

質問済み:

2015 年 7 月 16 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by