mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
saveBestModel() is modified. accuracy test is passed.
This commit is contained in:
@@ -399,16 +399,18 @@ cv::Mat cv::findHomography( InputArray _points1, InputArray _points2,
|
||||
{
|
||||
tempMask = Mat::ones(npoints, 1, CV_8U);
|
||||
result = cb->runKernel(src, dst, H) > 0;
|
||||
}
|
||||
else if( method == RANSAC )
|
||||
}
|
||||
|
||||
else if( method == RANSAC)
|
||||
result = createRANSACPointSetRegistrator(cb, 4, ransacReprojThreshold, confidence, maxIters)->run(src, dst, H, tempMask);
|
||||
else if( method == LMEDS )
|
||||
result = createLMeDSPointSetRegistrator(cb, 4, confidence, maxIters)->run(src, dst, H, tempMask);
|
||||
else if( method == RHO ){
|
||||
else if( method == RHO )
|
||||
result = createAndRunRHORegistrator(confidence, maxIters, ransacReprojThreshold, npoints, src, dst, H, tempMask);
|
||||
}else
|
||||
else
|
||||
CV_Error(Error::StsBadArg, "Unknown estimation method");
|
||||
|
||||
|
||||
if( result && npoints > 4 && method != RHO)
|
||||
{
|
||||
compressPoints( src.ptr<Point2f>(), tempMask.ptr<uchar>(), 1, npoints );
|
||||
@@ -419,8 +421,9 @@ cv::Mat cv::findHomography( InputArray _points1, InputArray _points2,
|
||||
Mat dst1 = dst.rowRange(0, npoints);
|
||||
src = src1;
|
||||
dst = dst1;
|
||||
if( method == RANSAC || method == LMEDS )
|
||||
if( method == RANSAC || method == LMEDS)
|
||||
cb->runKernel( src, dst, H );
|
||||
|
||||
Mat H8(8, 1, CV_64F, H.ptr<double>());
|
||||
createLMSolver(makePtr<HomographyRefineCallback>(src, dst), 10)->run(H8);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user