帮助中心帮助中心
用鼠标指定矩形
不建议使用 getrect。请改用一个 ROI 类,如 Create ROI Shapes中所述。
getrect
rect = getrect
rect = getrect(fig)
rect = getrect(ax)
示例
rect = getrect 允许您使用鼠标在当前坐标区中选择一个矩形。完成选择矩形后,getrect 会在 rect 中返回有关矩形位置和大小的信息。
rect
使用鼠标点击并拖动所需的矩形。要将矩形限制为正方形,请使用 Shift 键或右键点击开始拖动。
rect = getrect(fig) 允许您使用鼠标在图窗 fig 的当前坐标区中选择一个矩形。
fig
rect = getrect(ax) 允许您使用鼠标在坐标区 ax 中选择一个矩形。
ax
全部折叠
使用 imshow 显示图像。
imshow
imshow('moon.tif')
使用鼠标在显示的图像中以交互方式选择点。完成后,getrect 返回矩形的大小和位置。
图窗句柄,指定为句柄。
坐标区句柄,指定为句柄。
所选矩形,以四元素数值向量 [xmin ymin width height] 形式返回。
[xmin ymin width height]
在 R2006a 之前推出
getline | getpts | imrect
getline
getpts
imrect
您点击的链接对应于以下 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