Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

how to use ICP in openCV

Hi,

I want to write a small programm to understand how the ICP work and want to test it. But i don't understand the function call of the ICP function, see code...

https://docs.opencv.org/3.1.0/dc/d9b/classcv_1_1ppf__match__3d_1_1ICP.html

Can somebody show me how to do the ICP with 2 MATs? Or Any Idea/tip?

#include <iostream>
#include <opencv2/opencv.hpp>
#include <string>
#include <icp.hpp>
#include <ppf_match_3d.hpp>
#include <ppf_helpers.hpp>



using namespace std;
using namespace cv;
using namespace ppf_match_3d;

int main() {

Mat outputPLY;

// load PLYs
Mat iFirst     = loadPLYSimple("1.ply");
Mat iSecond = loadPLYSimple("2.ply");

ICP icp;


if((iFirst.type()==CV_32F)&&(iSecond.type()==CV_32F))
{
    // i dont understand this function with its parameters
    // is this the ICP ? 
    int t = icp.registerModelToScene(iFirst, iSecond, ?...?);

    // save solution of ICP as new PLY
    if(t)
    {
            //writePLY(outputPLY,"/home/sys/solution.ply");
    }
}

    return 0;
}