Skip to content

Commit 820af3a

Browse files
committed
aruco::Board::create: fix debug assertion fail
1 parent 933f53e commit 820af3a

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

modules/aruco/src/aruco.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,14 +1284,11 @@ Ptr<Board> Board::create(InputArrayOfArrays objPoints, const Ptr<Dictionary> &di
12841284
for (unsigned int i = 0; i < objPoints.total(); i++) {
12851285
std::vector<Point3f> corners;
12861286
Mat corners_mat = objPoints.getMat(i);
1287-
if(objPoints.type() == CV_32FC1)
1288-
{
1289-
CV_Assert(corners_mat.total() == 12);
1290-
}
1291-
else
1292-
{
1293-
CV_Assert(corners_mat.total() == 4);
1294-
}
1287+
1288+
if(corners_mat.type() == CV_32FC1)
1289+
corners_mat = corners_mat.reshape(3);
1290+
CV_Assert(corners_mat.total() == 4);
1291+
12951292
for (int j = 0; j < 4; j++) {
12961293
corners.push_back(corners_mat.at<Point3f>(j));
12971294
}

0 commit comments

Comments
 (0)