MATLAB Answers

undistortFisheyeImage outputs much smaller image than original image

3 views (last 30 days)
Ernst Jan Grift
Ernst Jan Grift on 1 Oct 2018

Dear all,

I am calibrating a GoPro Hero 5 black following the MATLAB example provided at the function undistortFisheyeImage(). I moved the camera around a checkerboard and analysed 10-200 frames from the video (variations in number of frames didn't change the outcome much). I then used the following code

% Calibration name
calname = 'calGoProHero51080p60fpsWide.mat';
load(calname)
images = imageDatastore('myPath\calibration1080p60fpsWide\','FileExtensions','.jpg');
[imagePoints,boardSize] = detectCheckerboardPoints(images.Files);
squareSize = 20; % millimeters
worldPoints = generateCheckerboardPoints(boardSize,squareSize);
I = readimage(images,1);
imageSize = [size(I,1) size(I,2)];
params = estimateFisheyeParameters(imagePoints,worldPoints,imageSize);
I = readimage(images,20);
J1 = undistortFisheyeImage(I,params.Intrinsics);
figure
imshowpair(I,J1,'montage')
title('Original Image (left) vs. Corrected Image (right)')
J2 = undistortFisheyeImage(I,params.Intrinsics,'OutputView','full');
figure
imshow(J2)
title('Full Output View')
save(calname,'params');

The calibration for a typical image looks like this (e.g. 1080 Wide view):

However, for a different camera setting (1080p Narrow view), I expect less distortion and for the rest a similar image. Unfortunately the image becomes very small as shown here:

I took a different calibration video; again moving the camera around the calibration checkerboard but the result stays the same. Can anyone shed light on this?

Kind regards,

Ernst Jan

Answers (0)

Community Treasure Hunt

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

Start Hunting!