Commit 820af3a0 authored by Vladislav Sovrasov's avatar Vladislav Sovrasov

aruco::Board::create: fix debug assertion fail

parent 933f53e4
...@@ -1284,14 +1284,11 @@ Ptr<Board> Board::create(InputArrayOfArrays objPoints, const Ptr<Dictionary> &di ...@@ -1284,14 +1284,11 @@ Ptr<Board> Board::create(InputArrayOfArrays objPoints, const Ptr<Dictionary> &di
for (unsigned int i = 0; i < objPoints.total(); i++) { for (unsigned int i = 0; i < objPoints.total(); i++) {
std::vector<Point3f> corners; std::vector<Point3f> corners;
Mat corners_mat = objPoints.getMat(i); Mat corners_mat = objPoints.getMat(i);
if(objPoints.type() == CV_32FC1)
{ if(corners_mat.type() == CV_32FC1)
CV_Assert(corners_mat.total() == 12); corners_mat = corners_mat.reshape(3);
} CV_Assert(corners_mat.total() == 4);
else
{
CV_Assert(corners_mat.total() == 4);
}
for (int j = 0; j < 4; j++) { for (int j = 0; j < 4; j++) {
corners.push_back(corners_mat.at<Point3f>(j)); corners.push_back(corners_mat.at<Point3f>(j));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment