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
8 changes: 8 additions & 0 deletions include/RegistrationTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ namespace CCCoreLib
, minRMSDecrease(1.0e-5)
, nbMaxIterations(20)
, adjustScale(false)
, minScale(std::numeric_limits<double>::quiet_NaN())
, maxScale(std::numeric_limits<double>::quiet_NaN())
, filterOutFarthestPoints(false)
, samplingLimit(50000)
, finalOverlapRatio(1.0)
Expand All @@ -185,6 +187,12 @@ namespace CCCoreLib
//! Whether to release the scale parameter during the registration procedure or not
bool adjustScale;

//! Min scale (if adjustScale is true - NaN if no minimum boundary)
double minScale;

//! Max scale (if adjustScale is true - NaN if no maximum boundary)
double maxScale;

//! If true, the algorithm will automatically ignore farthest points from the reference, for better convergence
bool filterOutFarthestPoints;

Expand Down
14 changes: 12 additions & 2 deletions src/RegistrationTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,8 +811,18 @@ ICPRegistrationTools::RESULT_TYPE ICPRegistrationTools::Register( GenericIndexed

if (params.adjustScale)
{
transform.s *= currentTrans.s;
transform.T *= currentTrans.s;
double newScale = transform.s * currentTrans.s;
if (std::isfinite(params.minScale))
{
newScale = std::max(newScale, params.minScale);
}
if (std::isfinite(params.maxScale))
{
newScale = std::min(newScale, params.maxScale);
}

transform.T *= (newScale / transform.s);
transform.s = newScale;
}

transform.T += currentTrans.T;
Expand Down
Loading