简体   繁体   中英

Camera Calibration Toolbox for Matlab Undistort Image loses image borders

I am using the Camera Calbration Toolbox from Cal Tech to undistort images. However, when I do so the images lose their borders in the final undistorted image. I am curious as to whether there is a way to avoid this, as the entire image is important. Thanks in advance.

Do you have access to Matlab's Computer Vision System Toolbox ? It includes a function undistortImage that allows you to set the output view to include the entire undistorted image, like so:

outImg = undistortImage(inImg, cameraParams, 'OutputView', 'full');

As far as I know, the Camera Calibration Toolbox's undistort function doesn't include this functionality. If you don't have the above toolbox, you could try zero-padding your image with enough border that the actual image will remain in the undistorted frame, and then you could crop the result using the actual image's bounding box. This should probably be a last resort though. Undistorting the padded image won't yield exactly the same results as with the original image. Pad as little as possible!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM