例如,如果我已经得到描述图像上的一个矩形如何使用MATLAB内插图像上的矢量坐标?
xy=[165 88;
401 88;
401 278;
165 278];
的载体。
我如何获得使用MATLAB内置函数以下矢量
[165 88; % increase X - hold y
166 88;
167 88;
... ;
399 88;
400 88;
401 88; % hold x - increase y
401 89;
401 90;
401 91;
... ;
401 276;
401 277;
401 278; % decrease X - hold y
400 278;
399 278;
398 278;
... ;
167 278;
166 278;
165 278; % hold x - decrease y
165 277;
165 276;
... ;
165 87];
还是需要使用for循环写呢?
该算法必须适用于具有n点和xy坐标的通用向量。使用IND2SUB
正确地说,xy不是矢量,而是2列矩阵。 – yuk 2010-03-01 19:19:04