Skip to content

Commit

Permalink
Fix build on older OpenCV
Browse files Browse the repository at this point in the history
  • Loading branch information
bjsowa committed May 7, 2024
1 parent b70a54d commit 6932c23
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions aruco_opencv/src/aruco_tracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,14 @@ class ArucoTracker : public rclcpp_lifecycle::LifecycleNode
}
}

// Create a new board with all the object point offsetted so that point (0,0)
// is at the center of the board
#if CV_VERSION_MAJOR > 4 || CV_VERSION_MAJOR == 4 && CV_VERSION_MINOR >= 7
board = cv::makePtr<cv::aruco::Board>(obj_points, *dictionary_,
desc["first_id"].as<int>());
#else
board = cv::aruco::Board::create(obj_points, dictionary_, desc["first_id"].as<int>());
#endif
}

boards_.push_back(std::make_pair(name, board));
Expand Down

0 comments on commit 6932c23

Please sign in to comment.