Skip to content

Commit 9cfe981

Browse files
committed
Merge pull request opencv#18378 from nathanrgodwin:ippe_fix
2 parents 5e90802 + 2f9072e commit 9cfe981

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/calib3d/src/ippe.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,18 @@ void PoseSolver::solveGeneric(InputArray _objectPoints, InputArray _normalizedIn
7777
OutputArray _Ma, OutputArray _Mb)
7878
{
7979
//argument checking:
80-
size_t n = static_cast<size_t>(_objectPoints.rows() * _objectPoints.cols()); //number of points
80+
size_t n = static_cast<size_t>(_normalizedInputPoints.rows()) * static_cast<size_t>(_normalizedInputPoints.cols()); //number of points
8181
int objType = _objectPoints.type();
8282
int type_input = _normalizedInputPoints.type();
8383

8484
CV_CheckType(objType, objType == CV_32FC3 || objType == CV_64FC3,
8585
"Type of _objectPoints must be CV_32FC3 or CV_64FC3" );
8686
CV_CheckType(type_input, type_input == CV_32FC2 || type_input == CV_64FC2,
87-
"Type of _normalizedInputPoints must be CV_32FC3 or CV_64FC3" );
87+
"Type of _normalizedInputPoints must be CV_32FC2 or CV_64FC2" );
8888
CV_Assert(_objectPoints.rows() == 1 || _objectPoints.cols() == 1);
8989
CV_Assert(_objectPoints.rows() >= 4 || _objectPoints.cols() >= 4);
9090
CV_Assert(_normalizedInputPoints.rows() == 1 || _normalizedInputPoints.cols() == 1);
91-
CV_Assert(static_cast<size_t>(_objectPoints.rows() * _objectPoints.cols()) == n);
91+
CV_Assert(static_cast<size_t>(_objectPoints.rows()) * static_cast<size_t>(_objectPoints.cols()) == n);
9292

9393
Mat normalizedInputPoints;
9494
if (type_input == CV_32FC2)
@@ -101,7 +101,7 @@ void PoseSolver::solveGeneric(InputArray _objectPoints, InputArray _normalizedIn
101101
}
102102

103103
Mat objectInputPoints;
104-
if (type_input == CV_32FC3)
104+
if (objType == CV_32FC3)
105105
{
106106
_objectPoints.getMat().convertTo(objectInputPoints, CV_64F);
107107
}

0 commit comments

Comments
 (0)