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 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Respuesta aceptada
Walter Roberson
el 11 de Ag. de 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 comentarios
Walter Roberson
el 12 de Ag. de 2022
The im2bw step is important here. jpeg files are almost always rgb files.
Más respuestas (1)
Ver también
Categorías
Más información sobre Image Segmentation and Analysis en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!