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

confused about img_corrected #23

Open
zyqgmzyq opened this issue Aug 9, 2018 · 8 comments
Open

confused about img_corrected #23

zyqgmzyq opened this issue Aug 9, 2018 · 8 comments

Comments

@zyqgmzyq
Copy link

zyqgmzyq commented Aug 9, 2018

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

Why need to multipy np.mean(illums_pooled)?

@yuanming-hu
Copy link
Owner

Hi, thanks for the question.

This is just to normalize the estimation. Note that color constancy has only two DoFs instead of three (see, FAQ (h)).

@zyqgmzyq
Copy link
Author

If I want to use the ground-truth to correct the picture,

img_corrected = np.power(mages[:, :, :, ::-1] / 65535 / illums_ground_truth , 1/2.2), is it right?

@yuanming-hu
Copy link
Owner

That depends on if you want to adjust the exposure level after color constancy. After you divide the image by illums_ground_truth, the image may appear darker or brighter, though the color constancy should already be achieved. If illums_ground_truth is already normalized, the brightness of the image should already be reasonable. That's why I do multipy np.mean(illums_pooled)

pow 1/2.2 is for gamma correction, from linear to sRGB.

@zyqgmzyq
Copy link
Author

It seems so complex, I'm not clearly understand about that. Now I want to visualize the raw image and corrected image after divided the image by illums_ground_truth , Is there some standard operation to corrected the image ?

I just divide the image by illums_ground_truth, but the image is dark. Your mean is that this image is not exposure? So the raw image is not exposure? So visualize the corrected image not only should remove the color cast but need to exposure?

@yuanming-hu
Copy link
Owner

You are right that color constancy only takes care of the color cast, not the exposure. However, when visualizing them people also want the images to be correctly exposed. Therefore, you do not want illums_pooled to be a very "long" vector, since that may make the image very dark. That's why you normalize this vector, or multiple the image the length of the vector after dividing it.

@zyqgmzyq
Copy link
Author

Thanks for your reply! But I don't understand what image is correctly exposed, is there some baseline?

@yuanming-hu
Copy link
Owner

yuanming-hu commented Aug 21, 2018 via email

@zyqgmzyq
Copy link
Author

Sorry,I don't know what RGB value is. Could you please describe it in detail?
And would you recommend some related materials or papers ?
Thanks!

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