Matlab笔记(一)标记选定区域

来源:互联网 发布:js解析protobuf 编辑:程序博客网 时间:2024/06/05 18:14

如何在程序里选取两个点,以此两点作为边界取矩形并标记出来.

 

[x,y]=ginput(2);
X1=round(x(1));
X2=round(x(2));
Y1=round(y(1));
Y2=round(y(2));
[x y]=meshgrid(X1:X2,Y1:Y2);
axes(handles.axes1);
imshow(image);
hold on;
    plot(x,y,'b');
hold off

 

原创粉丝点击