Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hough Line gives negative rhos

Tags:

opencv

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?

like image 600
John M. Avatar asked Oct 24 '25 10:10

John M.


1 Answers

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)

like image 116
willem Avatar answered Oct 27 '25 01:10

willem



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!