I'm trying to generate some Hough Lines using HoughLines(),l but some of the lines have negative rho values like:
array([[-58., 3.07177949]], dtype=float32))
array([[-56., 3.05432606]], dtype=float32))
Since rho = sqrt(x^2 + y^2), how come rho can ever be negative? Is the origin the centre of the image?
rho is not sqrt(x^2 + y^2). It is the offset of the line from the origin, positive if on one side and negative if on the other. From the wiki page, the general expression of the line is:
rho= x*cos(theta) + y*sin(theta)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With