HoughLines with theta greater than PI

asked 2018-10-25 02:30:48 -0500

updated 2018-10-25 02:56:13 -0500

According to OpenCV 3.0 docs cv::HoughLines can stablish min and max theta for searching:

min_theta – [...] Must fall between 0 and max_theta.

max_theta – [...] Must fall between min_theta and CV_PI.

Then, you can't set angle search over PI making impossible to search the PI to 2 PI half rect space.

I think there is something I am missing, or the polar representation in that Hough Transform is not like I think should be.

My goal is to search only near vertical or near horizontal lines. ¿Can I do that with min and max theta?

edit retag flag offensive close merge delete

Comments

please use recent docs , not outdated 3.0-beta

berak gravatar imageberak ( 2018-10-25 02:34:07 -0500 )edit
1

Sorry, updated!

carsanbu gravatar imagecarsanbu ( 2018-10-25 02:57:22 -0500 )edit

hough lines don't have an "orientation", so 10° is the same as 190°. it wraps around at 180° (pi).

admittedly, this is somewhat unfortunate in the case of "horizontal" lines, where you probably want +-10°.

berak gravatar imageberak ( 2018-10-25 13:10:59 -0500 )edit

Ok, that's my problem. Maybe it's possible to tweak that algorithm to accept negative starting angles.

carsanbu gravatar imagecarsanbu ( 2018-10-29 03:57:18 -0500 )edit

i don't think that's possible (or even feasible)

use 2 passes, one for 0-10°, another for 170-180°

berak gravatar imageberak ( 2018-10-29 04:07:06 -0500 )edit