def remove_distortion(images):
out = calibrate(images)
matrix = out['camera_matrix']
dist = out['distortion_coefficient']
undistorted_images = []
for (image, color_image) in images:
size = image.shape[::-1]
new_matrix, roi = cv.getOptimalNewCameraMatrix(matrix, dist, size,
1, size)
img = cv.undistort(color_image, matrix, dist, None, new_matrix)
undistorted_images.append(img)
return undistorted_images
remove_distortion.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录