Imwarp results in unwanted image resize
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Nikolay Vinnichenko
el 15 de Jun. de 2018
Editada: Nikolay Vinnichenko
el 15 de Jun. de 2018
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 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Camera Calibration en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!