Info

This question is closed. Reopen it to edit or answer.

Error with regionprops, Expected input number 1, PROPERTIES, to match one of these values:

1 view (last 30 days)
Hello, i'm trying to get the MinorAxisLength from a serie of images via regionprops function with a for loop and i'm getting a bunch of errors that i dont know how to solve.
Section of my code:
for z = 1: 4
Image_stats(z).Bloque3 = regionprops (Image_thr(z).Bloque2, 'MinorAxisLenght');
end
This are the errors i get from Matlab:
Error using regionprops>getPropsFromInput (line 1447)
Expected input number 1, PROPERTIES, to match one of these values:
'LabelName', 'Area', ...
The input, 'MinorAxisLenght', did not match any of the valid values.
Error in regionprops>ParseInputs (line 1412)
reqStats = getPropsFromInput(startIdxForProp, ...
Error in regionprops (line 248)
[I,requestedStats,officialStats] = ParseInputs(imageSize, argOffset, args{:});
Error in script_detectar_desgaste (line 53)
Image_stats(z).Bloque3 = regionprops (Image_thr(z).Bloque2, 'MinorAxisLenght');
I have to say that before trying to get the values this way, i used the following code and worked, but i wanted to make it more efficient with a loop:
Image_stats1 = regionprops (Image_thr1, 'MinorAxisLength');
Image_stats2 = regionprops (Image_thr2, 'MinorAxisLength');
Image_stats3 = regionprops (Image_thr3, 'MinorAxisLength');
Image_stats4 = regionprops (Image_thr4, 'MinorAxisLength');
Thanks for reading and sorry if my english is a little bad. Grettings from Spain ;)
  1 Comment
Alvar Fuente Castrillo
Alvar Fuente Castrillo on 19 Oct 2021
Edited: Alvar Fuente Castrillo on 20 Oct 2021
Already answered my self, sorry to to bother you guys, MinorAxisLength was spelled wrong hahahha
The little errors are the ones that kill me :)

Answers (0)

This question is closed.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!