Wrong distortion parameters in camera calibration

조회 수: 5 (최근 30일)
Hi,
Hope you are doing well. I have calibrated my Raspberry Pi V2 camera using single camera calibrator app in MATLAB. I tried to do everything as per instructions provided here. However, the distortion parameters seem to be incorrect, since when I apply these distortion parameters (i.e., try to undistort the images using
undistortImage
), the image gets cropped and surrounded by barrel-like black borders. For clarification, I have attached a sample image before and after being undistorted.
Ideas are much appreciated!

채택된 답변

Bjorn Gustavsson
Bjorn Gustavsson 2021년 9월 27일
After quickly looking at the amount of distortion noticeable it seems pretty small - open the images in gimp (for example, comercial software also available) and add lines to the edge of the table on the left it is perhaps a small difference corrected for in the undistorted version, but at this resolution it is difficult to tell (you might have raw-images with higher resolution). When I try to image the difference between the grayscale version (gIm1 = double(rgb2gray(Im1))); etc) it is still difficult to tell. The undistortion is just a re-interpolation of the image as it would've been captured with an ideal plain pin-hole camera (no half-spherical beads only the pin-hole). Therefore, for pincushion-distortion images the lines-of-sight along edges of the ideal plain pinhole-cameras fall outside the field-of-view of pincushion-distorting optics, and the image intensities of the corresponding pixels are set to zero.
HTH.
  댓글 수: 3
Bjorn Gustavsson
Bjorn Gustavsson 2021년 9월 27일
This is a "problem" only in the sense that you get some very dark pixels along the edges (for pincushion distortion) or in the corners (for barrel distortion). This is a direct consequence of an absolute lack of information about what is outside the field-of-view. In the words of Wittgenstein what we know nothing of we should not show - therefore the black. If the black parts bother you you could always crop them out, I guess. What you need to do after the "undistortion" depends on what you want to do next with the images and what is required for that, since I don't know what's next it is difficult to give you advice...
Mohammad Hussein Yoosefian Nooshabadi
Thank you for your fast reply. Good tip. The next step is to detect Harris corners. If I use the raw undistorted image, the most powerful corners would always locate at the black border (due to high intensity difference between dark and bright pixels of the border). Therefore, I think the best measure to take is to crop the undistorted image. Appreciate your consideration!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Camera Calibration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by