测试Calib3d_StereoCalibrate_C和Calib3d_StereoCalibrate_CPP在64位ARM上失败。
[----------] 1 test from Calib3d_StereoCalibrate_C
[ RUN ] Calib3d_StereoCalibrate_C.regression
/home/ubuntu/opencv-fork/modules/ts/src/ts.cpp:518: Failure
Failed
failure reason: Invalid function output
test case #-1
seed: ffffffffffffffff
-----------------------------------
LOG:
Points reprojected with a matrix Q and points reconstructed by triangulation are different, testcase 1
Testcase 1. Max distance (calibrated) =2.2571
Max distance (uncalibrated) =3.5603
-----------------------------------
[ FAILED ] Calib3d_StereoCalibrate_C.regression (6188 ms)
[----------] 1 test from Calib3d_StereoCalibrate_C (6188 ms total)
[----------] 1 test from Calib3d_StereoCalibrate_CPP
[ RUN ] Calib3d_StereoCalibrate_CPP.regression
/home/ubuntu/opencv-fork/modules/ts/src/ts.cpp:518: Failure
Failed
failure reason: Invalid function output
test case #-1
seed: ffffffffffffffff
-----------------------------------
LOG:
Points reprojected with a matrix Q and points reconstructed by triangulation are different, testcase 1
Testcase 1. Max distance (calibrated) =2.2571
Max distance (uncalibrated) =3.5603
-----------------------------------
[ FAILED ] Calib3d_StereoCalibrate_CPP.regression (6189 ms)
[----------] 1 test from Calib3d_StereoCalibrate_CPP (6190 ms total)
我追踪了这个问题并意识到这个问题在调试模式下无法重现。
[----------] 1 test from Calib3d_StereoCalibrate_C
[ RUN ] Calib3d_StereoCalibrate_C.regression
[ OK ] Calib3d_StereoCalibrate_C.regression (29540 ms)
[----------] 1 test from Calib3d_StereoCalibrate_C (29540 ms total)
[----------] 1 test from Calib3d_StereoCalibrate_CPP
[ RUN ] Calib3d_StereoCalibrate_CPP.regression
[ OK ] Calib3d_StereoCalibrate_CPP.regression (29350 ms)
[----------] 1 test from Calib3d_StereoCalibrate_CPP (29350 ms total)
我不得不在这里使用fmadd,并确认它让测试通过。 有没有办法处理这个或解决方法?
答案 0 :(得分:1)
这是与arm64的opencv相关的已知错误。
我过去曾经有过这种情况。 原因是因为fmadd和单独的乘法+加法之间存在差异。 与32位版本相比,64位上的GCC倾向于尽可能多地使用fmadd。