yuanming-hu / exposure

Learning infinite-resolution image processing with GAN and RL from unpaired image datasets, using a differentiable photo editing model.
MIT License
764 stars 155 forks source link

About Luminance Calculate Formula #23

Closed royxue closed 6 years ago

royxue commented 6 years ago

Hi, Yuanming

Regarding to your code, I have few questions towards the formula you are using for calculating luminance,

I noticed that you are using 0.27*R + 0.67*G + 0.06*B(I could only find reference of this formula by http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf), however, I also read some other articles about luminance formula, seems 0.2126*R + 0.7152*G + 0.0722*B is more often used for linear RGB cases, and 0.299*R + 0.587*G + 0.114*B for gamma-corrected RGB cases.

could you give some explanation about your luminance formula? and why you are using the same formula for both cases in your code?

yuanming-hu commented 6 years ago

Hi Rox,

I think these coefficients are just empirical values and you are right there are many definitions of luminance. It's hard to say which one is the "best one" but the weights basically follow the same rule: green > red > blue.

royxue commented 6 years ago

Ok, thanks for the explanation ;)