The origin is the top left corner of the original image. X and Y axis are horizontal and vertical edges respectively. The distance is the minimal algebraic distance from the origin to the detected line.
Input image with nonzero values representing edges.
Angles at which to compute the transform, in radians.
Hough transform accumulator.
Angles at which the transform was computed, in radians.
Distance values.
Perform a straight line Hough transform.
Generate a test image:
This example is valid syntax, but we were not able to check execution>>> img = np.zeros((100, 150), dtype=bool)
... img[30, :] = 1
... img[:, 65] = 1
... img[35:45, 35:50] = 1
... for i in range(90):
... img[i, i] = 1
... img += np.random.random(img.shape) > 0.95
Apply the Hough transform:
This example is valid syntax, but we were not able to check execution>>> out, angles, d = hough_line(img)
.. plot:: hough_tf.pySee :
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them