how to extend line of image

5 visualizaciones (últimos 30 días)
mohd
mohd el 24 de Mayo de 2012
hello everyone,
i have detect two coordinate of pixel which is (1,1) and (2,5). i already join the two coordinate to make a line. i have done it.. my question is i want to extend the line to the end. how to do this.. here i attach picture illustration for your understanding. help me please how to extend line

Respuestas (2)

Walter Roberson
Walter Roberson el 24 de Mayo de 2012
Standard algebra. Solve the equation of a line, y = m*x + b, knowing that m = (y2-y1)/(x2-x1) . Use your initial data to calculate m and b, then use those two to fill in the line.

Stephen
Stephen el 24 de Mayo de 2012
if... x1=1,x2=2 and... y1=1,y2=5
(2,5)-(1,1)=m=(1,4), is your slope
so m1=1,m2=4
try
plot([x1 x2]+1e6*[-m1 m1],[y1 y2]+1e6*[-m2 m2])
brute force wins again

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by