jnjaby / DISCNet

Code for DISCNet.
99 stars 16 forks source link

Are the UDC PSFs you released the kernels of UDC actually? #4

Closed HyZhu39 closed 3 years ago

HyZhu39 commented 3 years ago

Hello, I tried to visualization the kernels under the path "DISCNet-main/datasets/PSF/ZTE_new". Because these kernels are used to generate UDC simulation images, then these kernels should be very similar to the paper, with large support, long-tail shape. While I visualized these kernels as grayscale images, but got results like this: ZTE_new_psf_1_0 Obviously, this is the kernel of the standard camera. Is there a problem with my visualization method or the kernel you released is wrong?

here is my visualization code: data = np.load(path) data = data.transpose(2, 0, 1) # to CHW '''for normalizaion''' smax = np.max(data) smin = np.min(data) s = (data - smin) / (smax - smin) s *= 255. im = Image.fromarray(s[i]).convert('L') #Visualize the i-th channel im.save(save path)

jnjaby commented 3 years ago

Hi, as stated in the paper, the main response has much greater energy with orders of magnitude than the sidelobe. Hence, to visualize the diffraction effect (flare), you will need to increase the intensity of sidelobe regions, which is also the major motivation to consider HDR images. I provide an example of visualization for your reference as follows.

import numpy as np
import matplotlib.pyplot as plt

PSF = np.load(path)
PSF = np.clip(PSF * 5000, 0, 1)

plt.imshow(PSF)
plt.axis('off')
plt.tight_layout()
plt.show()
HyZhu39 commented 3 years ago

Hi, as stated in the paper, the main response has much greater energy with orders of magnitude than the sidelobe. Hence, to visualize the diffraction effect (flare), you will need to increase the intensity of sidelobe regions, which is also the major motivation to consider HDR images. I provide an example of visualization for your reference as follows.

import numpy as np
import matplotlib.pyplot as plt

PSF = np.load(path)
PSF = np.clip(PSF * 5000, 0, 1)

plt.imshow(PSF)
plt.axis('off')
plt.tight_layout()
plt.show()

got it, thanks a lot.