Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions include/DistanceComputationTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ namespace CCCoreLib
\param compOctree the pre-computed octree of the compared cloud (warning: both octrees must have the same cubical bounding-box - it is automatically computed if 0)
\param refOctree the pre-computed octree of the reference cloud (warning: both octrees must have the same cubical bounding-box - it is automatically computed if 0)

\return 0 if ok, a negative value otherwise
\return DISTANCE_COMPUTATION_RESULTS::SUCCESS on success,
a negative error code from DISTANCE_COMPUTATION_RESULTS otherwise.
**/
static int computeCloud2CloudDistances( GenericIndexedCloudPersist* comparedCloud,
GenericIndexedCloudPersist* referenceCloud,
Expand Down Expand Up @@ -522,7 +523,7 @@ namespace CCCoreLib
ERROR_UNKOWN_ERRORMEASURES_TYPE,
ERROR_INTERNAL,
INVALID_INPUT,
SUCCESS = 1,
SUCCESS = 0,
};

//! Computes the "distance" (see ERROR_MEASURES) between a point cloud and a plane
Expand Down
4 changes: 4 additions & 0 deletions src/DistanceComputationTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ int DistanceComputationTools::computeCloud2CloudDistances( GenericIndexedCloudPe
//something went wrong
result = DISTANCE_COMPUTATION_RESULTS::ERROR_EXECUTE_FUNCTION_FOR_ALL_CELLS_AT_LEVEL_FAILURE;
}
else
{
result = DISTANCE_COMPUTATION_RESULTS::SUCCESS;
}


if (comparedOctree && !compOctree)
Expand Down
10 changes: 6 additions & 4 deletions src/RegistrationTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,8 @@ ICPRegistrationTools::RESULT_TYPE ICPRegistrationTools::Register( GenericIndexed
DistanceComputationTools::Cloud2CloudDistancesComputationParams c2cDistParams;
c2cDistParams.CPSet = data.CPSetRef;
c2cDistParams.maxThreadCount = params.maxThreadCount;
if (DistanceComputationTools::computeCloud2CloudDistances(data.cloud, model.cloud, c2cDistParams, progressCb) < 0)
if (DistanceComputationTools::computeCloud2CloudDistances(data.cloud, model.cloud, c2cDistParams, progressCb) <
DistanceComputationTools::DISTANCE_COMPUTATION_RESULTS::SUCCESS)
{
//an error occurred during distances computation...
return ICP_ERROR_DIST_COMPUTATION;
Expand Down Expand Up @@ -654,7 +655,7 @@ ICPRegistrationTools::RESULT_TYPE ICPRegistrationTools::Register( GenericIndexed
{
//retrieve the data point normal
const CCVector3* Nd = data.cloud->getNormal(i);

//retrieve the nearest model point normal
CCVector3 Nm;
if (inputModelMesh)
Expand Down Expand Up @@ -951,7 +952,8 @@ ICPRegistrationTools::RESULT_TYPE ICPRegistrationTools::Register( GenericIndexed
DistanceComputationTools::Cloud2CloudDistancesComputationParams c2cDistParams;
c2cDistParams.CPSet = data.CPSetRef;
c2cDistParams.maxThreadCount = params.maxThreadCount;
if (DistanceComputationTools::computeCloud2CloudDistances(data.cloud, model.cloud, c2cDistParams) < 0)
if (DistanceComputationTools::computeCloud2CloudDistances(data.cloud, model.cloud, c2cDistParams) <
DistanceComputationTools::DISTANCE_COMPUTATION_RESULTS::SUCCESS)
{
//an error occurred during distances computation...
result = ICP_ERROR_REGISTRATION_STEP;
Expand Down Expand Up @@ -1155,7 +1157,7 @@ bool RegistrationTools::RegistrationProcedure( GenericCloud* P, //data
{
return false;
}

PointCoordinateType sin_t = static_cast<PointCoordinateType>(S / Q);
PointCoordinateType cos_t = static_cast<PointCoordinateType>(C / Q);
PointCoordinateType inv_cos_t = 1 - cos_t;
Expand Down
Loading