Open conson0214 opened 4 years ago
After reading the reference "Image Blind Denoising With Generative Adversarial Network Based Noise Modeling", I guess the Noise Extraction is like this
# in your dataloader's getitem() method:
# suppose img_GT is the HR image, and img_LQ is the paired LR image
min_var = 1e6
min_x = 0
min_y = 0
x = 0
y = 0
# find the patch who has min variance
for x in range(0, img_GT.shape[0]-LQ_size, 3*LQ_size):
for y in range(0, img_GT.shape[1]-LQ_size, 3*LQ_size):
# print("patch", x, y)
patch = img_GT[x:x+LQ_size, y:y+LQ_size]
var = np.var(patch)
if var < min_var:
min_var = var
min_x = x
min_y = y
min_patch = img_GT[min_x:min_x+LQ_size, min_y:min_y+LQ_size]
noise = min_patch - np.mean(min_patch, axis=(0,1))
img_LQ += noise
and I got the result like left: HR patch; right: HR noise
I have not found 'Noise Injection' in data codes, is it not included in release codes so far?