зеркало из https://github.com/microsoft/opencv.git
several minor fixes proposed by Andrey
This commit is contained in:
Родитель
d925879366
Коммит
8a6d2bbd3d
|
@ -403,15 +403,15 @@ void CirclesGridClusterFinder::parsePatternPoints(const std::vector<cv::Point2f>
|
|||
idealPt = Point2f(j*squareSize, i*squareSize);
|
||||
|
||||
Mat query(1, 2, CV_32F, &idealPt);
|
||||
int knn = 1;
|
||||
int indicesbuf = 0;
|
||||
float distsbuf = 0.f;
|
||||
const int knn = 1;
|
||||
int indicesbuf[knn] = {0};
|
||||
float distsbuf[knn] = {0.f};
|
||||
Mat indices(1, knn, CV_32S, &indicesbuf);
|
||||
Mat dists(1, knn, CV_32F, &distsbuf);
|
||||
flannIndex.knnSearch(query, indices, dists, knn, flann::SearchParams());
|
||||
centers.push_back(patternPoints.at(indicesbuf));
|
||||
centers.push_back(patternPoints.at(indicesbuf[0]));
|
||||
|
||||
if(distsbuf > maxRectifiedDistance)
|
||||
if(distsbuf[0] > maxRectifiedDistance)
|
||||
{
|
||||
#ifdef DEBUG_CIRCLES
|
||||
cout << "Pattern not detected: too large rectified distance" << endl;
|
||||
|
|
|
@ -131,7 +131,7 @@ public:
|
|||
const Point2f* m = m2.ptr<Point2f>();
|
||||
|
||||
double LtL[9][9], W[9][1], V[9][9];
|
||||
Mat _LtL( 9, 9, CV_64F, LtL );
|
||||
Mat _LtL( 9, 9, CV_64F, &LtL[0][0] );
|
||||
Mat matW( 9, 1, CV_64F, W );
|
||||
Mat matV( 9, 9, CV_64F, V );
|
||||
Mat _H0( 3, 3, CV_64F, V[8] );
|
||||
|
|
|
@ -217,7 +217,7 @@ CV_INIT_ALGORITHM(LMSolverImpl, "LMSolver",
|
|||
obj.info()->addParam(obj, "maxIters", obj.maxIters);
|
||||
obj.info()->addParam(obj, "printInterval", obj.printInterval));
|
||||
|
||||
CV_EXPORTS Ptr<LMSolver> createLMSolver(const Ptr<LMSolver::Callback>& cb, int maxIters)
|
||||
Ptr<LMSolver> createLMSolver(const Ptr<LMSolver::Callback>& cb, int maxIters)
|
||||
{
|
||||
CV_Assert( !LMSolverImpl_info_auto.name().empty() );
|
||||
return new LMSolverImpl(cb, maxIters);
|
||||
|
|
|
@ -81,7 +81,7 @@ public:
|
|||
|
||||
CV_EXPORTS Ptr<LMSolver> createLMSolver(const Ptr<LMSolver::Callback>& cb, int maxIters);
|
||||
|
||||
class PointSetRegistrator : public Algorithm
|
||||
class CV_EXPORTS PointSetRegistrator : public Algorithm
|
||||
{
|
||||
public:
|
||||
class CV_EXPORTS Callback
|
||||
|
|
|
@ -83,8 +83,6 @@ public:
|
|||
checkPartialSubsets = true;
|
||||
}
|
||||
|
||||
virtual ~RANSACPointSetRegistrator() {}
|
||||
|
||||
int findInliers( const Mat& m1, const Mat& m2, const Mat& model, Mat& err, Mat& mask, double thresh ) const
|
||||
{
|
||||
cb->computeError( m1, m2, model, err );
|
||||
|
@ -318,9 +316,8 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
int iter, niters = cvRound(std::log(1-confidence)/
|
||||
std::log(1-std::pow(1-outlierRatio,(double)modelPoints)));
|
||||
niters = MIN( MAX(niters, 3), maxIters );
|
||||
int iter, niters = RANSACUpdateNumIters(confidence, outlierRatio, modelPoints, maxIters);
|
||||
niters = MAX(niters, 3);
|
||||
|
||||
for( iter = 0; iter < niters; iter++ )
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче