lmurmann / multi_illumination

MIT License
54 stars 8 forks source link

How do you normalize HDR image? #6

Open symao opened 3 years ago

symao commented 3 years ago

This paper “A Dataset of Multi-Illumination Images in the Wild” describes the HDR process as:

After merging exposures, we normalize the brightness of the HDR image by matching the intensity of the diffuse gray sphere. The gray sphere also serves as a reference point for white balance.

What exactly calculation does the HDR pixel value do about 'matching the intensity of the diffuse gray sphere'? I found negative values in HDR images of chrome sphere and gray probe. How could that negative intensity happened?

lmurmann commented 3 years ago

What's the magnitude of the negative values? If the magnitude is very small, it could be interpolation artifacts from rectifying the probe crops (removing the ellipse-shaped distortion)

Can you post a link to a file that has the issue?

symao commented 3 years ago

file: multi_illumination_test_mip2_exr/everett_dining1/probes/dir_1_chrome256.exr I draw the negative pixels as follow. It seams to be the effect of distortion rectifying.

image

My code:

hdr_dir = 'E:/data/DeepLearning/light_estimation/light_probe/multi_illumination_test_mip2_exr/everett_dining1/probes' idx = 1 chrome_hdr = cv2.imread(os.path.join(hdrdir,'dir%d_chrome256.exr'%idx), cv2.IMREAD_ANYCOLOR | cv2.IMREAD_ANYDEPTH) print('chrome hdr min:%f max:%f mean:%f'%(np.min(chrome_hdr),np.max(chrome_hdr),np.mean(chrome_hdr))) tone_map = cv2.createTonemapReinhard() plt.subplot(121) plt.imshow(tone_map.process(np.clip(chrome_hdr,0,1e10))[...,::-1]) plt.title('chrome_hdr') plt.subplot(122) chrome_mask = (chrome_hdr < 0).astype('float') plt.imshow(chrome_mask) plt.title('chrome_negative_mask') plt.show()