Input of different field spots cloud can sometimes normal match and rt matrix
Bothering me for a long time, sometimes produce Segmentation fault problem
Use GDB debugging, found the program to run to
The detector. The match (* pcTest, results, 1.0/5.0, 0.03);
After will appear segfault and interrupt program
Online for a long time found that may be memory overflow, and so on question (not sure)
But I don't know how to allocate memory
#include
#include
#include
#include
#include
#include
# include "opencv2/surface_matching HPP"
#include
# include "opencv2/surface_matching/ppf_helpers HPP"
# include "opencv2/core/utility. HPP"
using namespace std;
Using the namespace CV;
Using the namespace ppf_match_3d;
/* static void help (const string& ErrorMessage)
{
cout <"The Program init error:" & lt;
Int main (int arg c, char * * argv)
{
//the welcome message
cout <"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" & lt;
"Using point pair the features." & lt;
The "pose than training. \ n * It then trains the model and searches for It in the"
"The input scene. The detected poses are further refined by ICP \ n * and printed to The"
"The standard output." & lt;
/* if (arg c & lt; 3)
{
Help (" Not enough input arguments ");
cout
} */
# if (defined __x86_64__ | | defined _M_X64)
cout <"Running on 64 bits" & lt;
# the else
cout <"Running on 32 bits" & lt;
# endif
# ifdef _OPENMP
cout <"Running with OpenMP" & lt;
cout <"Running without OpenMP and without TBB" & lt;
String modelFileName="/home/mingchi catkin_ws/SRC/opencv_test/table3. The ply";
String sceneFileName="/home/mingchi catkin_ws/SRC/opencv_test/test. The ply";
P1 int64 *;
Int64 * (p2);
Mat * PC;
Mat * pcTest;
Mat pc_1=loadPLYSimple (modelFileName c_str (), 1);
//Mat PC=loadPLYSimple ("/home/mingchi catkin_ws/SRC/opencv_test/box2. The ply ", 1);
PC=& amp; Pc_1;
//Now train the model
cout <"Training... "& lt;
P1=& amp; Tick1;
Ppf_match_3d: : PPF3DDetector detector (0.025, 0.05);
The detector. TrainModel (* PC);
Int64 tick2=CV: : getTickCount ();
The p2=& amp; Tick2;
cout
Mat pcTest_1=loadPLYSimple (sceneFileName c_str (), 1);
//Mat pcTest=loadPLYSimple ("/home/mingchi catkin_ws/SRC/opencv_test/test. The ply ", 1);
PcTest=& amp; PcTest_1;
cout
//Match the model to the scene and the get the pose
cout
* p1=tick3;
The detector. The match (* pcTest, results, 1.0/5.0, 0.03);
Int64 tick4=CV: : getTickCount ();
* the p2=tick4;
cout
//cout & lt; <"The Number of matching poses:" & lt;
/* if (results_size==0) {
cout
} */
//Get only the first N the results
Int N=1;
/* if (results_size & lt; N) {
cout
} */
Vector
//Create an instance of ICP (iterations, how rejection scale, numlevels)
ICP, ICP (100, 0.05 f to 2.5 f, 8).
Int64 t1=CV: : getTickCount ();
* p1=t1;
//Register for all selected poses
cout
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull