To find where two lines cross, you can use the Hough Transform to obtain the parameters of the lines and then find their point of intersection. In MATLAB, you can use the houghlines
function to obtain the parameters of the lines and the intersectionPoint
function to find their point of intersection.
Here's an example code:
main.m981 chars36 lines
This code reads an image, applies edge detection, and then applies the Hough Transform to obtain the parameters of the lines. It then finds the intersection point of the two lines using the slope-intercept method and plots the lines and the intersection point on the image.
Note that this code assumes that there are only two lines in the image. If there are more than two lines, you'll need to modify the code to find the two lines that intersect.
gistlibby LogSnag