% 利用matlab計(jì)算屏幕偏轉(zhuǎn)
I = imread('ZWIN_.jpg');
images = imageDatastore('F:\PictureFORCalibration\P1');
[imagePoints,boardSize] = detectCheckerboardPoints(images.Files);
squareSize = 25;
worldPoints = generateCheckerboardPoints(boardSize,squareSize);
imageSize = [size(I,1),size(I,2)];
cameraParams = estimateCameraParameters(imagePoints,worldPoints, ...
'ImageSize',imageSize,'EstimateTangentialDistortion' ,true,...
'NumRadialDistortionCoefficients',3,'EstimateSkew',true);
imOrig = I;
figure; imshow(imOrig);
title('Input Image');
im = undistortImage(imOrig,cameraParams);
[imagePoints,boardSize] = detectCheckerboardPoints(im);
[rotationMatrix,translationVector] = extrinsics(...
? ? imagePoints,worldPoints,cameraParams);
figure
showExtrinsics(cameraParams);
disp('旋轉(zhuǎn)矩陣')
disp(rotationMatrix);
disp('平移矩陣')
disp(translationVector);