From 24baeaae27919d1ee31490669af2144cd122cd31 Mon Sep 17 00:00:00 2001 From: Roman Golovanov Date: Thu, 18 Feb 2021 19:46:39 +0200 Subject: [PATCH] Fix omnidir::undistortPoints The relevant bug was reported in https://github.com/opencv/opencv_contrib/issues/1612 The _xi was erroneously applied at points re-projection to camera plane. _xi parameter was already taken in use while projection of points to unit sphere. --- modules/ccalib/src/omnidir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ccalib/src/omnidir.cpp b/modules/ccalib/src/omnidir.cpp index a67a6bd6c07..83e48725da6 100644 --- a/modules/ccalib/src/omnidir.cpp +++ b/modules/ccalib/src/omnidir.cpp @@ -330,7 +330,7 @@ void cv::omnidir::undistortPoints( InputArray distorted, OutputArray undistorted Vec3d Xs = Xw / cv::norm(Xw); // reproject to camera plane - Vec3d ppu = Vec3d(Xs[0]/(Xs[2]+_xi), Xs[1]/(Xs[2]+_xi), 1.0); + Vec3d ppu = Vec3d(Xs[0]/Xs[2], Xs[1]/Xs[2], 1.0); if (undistorted.depth() == CV_32F) { dstf[i] = Vec2f((float)ppu[0], (float)ppu[1]);