资源简介
ICP算法的C++源代码。迭代最近点法(Iterative Closest Points Algorithm)。基本思想是:根据某种几何特性对数据进行匹配,并设这些匹配点为假想的对应点,然后根据这种对应关系求解运动参数。再利用这些运动参数对数据进行变换。并利用同一几何特征,确定新的对应关系,重复上述过程。
代码片段和文件信息
/*=================================================================
*
* ICP algorithm implemented in c++
*
* written by
*
* Per Bergstr鰉 2007-10-09
*
* email: per.bergstrom@ltu.se
*
* Uses kd-tree written by Guy Shechter
* http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=4586&objectType=file
*
*=================================================================*/
#include
#include “mex.h“
#include
#include “kdtree_common.h“
#include “kdtree_common.cc“
/* Input Arguments */
#define model prhs[0]
#define data prhs[1]
#define weights prhs[2]
#define randvec prhs[3]
#define sizerand prhs[4]
#define treeptr prhs[5]
#define iter prhs[6]
/* Output Arguments */
#define TR plhs[0]
#define TT plhs[1]
#if !defined(MAX)
#define MAX(A B) ((A) > (B) ? (A) : (B))
#endif
#if !defined(MIN)
#define MIN(A B) ((A) < (B) ? (A) : (B))
#endif
double pwr2(double a){
return a*a;
}
void icp(
double *trpr
double *ttpr
double *modelz
unsigned int nmodelz
double *dataz
double *qltyz
unsigned int ndataz
unsigned int *randvecz
unsigned int nrandvecz
unsigned int nrandz
unsigned int iimax
double *pointer_to_tree
)
{
unsigned int iitempjkiicou=0;
double R[9]T[3]distcc;
double datam[3]modelm[3]MM[3]Spx[9]quasum;
unsigned short int bol=1;
double SIGMA[3];
double SpxTSpx[6];
double ABC;
double sqrtA23B;
double x0f0;
double SIpdifl;
double invmat[6];
double V[9];
double U[9];
Tree *tree;
tree = (Tree *) ((long) pointer_to_tree[0]);
trpr[0]=1.0;
trpr[4]=1.0;
trpr[8]=1.0;
if((nrandz+1)>ndataz){
bol=0;
}
for(ii=0;ii
for(i=0;i<9;i++){
Spx[i]=0.0;
}
for(i=0;i<3;i++){
modelm[i]=0.0;
datam[i]=0.0;
}
quasum=0.0;
for(itemp=0;itemp
if(bol){
if(itemp i=randvecz[cou];
if(cou<(nrandvecz-1)){
cou++;
}
else{
cou=0;
}
}
else{
break;
}
}
else{
i=itemp;
}
if(qltyz[i]>0.0){
T[0]=trpr[0]*dataz[3*i]+trpr[3]*dataz[3*i+1]+trpr[6]*dataz[3*i+2]+ttpr[0];
T[1]=trpr[1]*dataz[3*i]+trpr[4]*dataz[3*i+1]+trpr[7]*dataz[3*i+2]+ttpr[1];
T[2]=trpr[2]*dataz[3*i]+trpr[5]*dataz[3*i+1]+trpr[8]*dataz[3*i+2]+ttpr[2];
distcc=0.0;
A=0.0;
run_queries(
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 17752 2008-04-24 15:40 icpCpp.cpp
文件 20480 2008-04-24 15:41 icpCpp.dll
文件 1275 2008-04-24 15:37 icpCpp.m
文件 1822 2008-04-24 15:37 icp_demo.m
文件 5441 2008-04-24 15:37 kdtree.cc
文件 10240 2008-04-24 15:41 kdtree.dll
文件 2098 2008-04-24 15:37 kdtree.m
文件 8798 2008-04-24 15:37 kdtree_common.cc
文件 2391 2008-04-24 15:37 kdtree_common.h
文件 1335 2009-05-28 14:10 license.txt
文件 101 2008-04-24 15:37 make.m
文件 660 2008-04-24 15:37 readme.txt
- 上一篇:c++编写的傅里叶变换FFT程序
- 下一篇:MFC读写CSV文件
相关资源
- 颜色识别形状识别STM103嵌入式代码
- c++ 邮件多附件群发
- c++ 透明代理(hookproxy)
- 卡尔曼定位程序
- mfc 调用redis
- FTP客户端源码(c++)
- c++ 画图(14Qt-XPS)
- c++多边形交并差运算
- VC++基于OpenGL模拟的一个3维空间模型
- c++ 虚拟摄像头
- hook,捕获所有案件,查找所有窗口,
- C语言课设计算器
- c++ 简易贪吃蛇源码
- 高精度加法(c++代码)
- C++调用百度地图案例
- 北京化工大学计算方法(C/C++)讲义
- 基于VC++的SolidWorks二次开发SolidWorks
- c++ 模拟鼠标按键
- OFD编辑器
- Beginning C++17 From Novice to Professional
- C++ STL实现
- opencv手部轮廓识别以及轨迹识别
- 百度C++编码规范
- C++ sql2008 WebServer通讯.docx
- c++ 定时关机程序源码
- 基于VSCode和CMake实现C++开发
- c++语法查询工具
- c++ 账务系统源码
- GBT 28169-2011 嵌入式软件 C语言编码规范
- c++ 猜拳小游戏
评论
共有 条评论