Explanation of the detection principle of photometric stereo method

Photometric stereo method detection

Image irradiance

There are two factors that determine the surface patch radiation of a scene:

1. Lighting of slices on the scene surface

The amount of lighting that falls on a particular surface patch depends on the location of that surface patch in the scene relative to the light source

2. The portion of the incident illumination reflected by the surface sheet

Incident illumination reflected by a surface sheet in a particular direction depends in part on the optical properties of the surface material

reflection type:

1. Lambertian reflection (also called ideal scattering)

A Lambertian surface refers to a surface that has the same brightness observed from all directions of the field of view under a fixed illumination distribution. The Lambertian surface does not absorb any incident light. Lambertian reflection is also called astigmatism reflection. Regardless of the illumination distribution, the Lambertian surface is in all Receives and radiates all incident illumination in the direction of the surface, with the result that every direction sees the same amount of energy.

The BRDF of a Lambertian surface is a constant:
insert image description here
assuming that the illumination is not a point source, but is uniform in all directions, its total luminous intensity is I. Then the brightness can be given by: Now, the perceived brightness of the
insert image description here
Lambertian surface is at In all directions, this is because no matter which way the surface patch is facing, it receives the same amount of illumination.
Surface reflective properties:
insert image description here

2. Ideal specular reflection

insert image description here

This equation states that incident light is reflected off the surface sheet, like an ideal mirror.
The mirror reflects all incident light in a certain direction, and the reflection direction angle is equal to the incident angle relative to the mirror normal, but on the other side of the normal, the BRDF of the mirror is:
insert image description here

Ideal specular reflection properties:

insert image description here

3. Combination of Lambertian reflection and specular reflection

insert image description here
The constant in the formula controls the mixing degree of the two reflectance functions.
The relative proportion of specular reflection and astigmatic reflection varies with the surface material of the object. A smooth object, or a shiny object, has a higher specular reflection component than a matte one. objects.

surface direction

Imagine a point on the sphere, and suppose a plane is tangent to the sphere at that point, and the normal to that plane is also the surface normal to the corresponding point on the sphere.

Surface Orientation: The angle between the surface normal and the camera direction

insert image description here
This equation simply states that for a unit change in depth z, the corresponding displacements in X and Y are p and q, respectively. The unit surface normal can be obtained by dividing the surface normal by its length:
insert image description here

Reflectance Map

The combination of scene lighting, surface reflection, and (in an observer-centered coordinate system) surface orientation representation is called a reflection map. It determines the brightness of a surface patch in a specific direction given the illumination distribution and surface material. The surface
patch is assumed to have Lambertian reflective properties illuminated by a point source. The radiation of the surface sheet has been calculated as:
insert image description here
In the formula, 0. is the angle between the normal of the surface sheet and the direction vector of the light source.
insert image description here

The cosine of the angle between two vectors is the dot product of the two vectors divided by the length of each vector, so the cosine of the angle between the surface normal and the light direction is: scene lighting (light source),
insert image description here
surface reflective properties, and surface direction (Gradient representation) jointly determine the brightness of a point on the surface, and the combination of the three forms a reflection map.
Assuming that the irradiance (brightness) on the image plane is equal to the radiance of the corresponding point on the surface of the object, the reflection map and the above three factors are known , the brightness of a point on the image can be determined.
The exact value of the image irradiance depends on various factors, such as the intensity of the light source, the light collection performance of the optical system, and many other factors that do not affect reflection. These factors make the image irradiance proportional to some constant. Therefore, reflectance maps can be normalized for a uniform description.
In this way, for a Lambertian surface irradiated by a distant point light source, there are:
insert image description here
the relationship between the brightness of the scene and the orientation of the surface can be obtained by the reflection map.

Typical reflection diagram of a Lambertian surface illuminated by a point light source

insert image description here

Brightness Constraint Equation

The reflectance map represents the relationship between surface brightness and surface orientation.
The irradiance of a point on the image is proportional to the brightness of the corresponding point on the target surface in the scene.
If the normalization determines the scale coefficient as a unit value, then the brightness of the scene point can be recorded as: the
point illuminance on the image can be obtained as:
insert image description here
the image intensity at a pixel point is a function corresponding to the surface direction of the scene point, the Intensity values ​​can be obtained in reflectance maps. In this way, for a fixed lighting and imaging conditions, and for a surface with known reflective properties, changes in surface orientation can be converted into corresponding changes in image intensity. Conversely, by the image intensity Changes can restore the shape of the surface, that is, the so-called shape recovery problem from light and dark."
The image irradiation equation contains two unknowns, the surface direction p and g.
Basic idea: Different image radiation equations are generated by different light sources to increase the number of equations to solve the surface directions p and q. Assume that two images with different lighting are acquired, as shown in the figure. In this way, for each point in the image, two image irradiation equations will be generated:
insert image description here

If these equations are linear and linearly independent, then p and 9 have a unique solution. If the equation is nonlinear, then the equation has no solution or no unique solution.
Schematic diagram of the superposition of two reflection maps illuminated by two different light sources:
insert image description here

For example, the two image radiation equations are:
insert image description here
It can be verified that when R and R take different values ​​respectively, the above equation will have one solution, two solutions, or no solution, when (p1:q1)=(p2;q2 ), there will be infinite solutions.
Main code part:

ImageFiles := []
ImageFiles[0] :='F:/光度立体/0.jpg'
ImageFiles[1] :='F:/光度立体/90.jpg'
ImageFiles[2] := 'F:/光度立体/180.jpg'
ImageFiles[3] := 'F:/光度立体/360.jpg'


* zoom_image_size (Image, ImageZoom, 512, 512, 'constant')
read_image (Image, ImageFiles)
rgb1_to_gray (Image, Image)
    * Image Acquisition 01: Do something

* Tilts := [0,90,180,270]
* Slants := [45,45,45,45]
Tilts := [-80,10,95,-170]
Slants := [45,45,45,45]
* ResultType := ['gradient','albedo']
ResultType := ['gradient']
photometric_stereo (Image, HeightField, Gradient, Albedo, Slants, Tilts, 'gradient', 'poisson', [], [])
derivate_vector_field (Gradient, Result, 5, 'mean_curvature')
* threshold (Result, Regions, 0.001165, 0.1)
threshold (Result, Regions, 0, 0.1)
* gen_circle (ROI_0, 1946.17, 2498.06, 766.33)
* clip_region (Regions, RegionClipped, 1165, 1679, 2744, 3222)

Guess you like

Origin blog.csdn.net/weixin_40911806/article/details/130004075