This is an easy-model I used to simulate hazing conditions in image processing ...
About Using Subtractive Filters Model (Beer-Lambert)
I will explain it with an example and with the maths that supports it
Suposse you are sitted at the table and you have a Rubik Cube (RC) on the table at 1 mts from your point of view (at the table level), looking directly to the RC
The “light” coming from the RC is 100 (at its maximum level, because there is no mist at all)
You have 10 films with thickness of 1 cms each one, all of the same material, that has the property of obsorving 25% of the incident light, then you insert the first film in front of the RC in the line of your vision, the light that you’ll perceive coming from the RC is not 100, is …
100 x (1 – 25%) = 75
When you insert the second film is not 75, is …
75 x (1 – 25%) = 56
When you insert the third film is not 56, is …
56 x (1 – 25%) = 42
Resuming this into formulas :
I = I
O (1-K)
n
Where
I is the actual LIGHT INTENSITY after the original level (I
O) has passed through n filters, where each filters absorbs K% of the incident light
I
O = 100
K = 25%
N = 3
An obviously the result is again 42
Now trying to re-express the formula, call
B = (1-K)
Then the formula could be written
I = I
O B
n
Now if the films have the same thickness, therefore the same K, “n” is a measure of the distance, so call it “d” instead of “n”
I = I
O B
d
Now and at last we can express the factor “B” in other form :
B = e
-α
Solving the equation :
α = - ln (B) “α” is the natural logarithm of B
So we have the final expression (The Beer Lambert-Law, it’s no an empirical law)
I = I
O e
-αd
This means that the light coming from the object follows an
EXPONENTIAL curve, function of the distance
α is the absortion coefficient per meter, it depends on the material and is function of the wavelength
When you analyze mainly an absorptive media you can use the equivalent α, so you can analize the whole Light Intensity independently of the wavelength using the equivalent α
Beer-Lambert Law is strictly true for absorptive media
Media should be at least non highly dispersive (scattering) media
Media must be homogeneous in the interaction volume
Media should not contain fluorescence or phosphorescence phenomena
Media should not be a highly concentrated solution
Visibility Series, RGB Math
Scope
Excellent solution to face fog, mist or haze conditions on an image using RGB Colors, applying Beer- Lambert law, Koschmeider Equation
Variables and Parameters
D : Visual Range from the observer where contrast decay to 2% of his real value [mts] (Weathercast)
d : Distance from the observation point to the object in the mist
b : Attenuation Factor, sets the contrast decay velocity
XV : RGB-Channel Value for the target color, when X = D [0;255] (the color of the mist horizon)
XO : RGB-Channel Value for the object color seeing by the observer at a distance d
X : RGB-Channel Value for the object local color seeing by the observer at a null distance
G : Gamma correction factor in image processing
Equations
b = 3.912 / D
xO = (x – xV) e-bd + xV
XO = 255 (xO)1/G
x = (X / 255)G Linear RGB [0,255]
X = 255 (x)1/G Standard Not Linear RGB [0,255]
Observations
This formula should be applied to each RGB channel (R,G,B) to find the color seen by the observer
Typos like x means Linear-RGB, X means Not-Linear-RGB