1 | initial version |
use HoughLines instead of HoughLinesP. This will give you the angle of the line and its perpendicular distance from the origin. This way you can simple filter lines according to their angles without any additional calculations.
check this link for more information: