【发布时间】:2016-03-23 11:16:37
【问题描述】:
我目前正在尝试使用 OpenCV 的 python 包装器进行一些 HDR 处理。
import cv2
import numpy as np
img = cv2.imread("1.jpg")
img2 = cv2.imread("2.jpg")
img3 = cv2.imread("3.jpg")
images = [img, img2, img3]
times = [-2, 0, 2]
response = np.zeros(256)
import ipdb; ipdb.set_trace()
calibrate = cv2.createCalibrateDebevec()
calibrate.process(images, response, times)
ipdb> calibrate.process(images, response, times)
*** TypeError: dst is not a numpy array, neither a scalar
它说我的代码中基于位置的 dst 或“响应”不是一个 numpy 数组,而是检查“响应”的类型,它清楚地说是。
ipdb> type(response)
<type 'numpy.ndarray'>
【问题讨论】:
-
你用的是什么版本的cv2?
-
>>> 导入 cv2 >>> cv2.__version__ '3.0.0'
标签: python c++ arrays opencv numpy