??? Undefined function or method 'knnsearch' for input arguments of type 'double

zhangyufei1994 2015-12-29 03:39:49
function [Prealligned_source,Prealligned_target,transformtarget ]=Preall(target,source)

% This function performs a first and rough pre-alligment of the data as starting position for the iterative allignment and scaling procedure

% Initial positioning of the data is based on alligning the coordinates of the objects -which are assumed to be close/similar in shape- following principal component analysis

[COEFF,Prealligned_source] = princomp(source);
[COEFF,Prealligned_target] = princomp(target);

% the direction of the axes is than evaluated and corrected if necesarry.
Maxtarget=max(Prealligned_source)-min(Prealligned_source);
Maxsource=max(Prealligned_target)-min(Prealligned_target);
D=Maxtarget./Maxsource;
D=[D(1,1) 0 0;0 D(1,2) 0; 0 0 D(1,3)];
RTY=Prealligned_source*D;

load R
for i=1:8
T=R{1,i};
T=RTY*T;
[bb DD]=knnsearch(T,Prealligned_target);
MM(i,1)=sum(DD);
end

[M I]=min(MM);
T=R{1,I};
Prealligned_source=Prealligned_source*T;

[d,Z,transformtarget] = procrustes(target,Prealligned_target,'scaling',0);
...全文
113 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

3,423

社区成员

发帖
与我相关
我的任务
社区描述
其他开发语言 其他开发语言
社区管理员
  • 其他开发语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧