Skip to content

cudalegacy: test CUDA_Calib3D/SolvePnPRansac is peaky  #19389

@tomoaki0705

Description

@tomoaki0705
System information (version)
  • OpenCV => recent 3.4 ( 235e648 ) /master/next
  • Operating System / Platform => Jetson Xavier (Ubuntu 18.04)
  • Compiler => GCC 7.5.0
Detailed description
[----------] 1 test from CUDA_Calib3D/SolvePnPRansac
[ RUN      ] CUDA_Calib3D/SolvePnPRansac.Accuracy/0, where GetParam() = Xavier
/mnt/sd/opencv-fork/modules/cudalegacy/test/test_calib3d.cpp:187: Failure
Expected: (cv::norm(tvec - tvec_gold)) <= (1e-3), actual: 0.11245 vs 0.001
[  FAILED  ] CUDA_Calib3D/SolvePnPRansac.Accuracy/0, where GetParam() = Xavier (286 ms)
[----------] 1 test from CUDA_Calib3D/SolvePnPRansac (286 ms total)

This test sometimes pass, sometimes fail.

[----------] 1 test from CUDA_Calib3D/SolvePnPRansac
[ RUN      ] CUDA_Calib3D/SolvePnPRansac.Accuracy/0, where GetParam() = Xavier
[       OK ] CUDA_Calib3D/SolvePnPRansac.Accuracy/0 (263 ms)
[----------] 1 test from CUDA_Calib3D/SolvePnPRansac (263 ms total)

Looking in the test, it's generating 5000 points in [0:100] range

cv::Mat object = randomMat(cv::Size(5000, 1), CV_32FC3, 0, 100);

It's too dense for estimating the correspondence, so many false projection.
It only depends on seed whether the test fails or passes.
This patch will make the test more stable.

Steps to reproduce
GTEST_FILTER=CUDA_Calib3D/SolvePnPRansac*  ./bin/opencv_test_cudalegacy --gtest_repeat=-1
Issue submission checklist
  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues,
    forum.opencv.org, Stack Overflow, etc and have not found solution
  • I updated to latest OpenCV version and the issue is still there
  • There is reproducer code and related data files: videos, images, onnx, etc

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions