MATLAB: How to find the most common angle of line segments in a binary image

average anglehoughhoughlineshoughpeaksimage processingImage Processing ToolboxMATLABsegments

I have a microscopic biological image which I have thresholded and cleaned up to produce a binary image. This image is mainly made up of almost parallel streaks of varying length which are the result of long fibres in the original image.
I want to determine the approximate angle from the x-axis of the direction of all these fibres. I have been playing around with the Houghpeaks function but am not sure whether it's the most appropriate tool. As far as I understand Hough space is akin to the space of infinite straight lines and the Houghpeaks function tells you which of these lines are most close to existing in your binary image. This sometimes gives me sensible answers but I'm not sure it's the best tool for my purpose.
What I really want is the average angle made by many often small line segments. Is a Hough transform a good start or is there a better way to go for this?
Thanks.

Best Answer

It sure would have been helpful if you had let us see your image. Other than that, since I'm working blind and guessing, I'd say to call regionprops() and get the origination, then get the average of those.
labeledImage = bwlabel(binaryImage);
measurements = regionprops(labeledImage, 'Orientation');
allAngles = [measurements.Orientation];
meanAngle = mean(allAngles);