how to calculate the shape factor?
27 ビュー (過去 30 日間)
古いコメントを表示
Dear All,
Anyone can help me how to calculate the shape factor for each blob on my image as attached.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1524131/image.jpeg)
2 件のコメント
回答 (1 件)
Sulaymon Eshkabilov
2023 年 10 月 30 日
Is this what you are trying to calculate?
% Read Image
IMG = imread('IMAGE_Blob.png');
% Convert from RGB to gray scale
IMG_gray = rgb2gray(IMG);
% AREA
AREA = bwarea(IMG_gray)
% Display the minimum Feret properties of the object.
[OUT,LM] = bwferet(rgb2gray(IMG),'MinFeretProperties');
OUT.MinDiameter(1)
OUT.MinAngle(1)
OUT.MinCoordinates{1}
BW = imfill(rgb2gray(IMG),'holes');
CC = bwconncomp(BW);
[out,LM] = bwferet(CC,'MaxFeretProperties');
maxLabel = max(LM(:));
h = imshow(BW);
axis = h.Parent;
for labelvalues = 1:maxLabel
xmax = [out.MaxCoordinates{labelvalues}(1,1) out.MaxCoordinates{labelvalues}(2,1)];
ymax = [out.MaxCoordinates{labelvalues}(1,2) out.MaxCoordinates{labelvalues}(2,2)];
imdistline(axis,xmax,ymax);
end
title(axis,'Maximum Feret Diameter of Objects');
colorbar('Ticks',1:maxLabel)
3 件のコメント
Sulaymon Eshkabilov
2023 年 10 月 30 日
All details aer explained in this help documentation: https://www.mathworks.com/help/images/ref/bwferet.html#d126e43971
参考
カテゴリ
Help Center および File Exchange で Biomedical Imaging についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!