undistort#
- deltacamera.Camera.undistort(alpha_balance=None, imshape=None, new_imshape=None, center_principal_point=False)[source]#
Undistort the camera by removing lens distortion and optionally adjusting the intrinsic matrix.
After undistorting, the image content will not be rectangular. To make it rectangular, we either need to crop, or expand the “canvas”, and include some black areas.
- Parameters:
alpha_balance – if 0, set the zoom level such that no black pixels need to be added as padding at the borders. This removes some of the known pixel values. If 1, set the zoom level such that the image content is maximally preserved, but some black areas will be added. Between 0 and 1, it’s a smooth transition between the two. If None, the zoom level is not changed, the old intrinsic matrix is kept.
imshape – the shape of the input image (height, width).
new_imshape – the shape of the output image (height, width). If None, the output image will have the same shape as the input image.
center_principal_point – if True, the principal point will be moved to the center of the image.