Correct image distortion with reference image

조회 수: 19 (최근 30일)
windmill
windmill 2020년 11월 2일
댓글: Hezha Sadraddin 2021년 6월 15일
Hey, how can I correct an image for lense distortion using a reference image and control points and perform a cross correlation between the two images afterwards? I feel like the code that I have used is not the best way to do it...
orthophoto = imread('cropped_image.tif');
figure, imshow(orthophoto)
unregistered = imread('cropped_image2.tif');
figure, imshow(unregistered)
pause
[movingPoints, fixedPoints] = cpselect(unregistered,orthophoto,'Wait',true);
cpselect(unregistered, orthophoto)
mytform = cp2tform(movingPoints, fixedPoints,'projective');
t = fitgeotrans(movingPoints, fixedPoints,'projective');
registered = imtransform(unregistered, mytform);
Rfixed = imref2d(size(orthophoto));
registered = imwarp(unregistered,t,'OutputView',Rfixed);
figure1 = imshow(registered);
saveas(figure1,'undistorted.tif');

답변 (1개)

Prabhan Purwar
Prabhan Purwar 2020년 11월 12일
Hey,
The best approach to correct image for lens distortion is to first get the camera intrinsics either from camera calibration(best) or through a set of images using control points (has scope for research). Then you may make use of undistortimage function.
Kindly have a look at the following link for more details:
Hope it helps!!
  댓글 수: 1
Hezha Sadraddin
Hezha Sadraddin 2021년 6월 15일
Hey Prabhan Purwar
I estimated camera paramters from a set of pics and now I want to apply these paramters to undistort images which were not used in camera calibration. Can I do that?

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

카테고리

Help CenterFile Exchange에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by