When I did many kinds of attempts under opencv, but still can't resolve it, I tried to get other solution. After I use matlab, I found it done.
I compare the imagepoints from opencv and matlab, they are different, I think they should maybe used different algorithms for checkerboard detection, and different algorithm to optimization(maybe Levenberg-Marquardt non-linear least squares algorithm and gradient descent algorithm).
Attached matlab sample code by Matlab software:
% Define images to process
imageFileNames1 = {'F:\CaptureFiles\left1.bmp',...
};
imageFileNames2 = {'F:\CaptureFiles\right1.bmp',...
};
% Detect checkerboards in images
[imagePoints, boardSize, imagesUsed] = detectCheckerboardPoints(imageFileNames1, imageFileNames2);
% Generate world coordinates of the checkerboard keypoints
squareSize = 50; % in units of 'mm'
worldPoints = generateCheckerboardPoints(boardSize, squareSize);
% Calibrate the camera
[stereoParams, pairsUsed, estimationErrors] = estimateCameraParameters(imagePoints, worldPoints, ...
'EstimateSkew', false, 'EstimateTangentialDistortion', false, ...
'NumRadialDistortionCoefficients', 2, 'WorldUnits', 'mm', ...
'InitialIntrinsicMatrix', [], 'InitialRadialDistortion', []);
You mention in a comment later that you are using a variable zoom lens. The calibration is heavily zoom dependent. 'fx' and 'fy', commonly referred to as focal length are really unit conversions from world-space units to pixel-space units and don't have a simple relationship to lens focal length. Any adjustment to the lens zoom or to the lens focus, for a lens that can be approximated by the thin lens equation, will change the camera intrinsic parameters and require recalibration.