Remove Distortion from an Image Using the Camera Parameters Object
조회 수: 5 (최근 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!