Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Depends on what kind of pattern it is - if it's always similar to the one you've showed here (i.e. multiple thin lines), you can try Hough transform - detect all the lines and then just average them. In openCV, detected lines are described with two points, so just average all the first points describing the lines, and then do the same with the second points. Then it's enough to either visualize it or calculate the horizontal angle.

Depends on what kind of pattern it is - if it's always similar to the one you've showed here (i.e. multiple thin lines), you can try Hough transform - detect all the lines and then just average them. In openCV, detected lines are described with two points, so just average all the first points describing the lines, and then do the same with the second points. Then it's enough to either visualize it or calculate the horizontal angle.angle depending on what kind of results you are expecting.