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?

1 Ansicht (letzte 30 Tage)

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 11 Aug. 2022
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
props = struct with fields:
Area: 50890 Centroid: [209.7235 135.0689]

Weitere Antworten (1)

Image Analyst
Image Analyst am 12 Aug. 2022

Community Treasure Hunt

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

Start Hunting!

Translated by