MSD
MSD

Reputation: 154

What is meant by the values returned by cv2.HoughLinesP()?

lines = cv2.HoughLinesP(edges,1,np.pi/180,100,minLineLength,maxLineGap,cv2.THRESH_BINARY)

I am using this code to detect line in a PNG image, and the function returns a numpy array :

array([[[124, 235, 393, 235]],

       [[124, 233, 393, 233]]])

I wanted to know what these values mean in order to get the length and direction of the line detected.

*The image used contains only one horizontal line.

Upvotes: 4

Views: 3967

Answers (1)

Jimmy
Jimmy

Reputation: 1

Output vector of lines.

Each line is represented by a 4-element vector

(x1, y1, x2, y2)

where (x1, y1) and (x2, y2) are the ending points of each detected line segment.

Upvotes: 0

Related Questions