Imwarp results in unwanted image resize

2 次查看(过去 30 天)
I'm trying to correct for keystone distortion for a flat object imaged by the camera with incidence angle about 15-20 degrees. So, I shot several checkerboard images and obtained camera parameters with estimateCameraParameters function. Then I determine the transformation from one of the checkerboard images, invert it and use imwarp to obtain the image as if it was taken orthogonally to the object. And I'm very surprised to see that, whereas the original image im is 3456x5184x3, the transformed image imNew is only 186x317x3. Is it possible to keep the original image resolution? Here is the code, MyCamParams.mat contains camera parameters cameraParams determined by calibration.
load('MyCamParams');
[workimname, workimpath]=uigetfile('*.jpg');
im=imread(fullfile(workimpath, workimname));
[imagePoints, boardSize]=detectCheckerboardPoints(im);
squareSize=10; % in millimeters
worldPoints=generateCheckerboardPoints(boardSize, squareSize);
[R, t]=extrinsics(imagePoints, worldPoints, cameraParams);
T=[R(1, :); R(2, :); t]*cameraParams.IntrinsicMatrix;
tform=projective2d(T);
imNew=imwarp(im, invert(tform));

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Camera Calibration 的更多信息

产品


版本

R2014a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by