フィルターのクリア

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 Center および File ExchangeCamera Calibration についてさらに検索

製品


リリース

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by