Skip to content

BUG: NAN-Values in createCalibrateRobertson() #18180

@suahelen

Description

@suahelen
System information (version)
  • OpenCV => 4.3.0
  • Operating System / Platform => Windows 64 Bit
  • Compiler => Visual Studio Code
  • Python => 3.7.7
Detailed description

I'am Trying to generate an HDR image with the help of the Robertson HDR algorithm. When trying to get the Camera Response function via cv2.createCalibrateRobertson() the function returns a list containing NAN-vals. If I set max_iter = 1 I get something similar to this (depending on images):
[[[0.01159891 0.00623508 0.01153401]]
[[0.01882304 0.01189755 0.01737712]]
.
.
.
[[2.459257 2.8999877 2.8891199 ]]
[[ nan nan nan]]]

If I use only one Image, I always get NAN in the first and last row.

If I use multiple images with max_iter > 1 I get only NAN values returned.

Different thresholds were also tested.

I made sure that the images and the exposure times correspond correctly. Additionally I tried the same with the Debevec method, which worked flawlessly.

Interestingly the calibration step works in the EMGU.cv wrapper. I'm not sure which Version is used in this Framework.

Steps to reproduce

This is the code that was used.

times = np.array([0.001, 0.002, 0.005, 0.01, 0.025, 0.05, 0.1, 0.249], dtype=np.float32)
img_list = []
for name in names:
    img = cv2.imread(str(name))
    img_list.append(img)

cal_robertson = cv2.createCalibrateRobertson(max_iter=1, threshold=0.01)
crf_robertson = cal_robertson.process(img_list, times=times.copy())

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions