Access MinFeretCoordinates data in regionprop table
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
Matt J
am 26 Nov. 2023
Bearbeitet: Matt J
am 26 Nov. 2023
For example,
stats{1,'MinFeretCoordinates'}
stats{2,'MinFeretCoordinates'}
stats{3,'MinFeretCoordinates'}
2 Kommentare
Matt J
am 26 Nov. 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}
Weitere Antworten (1)
Walter Roberson
am 26 Nov. 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 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

