From: Ilya Lysenkov Date: Thu, 29 Mar 2012 10:39:06 +0000 (+0000) Subject: Added wrappers of cvTriangulatePoints() X-Git-Tag: accepted/2.0/20130307.220821~931 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=37db334f8a066e7c9b6e2723b713027acd872e60;p=profile%2Fivi%2Fopencv.git Added wrappers of cvTriangulatePoints() --- diff --git a/modules/calib3d/include/opencv2/calib3d/calib3d.hpp b/modules/calib3d/include/opencv2/calib3d/calib3d.hpp index 21c84a4..65bdb87 100644 --- a/modules/calib3d/include/opencv2/calib3d/calib3d.hpp +++ b/modules/calib3d/include/opencv2/calib3d/calib3d.hpp @@ -674,6 +674,10 @@ CV_EXPORTS void computeCorrespondEpilines( InputArray points1, int whichImage, InputArray F, OutputArray lines ); +CV_EXPORTS_W void triangulatePoints( InputArray projMatr1, InputArray projMatr2, + InputArray projPoints1, InputArray projPoints2, + OutputArray points4D ); + template<> CV_EXPORTS void Ptr::delete_obj(); /*! diff --git a/modules/calib3d/src/triangulate.cpp b/modules/calib3d/src/triangulate.cpp index 41a0df2..fd2ef52 100644 --- a/modules/calib3d/src/triangulate.cpp +++ b/modules/calib3d/src/triangulate.cpp @@ -407,3 +407,19 @@ cvCorrectMatches(CvMat *F_, CvMat *points1_, CvMat *points2_, CvMat *new_points1 if( new_points2 ) cvConvert( points2, new_points2 ); } + +void cv::triangulatePoints( InputArray _projMatr1, InputArray _projMatr2, + InputArray _projPoints1, InputArray _projPoints2, + OutputArray _points4D ) +{ + Mat matr1 = _projMatr1.getMat(), matr2 = _projMatr2.getMat(); + Mat points1 = _projPoints1.getMat(), points2 = _projPoints2.getMat(); + + CvMat cvMatr1 = matr1, cvMatr2 = matr2; + CvMat cvPoints1 = points1, cvPoints2 = points2; + + _points4D.create(4, points1.cols, points1.type()); + CvMat cvPoints4D = _points4D.getMat(); + + cvTriangulatePoints(&cvMatr1, &cvMatr2, &cvPoints1, &cvPoints2, &cvPoints4D); +}