I've got a script that uses the Canny method and probabilistic Hough transform to identify line segments in an image.
I need to be able to filter out all line segments that are NOT connected to a specific pixel. How would one tackle this problem?
I've got a script that uses the Canny method and probabilistic Hough transform to identify line segments in an image.
I need to be able to filter out all line segments that are NOT connected to a specific pixel. How would one tackle this problem?
The result of Hough Line transform is an array of (rho,theta) parameter pairs. The equation of the line represented by the pair is
y + x/tan(theta) + rho/sin(theta) = 0
You can check whether the (x, y) coordinates of the point satisfy this condition, to find lines that pass throught the point (practically, use a small value instead of 0).