Can I use regionprops for two different image for finding same feature in same code?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
joynob ahmed
am 13 Apr. 2020
Kommentiert: Adam Danz
am 14 Apr. 2020
I want to find centroid for a lesion.But I have found this in previous line of this code.So it shows me some error like 'Expected one output from a curly brace or dot indexing expression, but there were 2 results'. The error is in 5th line when I have used these lines:
props = regionprops(labeledImage, 'Centroid');
xCentroid = props.Centroid(1)
yCentroid = props.Centroid(2)
props1 = regionprops(rotatedImage, 'Centroid');
xnewCentroid = props1.Centroid(1)
ynewCentroid = props1.Centroid(2)
0 Kommentare
Akzeptierte Antwort
Adam Danz
am 13 Apr. 2020
You're indexing the wrong variable.
xnewCentroid = props1(1).Centroid
ynewCentroid = props1(1).Centroid
2 Kommentare
Adam Danz
am 14 Apr. 2020
You're getting this error
Expected one output from a curly brace or dot indexing expression, but there were 2 results
because you're indexing incorrectly.
xnewCentroid = props1.Centroid(1)
% wrong ^^^
xnewCentroid = props1(1).Centroid
% correct ^^^^
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrices and Arrays 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!