Reconstruction I: Single Viewpoint
Radiometry and Reflectance
Radiometric concepts
Here we show several basic concepts of radiometry
Angle (2D): \(d\theta = \frac{dl}{r}\), where l is the arc length, r is the radius.
Soild angle (3D): \(d\omega = \frac{dA^\prime}{r^2} = \frac{dA\cos\theta}{r^2}\)
Light flux: Power emitted within a solid angle, \(d\Phi\)
Radiant intensity: Light flux emitted per unit solid angle, \(J = \frac{d\Phi}{d\omega}\)
Surface irradiance: Light flux incident per unit surface area, \(E=\frac{d\Phi}{dA}\). We can observe that
Surface radiance: Light flux emitted per unit foreshortened area per unit solid angle:
Scene radiance & surface irradiance
We want to understand the relationship between image irradiance E and scene radiance L:
From the figure above, we know the solid angle of image equals to the solid angle of surface, i.e, \(d\omega_i=d\omega_s\), we have:
We also have solid angle subtended by the lens with length \(d\):
Given the energy conservation, i.e., flux received by lens from \(dA_s\) equals to the flux projected onto \(dA_i\). The flux received by lends from \(dA_s\) is
The flux projected onto \(dA_i\) is:
We could come up with the equation of image irradiance:
The final equation would be:
We thus know: 1. Image irradiance is proportional to scene radiance 2. Image brightness falls off from the image center as \(\cos^4\alpha\) 3. For small fields of view, effects of \(\cos^4\alpha\) are small 4. Image brightness does not vary with scene depth, e.g., if you move camera away, the brightness of the same pixel will not change.
Bidirectional reflectance distribution function (BRDF)
Surface reflection depends on both the viewing and illumination directions.
Given the irradiance \(E(\theta_i, \phi_i)\) due to source in direction \((\theta_i, \phi_i)\) and radiance \(L(\theta_r, \phi_r)\) of surface in direction \((\theta_r, \phi_r)\), the BRDF is defined as:
Some properties of BRDF: 1. Non-negative: \(f(\theta_i, \phi_i, \theta_r, \phi_r) > 0\)
-
Helmholtz Reciprocity: \(f(\theta_i, \phi_i, \theta_r, \phi_r) = f(\theta_r, \phi_r, \theta_i, \phi_i)\)
-
For rotationally symmetric reflectance (Isotropic surfaces), BRDF can be represented as a 3D function: \(f(\theta_i, \theta_r,\phi_i-\phi_r)\). This means if we rotate the surface around, the BRDF will not change.
Reflectance models
The reflections can be categorized into:
- Surface reflection: Specular reflection that gives glossy appearance on smooth surface (e.g., mirror, glass)
- Body reflection: Diffuse reflection that gives matte appearance on non-homogeneous medium (e.g. clay, paper)
Lambertian model (Body)
Lambertian model states that surface appears equally bright from ALL directions. The Lambertian BRDF is:
Here \(0\le\rho_d\le 1\) is albedo. According to the BRDF model, the relationship between surface radiance \(L\) and irradiance \(E\), we can have:
Thus, we can have surface radiance:
Here an important property is: surface radiance \(L\) is independent of viewing direction.
Ideal specular model (Surface)
We can consider specular model like a perfect mirror, where all incident energy is reflected in a single direction. All the reflection happens at the interface itself, so it is surface not body reflection. The mirror BRDF is:
In this case, the BRDF can be expressed as the product of two delta functions, which means viewer receives light only when \(\mathbf{v}=\mathbf{r}\)
Reflection from Rough surfaces
We can model the surface roughness using Gaussian Micro-Facet model:
Specular reflection from rought surface
Torrance-Sparrow BRDF model: Each facet is a perfect mirror (but each facet can have its own orientation):
where \(p(\alpha,\sigma)\) is surface roughness distribution. \(G(\rvs, \rvn, \rvv)\) is geometric factor (masking, shadowing). When we set \(\sigma=0\), we will have a perfect mirror model.
Body reflection from rough surfaces
Oren-Nayar BRDF model: Each facet is Lambertian.
where
Again, \(\sigma\) here is surface roughness. When \(\sigma=0\), it becomes a perfect Lambertian model.
When the roughness of the surface improves, the body reflection makes its appearance becomes more flat.
Dichromatic model
- Color of body (diffuse) reflection = color of object \(\times\) color of illumination.
- Color of surface (specular) reflection = color of illumination.
- Pixel color is a linear combination of the color of body reflection and the color of surface reflection.
Photometric Stereo
Method for recovering 3D shape informatioon from image intensities measured using multiple sources:
Gradient space & reflectance map
Surface gradient and normal
Let \(z=f(x, y)\) represent a 3D surface, we can obtain surface gradient:
The surface normal can thus be represented as:
The unit surface normal is:
Reflectance map \(R(p, q)\)
For a given source direction \(\rvs\) and surface reflectance, image intensity a point \((x, y)\) is \(I=R(p, q)\).
Lambertian surface
where \(k\) is source brightness, \(\rho\) is surface albedo (reflectance), \(c\) is cosntant (camera gain). Let \(c\frac{\rho}{\pi} k=1\), then
**Can we estimate shape from a single image? ** Given the image, source direction, and surface reflectance, can we estimate surface gradient \((p, q)\) at each pixel? The answer is NO as intensity at each pixel maps to infinite \((p, q)\) values along the corresponding iso-brightness contour, i.e., we have multiple solution that has the same \(\theta\) as in figure above (left).
Photometric Stereo
Idea: Use multiple images under different lighting to resolve the ambiguity in surface orientation.
Basic idea
- Step 1: Acquire K images with K known light sources.
- Step 2: Using known source direction and BRDF, construct reflectance map for each source direction.
- Step 3: For each pixel locatioon \((x, y)\), find \((p, q)\) as the intersection of \(K\) curves. This \((p, q)\) gives the surface normal at pixel \((x, y)\).
Photometric Stereo - Lambertian case
Image intensities measured at point \((x, y)\) under each of the three light sources:
where \(\rvn = \begin{bmatrix}n_x\\n_y\\n_z\end{bmatrix}\) and \(\rvs_i = \begin{bmatrix}s_{x_{i}}\\ s_{y_{i}}\\ s_{z_{i}}\end{bmatrix}\). We can write this in matrix form:
Solution: \(\rmN = (\S)^{-1} I\), surface normal \(\rvn = \frac{\rmN}{\|\rmN\|}\), albedo: \(\frac{\rho}{\pi} = \|\rmN\|\). To make it work, we need to make sure \(\rmS\) is invertible, that is to say, one source direction can be represented as a linear combination of the other two. Better results by using more (K>3) light sources and solve it by normal equation.
Calibration based photometric stereo
Use a calibration object of known size, shape, and same reflectance as the scene objects. Points with the same surface normal produce the same set of intensities under different lighting.
Calibration procedure:
- Capture \(K\geq 3\) images under \(K\) different light sources.
- Using the know size of the sphere, calculate the surface normal \((p, q, 1)\) for each point on the sphere.
- Create a lookup table for the K-tuple: \((I_1, I_2,\dots, I_k)\rightarrow (p, q)\).
- Capture \(K\) images of the scene object under the same \(K\) light sources.
- For each pixel in the scene, use lookup table to map \((I_1, I_2,\dots, I_k)\rightarrow (p, q)\).
Shape from normals
Shape from surface normals
Estimate surface by integrating surface gradient:
where \((x_0, y_0)\) is a reference point and \(z(x_0, y_0) = 0\). \(z(x, y)\) obtained by integration along any path from \((x_0, y_0)\).
Naive algorithm
- Intialize reference depth \(z(0, 0) = 0\)
-
Compute depth for first column:
\[ \begin{aligned} &\text{For $y=1$ to $(H-1)$:}\\ &\qquad z(0, y) = z(0, y-1) - q(0, y) \end{aligned} \] -
Compute depth for each row.
\[ \begin{aligned} &\text{For $y=0$ to $(H-1)$:}\\ &\qquad \text{For $x=1$ to $(W-1)$}\\ &\qquad\qquad z(x, y) = z(x-1, y) - p(x, y) \end{aligned} \]
Denoise
The presence of the noise in normal can result in inaccurate depth estimation, and the estimated depth depends on the integration path.
A simple solution would be computing depth map using different paths, and find average of computed depth maps to reduce error. However, this is really time-consuming. Instead, we can minimize the errors between measured surface gradients \((p, q)\) and surface gradients of estimated surface \(z(x, y)\). The error measure \(D\) would be:
where \(\frac{\partial z}{\partial y}\) are gradients of the estimated surface. To solve this, we can use Frankot-Chellappa algorithm, which solves this problem in Fourier domain. Let \(Z(u, v)\), \(P(u, v)\) and \(Q(u, v)\) be the Fourier Transformas of \(z(x, y)\), \(p(x, y)\) and \(q(x, y)\), then:
We could find \(Z(u, v)\) that minimizes \(D\) using \(\frac{D}{Z}=0\). The solution becomes:
This is the Fourier Transform of the best fit surface, we can compute inverse Fourier transform to obtain \(\tilde{z}(u, v)\)
Interreflection
Brightness of a scene point is not only due to the light source, but aslo due to light from other scene points. Thus, photometric stereo overestimates albedo and underestimates surface tilt (Surface ends up shallower).
We can iteratively estimate the correct shape taking into account the interreflections.
Shape from shading
Stereographic projection
Shape from shading algorithm
Basic assumptions
Surface gradient on occluding boundary are known and can be used as boundary conditions. We can use edge detection to estimate the boundary and estimate the surface normal:
Assumption 1: Image irradiance (intensity) should equal the reflectance map. That is, \(I(x, y) = R_s (f, g)\). We can thus minimize:
i.e., penalize errors between image irradiance and reflectance map.
Assumption 2: Smoothness constraint: Object surface is smooth. That is, the gradient values \((f, g)\) vary slowly. Thus, we can minimize:
i.e., penalize rapid changes in \(f\) and \(g\) during surface estimation.
Numerical shape from shading
We want to find the surface gradients \((f, g)\) at all image points that minimize the function:
The smoothness error at point \((i, j)\) is:
The image irradiance error at point \((i, j)\):
Find \((f_{i, j}, g_{i, j})\) for all \((i, j)\) that minimizes:
If \((f_{k, l}, f_{k, l})\) minimizes \(e\), then \(\frac{\partial e}{\partial f_{k, l}}=0\) and \(\frac{\partial e}{\partial g_{k,l}}=0\). Given an image of size \(N\times N\), there are \(2N^2\) unknowns. However, since each \(f_{i, j}\) and \(g_{i, j}\) appears in 4 terms in our objective function. Therefore:
wbere \(\bar{f}_{k, l}\) and \(\bar{g}_{k, l}\) are local averages:
We can solve the equation by moving \(f_{k, l}\) and \(g_{k, l}\) to one side:
The overall iterative process would be:
- Use known normals to fix \((f, g)\) values on occluding boundary. Initialize the rest to \((0, 0)\).
- Iteratively compute \((f, g)\) until the solution has converged.