Page 1 of 1

Why CCLib::ICPRegistrationTools::RegisterClouds Return ERROR

Posted: Mon Nov 17, 2014 8:09 am
by bingyu1413
Hello!

This is the second time to ask for help.There are my codes below:

CCLib::SimpleCloud model;
CCLib::SimpleCloud part;
model.reserve(model_cop.width()*model_cop.height());
part.reserve(part_cop.width()*part_cop.height());
CCVector3 ccvt3;
for (int i = 0; i < model_cop.height(); i++)
{
for (int j = 0; j < model_cop.width(); j++)
{
ccvt3.x = model_cop[j].x();
ccvt3.y = model_cop[j].y();
ccvt3.z = model_cop[j].z();
model.addPoint(ccvt3);
}
}

for (int i = 0; i < part_cop.height(); i++)
{
for (int j = 0; j < part_cop.width(); j++)
{
ccvt3.x = part_cop[j].x();
ccvt3.y = part_cop[j].y();
ccvt3.z = part_cop[j].z();
part.addPoint(ccvt3);
}
}

double finalerror = 0;
CCLib::ICPRegistrationTools icprt;

int result = icprt.RegisterClouds(&model, &part, totalTrans, CCLib::ICPRegistrationTools::MAX_ERROR_CONVERGENCE, 0.01, 5000, finalerror);

Why the result is always return ICP_ERROR_DIST_COMPUTATION=102 ??? Is there something wrong to use the CCLIB ? Please help me,thanks a lot.

Re: Why CCLib::ICPRegistrationTools::RegisterClouds Return E

Posted: Mon Nov 17, 2014 11:05 am
by daniel
Hard to tell! Nothing obvious at least.

There are multiple reasons why the distance computation can fail (a cloud with a null bonding-box, not enough memory, etc.). You should run CC in debug mode and place a breakpoint before the call to DistanceComputationTools::computeHausdorffDistance (RegistrationTools.cpp, line 243). Step inside and try to find what causes the method to return an error.

Re: Why CCLib::ICPRegistrationTools::RegisterClouds Return E

Posted: Tue Nov 18, 2014 1:26 am
by bingyu1413
I have debug into CClib,and I find the error caused by no bounding box,maybe I will try something to fix this problem.
Thanks a lot!

Re: Why CCLib::ICPRegistrationTools::RegisterClouds Return E

Posted: Tue Nov 18, 2014 8:27 am
by daniel
If the bounding-box is null, then you should check what you actually push in the cloud structure (i.e. either model_cop or part_cop).