注册 登录
编程论坛 Matlab

【求助】如何实现选择图片中的任意形状的一部分

zzbingshi 发布于 2006-06-28 10:39, 1598 次点击
我想选择图片中的一个长方形,可是这个长方形是斜的,请问怎么实现呀?
或者指导一下怎么得到它的四个顶点也可以,我用cpselect实现时,怎么点击四下,可是得到的却是两个值,也就是说显示的是一个点,请高手指点,急求!!!!谢谢
2 回复
#2
ysunana2006-07-04 16:45
用getrect()函数看看行吗!
GETRECT Select rectangle with mouse.
RECT = GETRECT(FIG) lets you select a rectangle in the
current axes of figure FIG using the mouse. Use the mouse to
click and drag the desired rectangle. RECT is a four-element
vector with the form [xmin ymin width height]. To constrain
the rectangle to be a square, use a shift- or right-click to
begin the drag.

RECT = GETRECT(AX) lets you select a rectangle in the axes
specified by the handle AX.

See also GETLINE, GETPTS.
#3
zhangenter2006-07-04 18:45
x=ginput(4)
1