const auto image = cv::imread('tagfile.png', IMREAD_GRAYSCALE);
const auto family = cv::aruco::PredefinedDictionaryType::<family>;
cv::aruco::ArucoDetector detector {cv::aruco::getPredefinedDictionary(family)};
auto ids = std::vector<int>{};
auto markers = std::vector<std::vector<::cv::Point2f>>{};
detector.detectMarkers(image, markers, ids);
for (const auto& marker : markers) {
const auto top_left = marker[0];
const auto top_right = marker[1];
const auto bottom_right = marker[2];
const auto bottom_left = marker[3];
std::cout << "top_left: " << top_left << std::endl;
std::cout << "top right: " << top_right << std::endl;
std::cout << "bottom right: " << bottom_right << std::endl;
std::cout << "bottom left: " << bottom_left << std::endl;
}
和
预期的转角顺序如“ documentation”中描述的左上,右上,右下和左下。
但对于apriltag,我得到了以下顺序:右下,左下,左上和右上角。
似乎以180度围绕Z轴旋转Apriltag图案。 Aruco标记是正确的顺序。所以我的问题在这里,opencv的功能或错误。