how to extend line of image
1 view (last 30 days)
Show older comments
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
0 Comments
Answers (2)
Walter Roberson
on 24 May 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.
0 Comments
Stephen
on 24 May 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
0 Comments
See Also
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!