Remove Distortion from an Image Using the Camera Parameters Object
1 次查看(过去 30 天)
显示 更早的评论
%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 个评论
回答(1 个)
Image Analyst
2022-5-27
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 个评论
Image Analyst
2022-5-27
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Camera Calibration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!