필터 지우기
필터 지우기

Imwarp results in unwanted image resize

조회 수: 2 (최근 30일)
Nikolay Vinnichenko
Nikolay Vinnichenko 2018년 6월 15일
편집: Nikolay Vinnichenko 2018년 6월 15일
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