MATLAB: How to get all the orientation of the lines in a 2-D image

image analysisImage Processing Toolbox

How do I get the orientations of all the lines (short and long) in this 2-dimensional image? Thanks!

Best Answer

Use regionprops(). Something like
binaryImage = grayImage < 220;
props = regionprops(binaryImage, 'Orientation');
allAngles = [props.Orientation];
Let us know if you need a full demo, and if so, attach your full size image.