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

Visualization Problem #40

Open
howardyclo opened this issue Aug 10, 2019 · 1 comment
Open

Visualization Problem #40

howardyclo opened this issue Aug 10, 2019 · 1 comment
Assignees

Comments

@howardyclo
Copy link

howardyclo commented Aug 10, 2019

Hi Yuanming,

Thanks for the released code. I've been having fun playing around with your code.
Since I just recently studied about color constancy, I have a (probably stupid )problem about the visualization of corrected image.

The corrected image is rendered as follows:

img_corrected = tf.pow(
      images[:, :, :, ::-1] / 65535 / illums_pooled[:, None, None, :] * exposure_boost *
      tf.reduce_mean(illums_pooled, axis=(1), keep_dims=True)[:, None, None, :],
      1 / VIS_GAMMA)

Here what I do not understand about is that why do we need this * tf.reduce_mean(illums_pooled...)? I surveyed several papers and I couldn't find the white-balancing formula about this.

@yuanming-hu yuanming-hu self-assigned this Aug 10, 2019
@yuanming-hu
Copy link
Owner

Hi,

You can consider tf.reduce_mean(illums_pooled, axis=(1), keep_dims=True)[:, None, None, :]/llums_pooled[:, None, None, :] together. This normalizes the illumination estimation and makes sure the output image is not too dark/bright.

Note that color constancy cares about only color but not about brightness.

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

2 participants