|
|
|
@ -538,7 +538,48 @@ void CV_CharucoDiamondDetection::run(int) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Check charuco board creation |
|
|
|
|
*/ |
|
|
|
|
class CV_CharucoBoardCreation : public cvtest::BaseTest { |
|
|
|
|
public: |
|
|
|
|
CV_CharucoBoardCreation(); |
|
|
|
|
|
|
|
|
|
protected: |
|
|
|
|
void run(int); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
CV_CharucoBoardCreation::CV_CharucoBoardCreation() {} |
|
|
|
|
|
|
|
|
|
void CV_CharucoBoardCreation::run(int) |
|
|
|
|
{ |
|
|
|
|
Ptr<aruco::Dictionary> dictionary = aruco::getPredefinedDictionary(aruco::DICT_5X5_250); |
|
|
|
|
int n = 6; |
|
|
|
|
|
|
|
|
|
float markerSizeFactor = 0.5f; |
|
|
|
|
|
|
|
|
|
for (float squareSize_mm = 5.0f; squareSize_mm < 35.0f; squareSize_mm += 0.1f) |
|
|
|
|
{ |
|
|
|
|
Ptr<aruco::CharucoBoard> board_meters = aruco::CharucoBoard::create( |
|
|
|
|
n, n, squareSize_mm*1e-3f, squareSize_mm * markerSizeFactor * 1e-3f, dictionary); |
|
|
|
|
|
|
|
|
|
Ptr<aruco::CharucoBoard> board_millimeters = aruco::CharucoBoard::create( |
|
|
|
|
n, n, squareSize_mm, squareSize_mm * markerSizeFactor, dictionary); |
|
|
|
|
|
|
|
|
|
for (size_t i = 0; i < board_meters->nearestMarkerIdx.size(); i++) |
|
|
|
|
{ |
|
|
|
|
if (board_meters->nearestMarkerIdx[i].size() != board_millimeters->nearestMarkerIdx[i].size() || |
|
|
|
|
board_meters->nearestMarkerIdx[i][0] != board_millimeters->nearestMarkerIdx[i][0]) |
|
|
|
|
{ |
|
|
|
|
ts->printf(cvtest::TS::LOG, |
|
|
|
|
cv::format("Charuco board topology is sensitive to scale with squareSize=%.1f\n", |
|
|
|
|
squareSize_mm).c_str()); |
|
|
|
|
ts->set_failed_test_info(cvtest::TS::FAIL_INVALID_OUTPUT); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TEST(CV_CharucoDetection, accuracy) { |
|
|
|
@ -546,7 +587,6 @@ TEST(CV_CharucoDetection, accuracy) { |
|
|
|
|
test.safe_run(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TEST(CV_CharucoPoseEstimation, accuracy) { |
|
|
|
|
CV_CharucoPoseEstimation test; |
|
|
|
|
test.safe_run(); |
|
|
|
@ -557,4 +597,9 @@ TEST(CV_CharucoDiamondDetection, accuracy) { |
|
|
|
|
test.safe_run(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
TEST(CV_CharucoBoardCreation, accuracy) { |
|
|
|
|
CV_CharucoBoardCreation test; |
|
|
|
|
test.safe_run(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}} // namespace
|
|
|
|
|