Contrast Enhancement

Luminance

  • a photometric measure of the phtometric measure of the luminous intensity per unit area of light traveling a given direction
  • Luminance leves indicate the amount of luminous power that is detectable to human eyes froma a particular surface and angle of view.

Formulation

  • The luminance of a specified point of a light source, in a specified direction, is defined by:

clipboard.png

Lv=d2ΦvddΩcosθL_v = \frac{d^2 \Phi_v}{d \sum d\Omega_{\sum} cos\theta_{\sum}}

Step 1: What are the symbols?

  • Φv\Phi_v: Radiant flux (power of visible light in photometry, measured in lumens). More generally, in radiometry, Φ\Phi is the radiant flux (watts).

  • d2Φvd^2 \Phi_v: An infinitesimal amount of flux, considered with respect to both area and solid angle.

  • Σ\Sigma (sometimes written AA): The surface area element through which radiation is passing.

  • dΩΣd\Omega_{\Sigma}: The differential solid angle subtended by the ray bundle at the surface element. A solid angle is measured in steradians (sr).

  • θΣ\theta_{\Sigma}: The angle between the surface normal of the patch dΣd\Sigma and the incoming (or outgoing) light direction.

  • cosθΣ\cos\theta_{\Sigma}: A projection factor that accounts for foreshortening. A patch tilted away from the ray captures less flux than one directly facing it.

  • LvL_v: The luminance (photometric equivalent of radiance). Units:

cd/m2=lmm2sr\text{cd/m}^2 = \frac{\text{lm}}{\text{m}^2 \cdot \text{sr}}

(candelas per square meter).


Step 2: Meaning of the denominator

  • dΣcosθΣd\Sigma \cos\theta_{\Sigma} is the projected area of the surface as “seen” from the light’s direction. This projection ensures that grazing angles collect less light.

  • dΩΣd\Omega_{\Sigma} expresses in which direction the light is traveling (the angular spread of the beam).

So the denominator is:

dΣcosθΣdΩΣd\Sigma \cos\theta_{\Sigma} \, d\Omega_{\Sigma}

“the projected area of the patch times the solid angle of the beam.”


Step 3: Putting it together

The formula says:

Lv=flux in a given beamprojected area×solid angle of that beamL_v = \frac{\text{flux in a given beam}}{\text{projected area} \times \text{solid angle of that beam}}

So luminance (radiance) is the flux density per projected area per unit solid angle.


Step 4: Intuition

  • Imagine a tiny surface element dΣd\Sigma.
  • Pick a direction at angle θ\theta.
  • Through a tiny cone of solid angle dΩd\Omega around that direction, some small flux d2Φd^2 \Phi passes.
  • The formula says: luminance is the “concentration of flux” in that specific direction per unit projected area.

That’s why luminance (or radiance, in radiometry) is considered directional brightness: it’s not just “how much flux,” but “how much flux in a given direction per surface orientation.”


Summary: This is the definition of luminance (photometric radiance). It relates radiant flux to geometry and direction:

  • d2Φvd^2 \Phi_v: how much light leaves/arrives.
  • Divided by dΣcosθd\Sigma \cos\theta: accounts for the orientation of the surface.
  • Divided by dΩd\Omega: distributes the flux over angular spread.

That’s why luminance is the fundamental measure of brightness that stays invariant along rays in a lossless medium.


Gamma Correction

  • Nonlinear mapping of pixel intensities that adjusts how brightness and contrast are perceived
Iout=IinγI_{out} = I_{in}^\gamma

where:

  • Iin:I_{in}: input pixel value (normalized to [0,1][0, 1])
  • Iout:I_{out}: output pixel value
  • γR+\gamma \in \R^+

\bullet Effect of γ\gamma

γ{Brightens the image(γ<1)Darkens the image(γ>1)No change(γ=1)\gamma \Rightarrow \begin{cases} \text{Brightens the image} &\quad\quad (\gamma < 1) \\ \text{Darkens the image} &\quad\quad (\gamma > 1) \\ \text{No change} &\quad\quad (\gamma = 1) \end{cases}

Note

This works because our eyes perceive brightness niina nonlinear way. Gamma correction compensates for that and helps adjust images for human viewing

\bullet Why does it work?

1. Light vs. Human Perception

  • Light intensity is linear. Doubling the number of photons doubles the physical brightness
  • Human vision is non-linear as our eyes are more sensitive in dark regions than in bright regions
  • 1020:10 \rightarrow 20: A big jump
  • 210220:210 \rightarrow 220: Not much of a difference

2. Gamma Mapping

# Draw gamma correction curves for multiple gamma values
import numpy as np
import matplotlib.pyplot as plt

# Input intensity (normalized 0..1)
x = np.linspace(0, 1, 1001)

gammas = [0.3, 0.5, 0.8, 1.0, 1.5, 2.2, 3.0]

plt.figure(figsize=(7, 5))
for g in gammas:
 y = x ** g
 plt.plot(x, y, label=f"γ = {g}")

plt.plot([0, 1], [0, 1], linestyle="--", linewidth=1, label="Linear (γ = 1)")

plt.title("Gamma Correction Curves: Output = Input^γ")
plt.xlabel("Input Intensity (normalized)")
plt.ylabel("Output Intensity (normalized)")
plt.xlim(0, 1)
plt.ylim(0, 1)
plt.grid(True, alpha=0.3)
plt.legend(title="Gamma values", loc="best")
plt.show()

clipboard.png

  1. Curves above the diagonal (γ<1)(\gamma < 1)
  • the output is greater than the input
  • Dark pixels are mapped to brighter values (0.20.45(γ=0.5))(0.2 \rightarrow 0.45 \quad (\gamma = 0.5))
  1. Curves below the diagonal (γ>1)(\gamma > 1)
  • the output is less than the input
  • Mid/Bright pixels are pushed down (0.70.4(γ=2.2))(0.7 \rightarrow 0.4 \quad (\gamma = 2.2))