how to extend line of image
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(2 个)
Walter Roberson
2012-5-24
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 个评论
Stephen
2012-5-24
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!