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)
Ältere Kommentare anzeigen
Akzeptierte Antwort
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
2 Kommentare
Walter Roberson
am 12 Aug. 2022
The im2bw step is important here. jpeg files are almost always rgb files.
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Image Segmentation and Analysis finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!