【发布时间】:2012-11-28 08:32:22
【问题描述】:
我正在尝试构建一个 rect 结构,该结构由函数 ginput 接收到 4 个点,以通过该矩形裁剪图像。
我有这样的事情:
[x,y] = ginput(4);
input_points = [x(1) y(1); x(2) y(2); x(3) y(3); x(4) y(4)];
...
disp([round(x(1)) round(x(2)) round(abs(x(2)-x(1))) round(abs(y(4)-y(1)))]);
image = imcrop(image,[round(x(1)) round(x(2)) round(abs(x(2)-x(1))) round(abs(y(4)-y(1)))]);
但是不起作用,显示的值太大了。 有谁知道怎么做?
提前致谢。
【问题讨论】: