去除 Python 中的双凹图像失真

问题描述 投票:0回答:0

我有以下图片是电脑生成的

它作为光学实验的输入输入,结果如下图:

正如您所见,由于使用了镜头系统,图像具有双凹效果。

我需要能够不失真地还原图像,并与原始图像进行比较。我是图像处理的新手,遇到了两个有用的 python 包:

https://pypi.org/project/defisheye/

defisheye
对我来说使用起来非常简单(下面的脚本),但到目前为止我无法获得最佳结果。

from defisheye import Defisheye

dtype = 'linear'
format = 'fullframe'
fov = 11
pfov = 10

img = "input_distorted.jpg"
img_out = "input_distorted_corrected.jpg"

obj = Defisheye(img, dtype=dtype, format=format, fov=fov, pfov=pfov)

# To save image locally 
obj.convert(outfile=img_out)

来自 opencv:https://docs.opencv.org/4.x/dc/dbb/tutorial_py_calibration.html 相机校准教程超出了我的知识范围。如果有人可以向我保证这是否可行,我可以开始更深入地挖掘。非常感谢任何建议。

python opencv camera-calibration fisheye
© www.soinside.com 2019 - 2024. All rights reserved.