MATLAB: Extend line until the image borders.

image processingImage Processing Toolbox

Hey,
I have plotted few lines in an image and I want to extend these lines until the image borders (end).
I tried to call ''aLine'' command and also use some basics trigonometry, but it did not work for all the lines.
Any idea?
Thanks.

Best Answer

Do you have the equation of each line? If so, simply put in 1 and the max x value to get the two y values. Then call plot. Any part of the line outside the axes simply won't draw so it will have the effect of crossing the entire image.