帮助中心帮助中心
用鼠标指定点
不建议使用 getpts。请改用一个 ROI 类,如 Create ROI Shapes中所述。
getpts
[xi,yi] = getpts
[xi,yi] = getpts(fig)
[xi,yi] = getpts(ax)
示例
[xi,yi] = getpts 允许您使用鼠标选择当前图窗中的点。选择完成后,getpts 将以 xi 和 yi 形式返回所选点的坐标。
xi
yi
普通的单击可添加点。按住 Shift 键单击、右键单击或双击可添加一个终点并结束选择。按 Return 或 Enter 键会结束选择而不添加终点。按 Backspace 或 Delete 键会删除先前选择的点。
[xi,yi] = getpts(fig) 允许您使用鼠标在图窗 fig 的当前坐标区中选择点。
fig
[xi,yi] = getpts(ax) 允许您使用鼠标选择坐标区 ax 中的点。
ax
全部折叠
使用 imshow 显示图像。
imshow
figure imshow('moon.tif')
调用 getpts 以使用鼠标在显示的图像中以交互方式选择点。双击以完成您的选择。完成后,getpts 会返回您选择的点的坐标。
[x,y] = getpts
图窗句柄,指定为句柄。
坐标区句柄,指定为句柄。
采样点的 x 坐标,以数值向量形式返回。
数据类型: double
double
采样点的 y 坐标,以数值向量形式返回。
在 R2006a 之前推出
getline | getrect | impixel | impoint
getline
getrect
impixel
impoint
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office