Remove Distortion from an Image Using the Camera Parameters Object
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
%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)');
0 commentaires
Réponses (1)
Image Analyst
le 27 Mai 2022
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 commentaires
Image Analyst
le 27 Mai 2022
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.
Voir également
Catégories
En savoir plus sur Camera Calibration dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!