How to measure circularity??
15 ビュー (過去 30 日間)
古いコメントを表示
How to measure circularity ? What is wrong in this code?
CC=bwconncomp(BW); %BW binary image
labeled=labelmatrix(CC);
stats = regionprops(CC, 'all');
stats.circularity = ((stats.Perimeter) .^2 )./ (4*(pi*(stats.Area)))
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/146543/image.jpeg)
採用された回答
Image Analyst
2014 年 12 月 20 日
You didn't use brackets. Try it this way
allPerimeters = [stats.Perimeter];
allAreas = [stats.Area];
allCircularities = allPerimeters .^ 2 ./ (4 * pi* allAreas);
12 件のコメント
その他の回答 (6 件)
Matt J
2014 年 12 月 21 日
It might also be useful to check whether the Eccentricity and Solidity of a region are above a certain threshold.
6 件のコメント
Image Analyst
2014 年 12 月 22 日
You can look at my code in my answer where the blobs are labeled with their number in the first figure, and then each blob is cropped out to a separate image with the blob number in the title above the blob.
Nisreen Sulayman
2015 年 1 月 19 日
12 件のコメント
Image Analyst
2015 年 1 月 21 日
First segment the image to get a binary mask of that thing. Then mask it
red = grayImage;
red(mask) = 255;
green = grayImage;
green(mask) = 0;
blue = grayImage;
blue(mask) = 0;
rgbImage = cat(3, red, green, blue);
imshow(rgbImage);
Nisreen Sulayman
2015 年 1 月 29 日
編集済み: Nisreen Sulayman
2015 年 1 月 29 日
7 件のコメント
murk hassan memon
2018 年 4 月 4 日
stats.circularity = ((stats.Perimeter) .^2 )./ (4*(pi*(stats.Area))) i am getting an error of this sign ^ as such the error is too many input argument.. is there any other method to find the circularity ? if yes? then kindly help me out
Matt J
2018 年 4 月 4 日
@murk,
You have multiple objects in "stats" so you need to do something like,
result = ([stats.Perimeter] .^2 )./ (4*(pi*[stats.Area]))
Souhardya Roy
2018 年 7 月 6 日
The formula is inverse of what is given.
2 件のコメント
yousra zafar
2019 年 11 月 19 日
can you share the code for finding circular objects . i am also working on aneurysm detection. any guidance from your side will he highly appreciated
yousra zafar
2019 年 11 月 21 日
i,m unable to run the code text.m attcahed above, getting error : file not found , can you share with me the image C:\Users\Rose\Documents\Temporary\im.jpg
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Segmentation and Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!