主题:求助:图像上两点连线
zhongjun
[专家分:0] 发布于 2007-10-18 17:01:00
请问以下在matlab中,怎么在图像上两点之间连一条线呀,有箭头的,有专用的函数吗?
回复列表 (共5个回复)
沙发
mikle [专家分:390] 发布于 2007-10-19 14:10:00
可以自己写函数,不难
板凳
zhongjun [专家分:0] 发布于 2007-10-20 12:35:00
可否告诉你下编程思路?
3 楼
blivfate [专家分:720] 发布于 2007-10-20 20:14:00
function h=arrow_shw(p1,p2,w,col)
n=length(p1); c=(p2(1)-p1(1))/2; d=(p2(2)-p1(2))/2; f=(p2(1)+p1(1))/2;
g=(p2(2)+p1(2))/2; x=[-1 1 0.5 1 0.5]; y=[0 0 0.5*w 0 -0.5*w];
xx=c*x-d*y+f; yy=d*x+c*y+g; h=line(xx,yy);
if nargin==4, set(h,'Color',col); end
4 楼
zhongjun [专家分:0] 发布于 2007-10-21 16:55:00
非常感谢,问一下函数中P1,P2是指什么呀???
5 楼
suresue [专家分:0] 发布于 2008-07-28 14:02:00
point p1 and point p2 , eg: p1=[1,2]; p2=[2,3]
我来回复