From 83efef4b9ae6a4f1c672493a4d92cb9bf93c1c82 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Sat, 23 Apr 2011 12:49:14 +0000 Subject: [PATCH] added overloaded variants of findHomography & findFundamentalMat for backward compatibility --- .../calib3d/include/opencv2/calib3d/calib3d.hpp | 12 ++++++++++-- modules/calib3d/src/fundam.cpp | 15 ++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/modules/calib3d/include/opencv2/calib3d/calib3d.hpp b/modules/calib3d/include/opencv2/calib3d/calib3d.hpp index 47a4e124af..4a394f0fde 100644 --- a/modules/calib3d/include/opencv2/calib3d/calib3d.hpp +++ b/modules/calib3d/include/opencv2/calib3d/calib3d.hpp @@ -442,10 +442,13 @@ enum }; //! computes the best-fit perspective transformation mapping srcPoints to dstPoints. -CV_EXPORTS_W Mat findHomography( const InputArray& srcPoints, - const InputArray& dstPoints, +CV_EXPORTS_W Mat findHomography( const InputArray& srcPoints, const InputArray& dstPoints, int method=0, double ransacReprojThreshold=3, OutputArray mask=OutputArray()); + +//! variant of findHomography for backward compatibility +CV_EXPORTS Mat findHomography( const InputArray& srcPoints, const InputArray& dstPoints, + OutputArray mask, int method=0, double ransacReprojThreshold=3); //! Computes RQ decomposition of 3x3 matrix CV_EXPORTS_W Vec3d RQDecomp3x3( const InputArray& src, OutputArray mtxR, OutputArray mtxQ, @@ -640,6 +643,11 @@ CV_EXPORTS_W Mat findFundamentalMat( const InputArray& points1, const InputArray double param1=3., double param2=0.99, OutputArray mask=OutputArray()); +//! variant of findFundamentalMat for backward compatibility +CV_EXPORTS Mat findFundamentalMat( const InputArray& points1, const InputArray& points2, + OutputArray mask, int method=FM_RANSAC, + double param1=3., double param2=0.99); + //! finds coordinates of epipolar lines corresponding the specified points CV_EXPORTS void computeCorrespondEpilines( const InputArray& points1, int whichImage, const InputArray& F, diff --git a/modules/calib3d/src/fundam.cpp b/modules/calib3d/src/fundam.cpp index fab93bf60a..98b3b66ede 100644 --- a/modules/calib3d/src/fundam.cpp +++ b/modules/calib3d/src/fundam.cpp @@ -1065,7 +1065,13 @@ cv::Mat cv::findHomography( const InputArray& _points1, const InputArray& _point H = Scalar(0); return H; } - + +cv::Mat cv::findHomography( const InputArray& _points1, const InputArray& _points2, + OutputArray _mask, int method, double ransacReprojThreshold ) +{ + return cv::findHomography(_points1, _points2, method, ransacReprojThreshold, _mask); +} + cv::Mat cv::findFundamentalMat( const InputArray& _points1, const InputArray& _points2, int method, double param1, double param2, OutputArray _mask ) @@ -1089,6 +1095,13 @@ cv::Mat cv::findFundamentalMat( const InputArray& _points1, const InputArray& _p return F; } +cv::Mat cv::findFundamentalMat( const InputArray& _points1, const InputArray& _points2, + OutputArray _mask, int method, double param1, double param2 ) +{ + return cv::findFundamentalMat(_points1, _points2, method, param1, param2, _mask); +} + + void cv::computeCorrespondEpilines( const InputArray& _points, int whichImage, const InputArray& _Fmat, OutputArray _lines ) { -- GitLab