Remove Distortion from an Image Using the Camera Parameters Object

%The following numbers are the parameter after export from camera calibration.
Standard Errors of Estimated Camera Parameters
---------------------------------------------
Intrinsics
----------
%Focal length (pixels): [ 3882.2250 +/- 14.6398 3869.1827 +/- 14.6405 ]
%Principal point (pixels):[ 1943.6227 +/- 2.8872 1562.0646 +/- 3.4771 ]
%Radial distortion: [ -0.2094 +/- 0.0025 0.0879 +/- 0.0125 0.1341 +/- 0.0253 ]
%Tangential distortion: [ -0.0004 +/- 0.0001 -0.0001 +/- 0.0001 ]
I am using the following code to undistort my image, but I not sure what number should I enter based on my parameter numbers above. This is the link ( https://www.mathworks.com/help/vision/ug/remove-distortion-from-an-image-using-the-cameraparameters-object.html ) below.
IntrinsicMatrix = [715.2699 0 0; 0 711.5281 0; 565.6995 355.3466 1];
radialDistortion = [-0.3361 0.0921];
cameraParams = cameraParameters('IntrinsicMatrix',IntrinsicMatrix,'RadialDistortion',radialDistortion);
% Remove distortion from the images.
I = imread(fullfile(matlabroot,'toolbox','vision','visiondata','calibration','mono','image01.jpg'));
J = undistortImage(I,cameraParams);
% Display the original and the undistorted images.
figure; imshowpair(imresize(I,0.5),imresize(J,0.5),'montage');
title('Original Image (left) vs. Corrected Image (right)');

답변 (1개)

Image Analyst
Image Analyst 2022년 5월 27일

0 개 추천

If the distortion varies by all those amounts (the ranges you listed) then I don't know how to tell how much any one particular image was distorted - what it's specific parameters were. You might just have to do trial and error to see what works well. Hopefully whatever you find will work decently on all the other images.

댓글 수: 3

Thank you for your feedback. I not sure which numbers should I enter to the IntrinsicMatrix, radialDistortion and Tangential distortion to do the trail. Could you give me an example on how you enter the numbers to the code below?
IntrinsicMatrix = [];
radialDistortion = [];
Tangential distortion = []
Put numbers inside the brackets. Sorry I have never used that function so I'd have to consult the documentation just like you'll have to do. Good luck.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 MATLAB Support Package for USB Webcams에 대해 자세히 알아보기

질문:

2022년 5월 27일

댓글:

2022년 6월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by