Commit 5834bea0 authored by Gagandeep Singh's avatar Gagandeep Singh Committed by Alexander Alekhin

Merge pull request #2385 from czgdp1807:issue-2339

Fixes error occurs in cv::ppf_match_3d::ICP::registerModelToScene()

* corrected out of range error

* remove unnecessary changes

* fix warning
parent b639795a
......@@ -246,6 +246,7 @@ static hashtable_int* getHashtable(int* data, size_t length, int numMaxElement)
int ICP::registerModelToScene(const Mat& srcPC, const Mat& dstPC, double& residual, Matx44d& pose)
{
int n = srcPC.rows;
CV_CheckGT(n, 0, "");
const bool useRobustReject = m_rejectionScale>0;
......@@ -280,10 +281,7 @@ int ICP::registerModelToScene(const Mat& srcPC, const Mat& dstPC, double& residu
// walk the pyramid
for (int level = m_numLevels-1; level >=0; level--)
{
const double impact = 2;
double div = pow((double)impact, (double)level);
//double div2 = div*div;
const int numSamples = cvRound((double)(n/(div)));
const int numSamples = divUp(n, 1 << level);
const double TolP = m_tolerance*(double)(level+1)*(level+1);
const int MaxIterationsPyr = cvRound((double)m_maxIterations/(level+1));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment