You need to complete the following steps:
- Import the necessary modules:
import cv2import numpy as np
- Load the images and exposure times:
imgs_names = ['33', '100', '179', '892', '1560', '2933']exp_times = []images = []for name in imgs_names: exp_times.append(1/float(name)) images.append(cv2.imread('../data/hdr/%s.jpg' % name, cv2.IMREAD_COLOR))exp_times = np.array(exp_times).astype(np.float32)
- Recover the CRF:
calibrate = cv2.createCalibrateDebevec()response = calibrate.process(images, exp_times)
- Compute an HDR image:
merge_debevec = cv2.createMergeDebevec()hdr = merge_debevec.process(images, exp_times, response)
- Turn the HDR image into a Low Dynamic Range (LDR) image to be able to display it:
tonemap = cv2.createTonemapDurand(2.4) ...