From 6d1f4bfba4b9ce54c49981e2d0557b2c0017f1fa Mon Sep 17 00:00:00 2001 From: Ilya Lysenkov Date: Mon, 26 Mar 2012 11:10:34 +0000 Subject: [PATCH] Added projectPoints() for 3xN objectPoints and 2xN imagePoints (#1550) --- modules/calib3d/src/calibration.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/calib3d/src/calibration.cpp b/modules/calib3d/src/calibration.cpp index 2f2dd317d3..7f84eabd5b 100644 --- a/modules/calib3d/src/calibration.cpp +++ b/modules/calib3d/src/calibration.cpp @@ -800,7 +800,8 @@ CV_IMPL void cvProjectPoints2( const CvMat* objectPoints, if( CV_IS_CONT_MAT(objectPoints->type) && (CV_MAT_DEPTH(objectPoints->type) == CV_32F || CV_MAT_DEPTH(objectPoints->type) == CV_64F)&& ((objectPoints->rows == 1 && CV_MAT_CN(objectPoints->type) == 3) || - (objectPoints->rows == count && CV_MAT_CN(objectPoints->type)*objectPoints->cols == 3))) + (objectPoints->rows == count && CV_MAT_CN(objectPoints->type)*objectPoints->cols == 3) || + (objectPoints->rows == 3 && CV_MAT_CN(objectPoints->type) == 1 && objectPoints->cols == count))) { matM = cvCreateMat( objectPoints->rows, objectPoints->cols, CV_MAKETYPE(CV_64F,CV_MAT_CN(objectPoints->type)) ); cvConvert(objectPoints, matM); @@ -815,7 +816,8 @@ CV_IMPL void cvProjectPoints2( const CvMat* objectPoints, if( CV_IS_CONT_MAT(imagePoints->type) && (CV_MAT_DEPTH(imagePoints->type) == CV_32F || CV_MAT_DEPTH(imagePoints->type) == CV_64F) && ((imagePoints->rows == 1 && CV_MAT_CN(imagePoints->type) == 2) || - (imagePoints->rows == count && CV_MAT_CN(imagePoints->type)*imagePoints->cols == 2))) + (imagePoints->rows == count && CV_MAT_CN(imagePoints->type)*imagePoints->cols == 2) || + (imagePoints->rows == 2 && CV_MAT_CN(imagePoints->type) == 1 && imagePoints->cols == count))) { _m = cvCreateMat( imagePoints->rows, imagePoints->cols, CV_MAKETYPE(CV_64F,CV_MAT_CN(imagePoints->type)) ); cvConvert(imagePoints, _m);