Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 66afede

Browse files
author
Alex
committed
fix test
1 parent 39e2ebb commit 66afede

File tree

1 file changed

+4
-23
lines changed

1 file changed

+4
-23
lines changed

modules/objdetect/test/test_charucodetection.cpp

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ void CV_CharucoPoseEstimation::run(int) {
213213

214214
Mat distCoeffs(5, 1, CV_64FC1, Scalar::all(0));
215215
// for different perspectives
216-
for(double distance : {0.2, 0.3}) {
216+
for(double distance : {0.2, 0.25}) {
217217
for(int yaw = -55; yaw <= 50; yaw += 25) {
218218
for(int pitch = -55; pitch <= 50; pitch += 25) {
219219

@@ -245,16 +245,6 @@ void CV_CharucoPoseEstimation::run(int) {
245245
detector.detectBoard(img, charucoCorners, charucoIds, corners, ids);
246246
}
247247

248-
// // create debug images
249-
// Mat rgb_image;
250-
// cv::cvtColor(img, rgb_image, COLOR_GRAY2RGB);
251-
// aruco::drawDetectedCornersCharuco(rgb_image, charucoCorners, charucoIds);
252-
// aruco::drawDetectedMarkers(rgb_image, corners, ids);
253-
// cv::imwrite("Debug_CV_CharucoPoseEstimation"
254-
// + (legacyPattern ? std::string("_legacy") : std::string(""))
255-
// + "_dist" + std::to_string(distance)
256-
// + "_yaw" + std::to_string(yaw)
257-
// + "_pitch" + std::to_string(pitch) + ".png", rgb_image);
258248

259249
ASSERT_EQ(ids.size(), board.getIds().size());
260250
if(charucoIds.size() == 0) continue;
@@ -323,7 +313,7 @@ void CV_CharucoDiamondDetection::run(int) {
323313

324314
int iter = 0;
325315
Mat cameraMatrix = Mat::eye(3, 3, CV_64FC1);
326-
Size imgSize(750, 750);
316+
Size imgSize(500, 500);
327317
aruco::DetectorParameters params;
328318
params.minDistanceToBorder = 0;
329319
float squareLength = 0.03f;
@@ -333,7 +323,7 @@ void CV_CharucoDiamondDetection::run(int) {
333323
aruco::CharucoDetector detector(board);
334324

335325

336-
cameraMatrix.at<double>(0, 0) = cameraMatrix.at< double >(1, 1) = 1000;
326+
cameraMatrix.at<double>(0, 0) = cameraMatrix.at< double >(1, 1) = 650;
337327
cameraMatrix.at<double>(0, 2) = imgSize.width / 2;
338328
cameraMatrix.at<double>(1, 2) = imgSize.height / 2;
339329

@@ -344,7 +334,7 @@ void CV_CharucoDiamondDetection::run(int) {
344334
detector.setCharucoParameters(charucoParameters);
345335

346336
// for different perspectives
347-
for(double distance : {0.2, 0.3}) {
337+
for(double distance : {0.2, 0.22}) {
348338
for(int yaw = -50; yaw <= 50; yaw += 25) {
349339
for(int pitch = -50; pitch <= 50; pitch += 25) {
350340

@@ -376,15 +366,6 @@ void CV_CharucoDiamondDetection::run(int) {
376366

377367
detector.detectDiamonds(img, diamondCorners, diamondIds, corners, ids);
378368

379-
// // create debug images
380-
// Mat rgb_image;
381-
// cv::cvtColor(img, rgb_image, COLOR_GRAY2RGB);
382-
// aruco::drawDetectedDiamonds(rgb_image, diamondCorners, diamondIds);
383-
// aruco::drawDetectedMarkers(rgb_image, corners, ids);
384-
// cv::imwrite(std::string("Debug_CV_CharucoDiamondDetection")
385-
// + "_dist" + std::to_string(distance)
386-
// + "_yaw" + std::to_string(yaw)
387-
// + "_pitch" + std::to_string(pitch) + ".png", rgb_image);
388369

389370
// check detect
390371
if(ids.size() != 4) {

0 commit comments

Comments
 (0)