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

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

why are you passing your K for the Rectification transformation? it’s a camera intrinsic matrix and you pass it as such already.

K = np.eye(3)
K[0,0] = K[1,1] = 721.5377
K[0:2,2] = (609.5593, 172.854)

# array([[721.5377,   0.    , 609.5593],
#        [  0.    , 721.5377, 172.854 ],
#        [  0.    ,   0.    ,   1.    ]])

distcoeffs = np.float32([0,0,0,0])

points = np.float32([
    [609.5593, 172.854 ],
    [700.0   , 200.0   ]
]).reshape((-1, 1, 2))

cv.fisheye.undistortPoints(points, K, distcoeffs)
# array([[[0.     , 0.     ]],
#        [[0.12606, 0.03784]]], dtype=float32)

Ahh I see valid point. Removing K gives me as well (0.12606 , 0.03784). But calculating (multiply with K) the pixel coordinates again gives me (700.5163, 200.157). Or do you recover some other pixel coordinates? If so, pls let me know how you do it. Thx for your fast response btw.

Problem solved by passing K for P. Thus:

	cv::fisheye::undistortPoints(bottomCenter_pixel, undistortedBottomCenter_pixel, K, distortionCoefficients, cv::noArray(), K);

This gives pretty much the same pixel values when using distortion coeffcients [0,0,0,0].