v9.1.1
Menu

Recover Albedo from Normal

easyPROPhotometric StereoPhotometryCV: 3D Reconstruction

Recover surface albedo given known surface normal and light observation.

From the Lambertian equation: I=ρ⋅(n⋅l)I = \rho \cdot (\mathbf{n} \cdot \mathbf{l})

where:

  • II is the observed intensity
  • ρ\rho is the surface albedo (reflectance)
  • n\mathbf{n} is the unit surface normal vector
  • l\mathbf{l} is the unit light direction vector

We can solve for albedo: ρ=In⋅l\rho = \frac{I}{\mathbf{n} \cdot \mathbf{l}}

This is only valid when n⋅l>0\mathbf{n} \cdot \mathbf{l} > 0 (the surface faces the light). For backlit surfaces where the dot product is zero or negative, albedo cannot be recovered from that observation.

In practice, we average albedo estimates from multiple light sources for robustness.

Example

Input
recover_albedo(0.4, [0, 0, 1], [0, 0, 1])
Output
0.4
Reasoning

Normal parallel to light: dot(n, l) = 1.0

  • albedo = 0.4 / 1.0 = 0.4
  • When n·l = 1, intensity equals albedo.

Constraints

  • intensity: observed intensity
  • normal: surface normal [nx, ny, nz]
  • light_dir: light direction [lx, ly, lz]
  • Return albedo rounded to 4 decimal places, or 0 if dot product ≤ 0

Learn this in

More from CV: 3D Reconstruction

PRO

Editor locked

The code editor is locked for Pro problems. It is only available for free problems. Please upgrade to gain access to the code editor for all problems.

solution.py

Test results

Sign in to run your code against the test cases.