I want to find use regioprops and find the centroid of this shape along with other properties such as area of this shape. any ideas?
2 ビュー (過去 30 日間)
古いコメントを表示

0 件のコメント
採用された回答
Walter Roberson
2022 年 8 月 11 日
filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/1094395/image.jpeg';
img = imread(filename);
bw = im2bw(img);
imshow(bw)
props = regionprops(bw, 'Area', 'Centroid');
props
2 件のコメント
Walter Roberson
2022 年 8 月 12 日
The im2bw step is important here. jpeg files are almost always rgb files.
その他の回答 (1 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!