I am using the following tutorial as a guide to process some HDR brackets with OpenCV in Python:
However no matter what I try the calibrateDebevec
function is throwing an error: error: (-215:Assertion failed) images[0].depth() == CV_8U in function 'CV::CalibrateDebevecImpl::process'
. I am new to OpenCV and this is a very obscure error message to me... What is going wrong? I tried checking that all of the inputs are aligned, the exposure times seem to be accurate, the images are all of the same shape (x, y, channel count), etc. I couldn't find any documentation on what format the exposure times should be in, so I am using floating point fractions of a second. Here is a reduced example to show what I mean, the exposure times are just hard-coded at the values I know are correct:
import cv2 as cv
import numpy as np
paths = ['list of images']
times = [0.0666, 0.0333, 0.0166, 0.01, 0.008, 0.1, 0.2]
images = []
for path in paths:
im = cv.imread(path, cv.IMREAD_UNCHANGED)
images.append(im)
calibrate = cv.createCalibrateDebevec()
response = calibrate.process(images, times)