UndistortPoints: Input != Output when distortionCoeffs = [0,0,0,0]

horst
Fri, 16 Jul 2021 15:10:08 +0000
C++

Hey,
I am using cv::undistortPoints() and for test reasons, I pass [0,0,0,0] as distortion coefficients. Unfortunately, I do not get the exact same results. Input point is (700,200) and output point is (700.5198, 200.156). Why is there a little deviation between both points? Is there a way to avoid that behavior?

	cv::Mat_<float64> K = cv::Mat_<float64>(3, 3);
	K(1, 0) = K(2, 0) = K(2, 1) = K(0, 1) = 0.;
	K(0, 0) = 721.5377;
	K(1, 1) = 721.5377;
	K(0, 2) = 609.5593;
	K(1, 2) = 172.854;
	K(2, 2) = 1.0;

	std::vector<cv::Point2d> bottomCenter_pixel{cv::Point2d(700,200)};

	std::vector<cv::Point2d> undistortedBottomCenter_pixel;
	std::vector<float64> distortionCoefficients = {0.0, 0.0, 0.0, 0.0};
	cv::fisheye::undistortPoints(bottomCenter_pixel, undistortedBottomCenter_pixel, K, distortionCoefficients, K);

I would be glad for any help.
Horst

4 posts - 2 participants