Finding only circular objects?

3 ビュー (過去 30 日間)
rupam baruah
rupam baruah 2016 年 2 月 15 日
コメント済み: Image Analyst 2016 年 2 月 15 日
I have a binary image with different shapes of objects. I want to calculate the number of only circular objects in the image. How can I do that by using regionprops function?
Thanks

採用された回答

Image Analyst
Image Analyst 2016 年 2 月 15 日
You can compute the circularity. See my attached shape recognition demo.
  2 件のコメント
rupam baruah
rupam baruah 2016 年 2 月 15 日
Thnks. How can I calculate total number of circles (suppose circulartity threshold is .85) in the image. Is there any particular function to find that thing? Thnks
Image Analyst
Image Analyst 2016 年 2 月 15 日
use ismember and bwlabel
labeledImage = bwlabel(binaryImage);
measurements = regionprops(labeledImage, 'Area', 'Perimeter');
allAreas = [measurements.Area];
allPerimeters = [measurements.Perimeter];
circularities = 4*pi*allAreas ./ allPerimeters.^2;
circleIndexes = find(circularities > 0.85);
circlesOnlyImage = ismember(labeledImage, circleIndexes) > 0;
[labeledImage, numCircles] = bwlabel(circlesOnlyImage);

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by