how to calculate area, perimeter and circularity of objects in an image using regionprops

2 ビュー (過去 30 日間)
Muhammad Asim
Muhammad Asim 2019 年 9 月 5 日
回答済み: Catalytic 2019 年 9 月 5 日
I tried this code for the image, it runs smoothly but doesn't show results.I want to calculate the area, perimeter and circularity for each object in this image and show results in the end. Kindly help me with this and please mention where the problem exists.
B = bwlabel(img9);
stats = regionprops(B,'Area', 'Perimeter');
allAreas = [stats.Area];
allPerimeters = [stats.Perimeter];
circularities = (4 * pi * allAreas) ./ allPerimeters .^2;
stats = regionprops('table',img9, 'Area', 'Perimeter');

回答 (1 件)

Catalytic
Catalytic 2019 年 9 月 5 日
Notice -
>> a=1; %not displayed
>> b=2, %displayed
b =
2

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by