Access MinFeretCoordinates data in regionprop table
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ely Raz
el 26 de Nov. de 2023
How can I access each circle MinFeretCoordinates?
clc;
clear;
a = imread("circlesBrightDark.png");
bw = a < 50;
imshow(bw)
title("Image with Circles")
stats = regionprops("table",bw,"Centroid","MinFeretProperties", "MajorAxisLength","MinorAxisLength")
0 comentarios
Respuesta aceptada
Matt J
el 26 de Nov. de 2023
Editada: Matt J
el 26 de Nov. de 2023
For example,
stats{1,'MinFeretCoordinates'}
stats{2,'MinFeretCoordinates'}
stats{3,'MinFeretCoordinates'}
2 comentarios
Matt J
el 26 de Nov. de 2023
The same as any other cell, e.g.,
a = imread("circlesBrightDark.png");
bw = a < 50;
stats = regionprops("table",bw,"Centroid","MinFeretProperties",...
"MajorAxisLength","MinorAxisLength");
fourNumbers = stats{1,6}{1}
Más respuestas (1)
Walter Roberson
el 26 de Nov. de 2023
a = imread("circlesBrightDark.png");
bw = a < 50;
imshow(bw)
title("Image with Circles")
stats = regionprops("table",bw,"Centroid","MinFeretProperties", "MajorAxisLength","MinorAxisLength")
%then
MFC = cat(3,stats.MinFeretCoordinates{:});
The result would be a 2 x 2 x N numeric array where N is the number of regions detected.
hold on; plot(squeeze(MFC(:,1,:)), squeeze(MFC(:,2,:)), 'r-')
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!