# Finding segment length

Hi all, I am new in the use of OpenCV. I have the following benchmark case to solve:

I need the complete definition of the three segments. With HoughLines() I am able to obtain the lines equations, but **not the length** of the segments. Is it any way to obtain the complete definition of those segments? Perhaps the starting and final points?

Thanks in advance

find a maths book, and look into it.

I think you did not understand the question :/

is it really so difficult, to find the formula for line-intersection on the internet ?

Yep, I was right, you didn't get the point of the question. Probabbly it was my mistake because I haven't explained properly. My appologizes.

I am not interested in the intersections, but in the coordinates of the starting and the end point of the three segments.

Note that the three segments extend beyond the intersections!A segment is a finite portion of a line. I want to locate the three segments, not only the line containg them.

houghlines returns

infinitelines (maybe you wanted HoughLinesP() ?)"Segment" is a "portion" (finite) of a line. I trieded HoughLinesP(), but it returns several small line portions (segments), instead of the complete line. Perhaps it is a matter of properly setting the parameters of the function?

Accumulate those segments using 2 constraints ( parallelism & distance) OR Collinearity you'll get complete segments. Then use simple Euclidean distance formula ...