It seems that regionprops 'orientation' behaves differentlty if we give a logical or an integer :
A = [ 0 0 0 1 1 0 ; 0 0 0 1 0 0 ; 1 1 0 0 0 0 ; 0 0 0 0 0 0 ; 0 0 0 0 1 0 ; 0 0 0 0 0 0 ]a_orientation = regionprops(A,'Orientation')% Orientation: 28.1550
B = logical(A)b_orientation = regionprops(B,'Orientation')% 3x1 struct array with fields:
% Orientation
b_orientation.Orientation% ans =
% 0
%
% ans =% 45.0000
% % ans =% 0%
How could I make regionprops behave with logical the same way as with integers without changing the type ?
Best Answer