class Line – Line object¶
The line object is an attrtuple
returned by Image.find_lines(), Image.find_line_segments(), and
Image.get_regression(). It represents a single oriented line segment with
both its endpoint form (x1, y1) -- (x2, y2) and its Hough-space form
(rho, theta).
Fields are accessible by attribute name (line.x1) or by index
(line[0]). The object has no public constructor.
- class image.line¶
Please call
Image.find_lines(),Image.find_line_segments(), orImage.get_regression()to create this object.- x1¶
X coordinate of the first endpoint. Integer. Index
[0].
- y1¶
Y coordinate of the first endpoint. Integer. Index
[1].
- x2¶
X coordinate of the second endpoint. Integer. Index
[2].
- y2¶
Y coordinate of the second endpoint. Integer. Index
[3].
- length¶
Pixel length of the segment:
round(sqrt((x2-x1)**2 + (y2-y1)**2)). Integer. Index[4].
- magnitude¶
Magnitude of the line in Hough-space. Higher values indicate that more edge pixels voted for this line. Integer. Index
[5].
- theta¶
Angle of the line in Hough-space, in degrees, 0 – 179. Integer. Index
[6].
- rho¶
Distance of the line from the image origin in Hough-space, in pixels. Signed integer (can be negative). Index
[7].