Python cv2.error: OpenCV(4.6.0) :-1: error: (-5:Bad argument) in function ‘process‘

 运行python时,发现debevec.process又出现问题:

Traceback (most recent call last):
  File "D:\HApp\Deep\Pycharm-Community\PycharmProjects\pythonProject17\RANDOM_test1111\matttt.py", line 13, in <module>
    response_curve = debevec.process(img_list)
cv2.error: OpenCV(4.6.0) :-1: error: (-5:Bad argument) in function 'process'
> Overload resolution failed:
>  - CalibrateCRF.process() missing required argument 'times' (pos 2)
>  - CalibrateCRF.process() missing required argument 'times' (pos 2)

这个错误是因为 debevec.process() 函数需要传递一个额外的参数 times,它是一个长度为图像数目的列表,表示每个图像的曝光时间。

因为没有为 debevec.process() 函数提供 times 参数。所以需要创建一个与图像列表具有相同长度的曝光时间列表,然后将它们一起传递给 debevec.process() 函数。

以下是创建使用相同曝光时间的长度为 len(img_list) 的代码:

times = [1.0 / t for t in exposures]
responseDebevec = debevec.process(img_list, times)

猜你喜欢

转载自blog.csdn.net/yooniversity/article/details/130315161