Hello,
i want to use the icp algorothm. But there is a error. Can someone tell me what should i do.
#include <opencv2/core.hpp>
#include <iostream>
#include <cv.h>
#include <vector>
#include "opencv2/surface_matching/icp.hpp"
#include "opencv2/surface_matching/pose_3d.hpp"
#include <stdio.h>
#include <stdlib.h>
#include "flann.hpp"
using namespace cv;
using namespace ppf_match_3d;
using namespace std;
int main()
{
try {
float m2[4][6] = { { 1, 1, 0, 1, 1, 1 },{ 2 , 2 , 0, 1 , 1, 1 },{ 2, 1, 0 , 1 , 1 , 1 },{ 1 , 2 , 0 , 1, 1, 1 } };
float m1[4][6] = { { 1, 1, 0, 1, 1, 1 },{ 2 , 2 , 0, 1 , 1, 1 },{ 2, 1, 0 , 1 , 1 , 1 },{ 1 , 2 , 0 , 1, 1, 1 } };
Mat M1 = cv::Mat(4, 6, CV_32F, m1);
Mat M2 = cv::Mat(4, 6, CV_32F, m2);
double re;
Matx44d pose1;
vector<Pose3DPtr> resultsSub;
cv::ppf_match_3d::ICP calculate(100, 0.005f, 2.5f, 8);
calculate.registerModelToScene(M1, M2, re, pose1);
}
catch (cv::Exception ex) {
std::cout << ex.msg << std::endl;
std::getchar();
}
return 0;
}