How to draw lines(from LSD) with particular slope value?

asked 2017-05-05 04:11:40 -0500

Lavanya gravatar image

My aim is to segment screws and to find whether it is good or not. Segmentation part is over. Now I am finding lines inside the screw are good or not. To prove it, I need to find whether lines are perfectly parallel to each other. Secondly, I need to find the distance between lines. I used Line Segment Detector(LSD) to find lines in my image. It gave several lines. Now I want to prove whether lines in the screw are parallel are not. I had extracted slope of lines and I stored it in a integer variable. Now I want to know which line have which slope value. For example, I have slope value of 10, I want to draw line with slope 10 only. Can anyone help me to overcome this problem? Thanks in advance!

edit retag flag offensive close merge delete



First, it's a very bad idea to keep the slope value in integers (everything below 45° will have a slope 0).

To draw the lines, use the formulae to pass from the line equation to carthesian coordinates.

kbarni gravatar imagekbarni ( 2017-05-05 05:16:01 -0500 )edit

can you show us, what you're doing ? (code, maybe an example image)

berak gravatar imageberak ( 2017-05-06 07:36:59 -0500 )edit