Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is the 'Noise Injection' not included in codes? #11

Open
conson0214 opened this issue Jun 15, 2020 · 2 comments
Open

Is the 'Noise Injection' not included in codes? #11

conson0214 opened this issue Jun 15, 2020 · 2 comments

Comments

@conson0214
Copy link

I have not found 'Noise Injection' in data codes, is it not included in release codes so far?

@ALLinLLM
Copy link

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

@jixiaozhong
Copy link
Owner

#13 Noise patch collection is offline.

  1. Add these noise patches (variance is smaller than the threshold) to the noise pool.
  2. Randomly select one and substract its mean value for each channel.
  3. Add it to the LR image when training.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants