Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hough Transform Example Code Does Not Produce the Plot Shown #251

Open
valschmidt opened this issue May 18, 2020 · 0 comments
Open

Hough Transform Example Code Does Not Produce the Plot Shown #251

valschmidt opened this issue May 18, 2020 · 0 comments

Comments

@valschmidt
Copy link

The code example in py_houghlines.rst only plots the first line detected, not all the lines as shown in the "result" image.

This is not a big deal, but as a first time user caused me a bit of confusion.

The following should fix it:

for line in lines:
    rho = line[0][0]
    theta = line[0][1]
    a = np.cos(theta)
    b = np.sin(theta)
    x0 = a*rho
    y0 = b*rho
    x1 = int(x0 + 1000*(-b))
    y1 = int(y0 + 1000*(a))
    x2 = int(x0 - 1000*(-b))
    y2 = int(y0 - 1000*(a))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant