Compute the pose of a 3D object using the Ransac method.
#include <visp/vpPose.h>
#include <visp/vpPoint.h>
#include <visp/vpMath.h>
#include <visp/vpHomogeneousMatrix.h>
#include <stdlib.h>
#include <stdio.h>
#define L 0.1
int
main()
{
std::cout << "Pose computation with matched points" << std::endl;
int size = 8;
double L2 = L*2.0;
for(int i=0 ; i < size ; i++)
{
std::cout << std::endl;
}
double error = 0.01;
P[3].
set_y(P[3].get_y() + 2*error);
P[6].
set_x(P[6].get_x() + error);
for(int i=0 ; i < size ; i++)
unsigned int nbInlierToReachConsensus = (unsigned int)(75.0 * (double)size / 100.0);
double threshold = 0.01;
std::cout << "Inliers: " << std::endl;
for (unsigned int i = 0; i < inliers.size() ; i++)
{
inliers[i].print() ;
std::cout << std::endl;
}
std::cout <<
"cMo :\n" <<
vpPoseVector(cMo).
t() << std::endl << std::endl;
delete [] P;
}