MATLAB 帮助中心
用鼠标指定矩形
不建议使用 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
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处