The input to mesh_opt is a mesh with an explicit normal for each vertex position. The positions are usually measured with a triangulation scanner. The normals should be obtained independently, for example with a photometric stereo scanner.
The first stage in the optimization is the normal correction. This stage corrects the low-frequency components in the measured normal field, which otherwise could contain substantial amounts of bias.
To do that, we use the low-frequency component of the triangulation geometry, which is usually bias free, but may contain a substantial amount of high-frequency noise.
The separation of low-frequencies is achieved by smoothing. The amount of smoothing should be enough to eliminate the high-frequency noise from the position measurements, otherwise this noise will appear in the corrected normals. The kernel size used to correct the normals below was too small. Notice that a certain amount of noise has infected the corrected normal field.
Improperly corrected normals mesh_opt panel-small.ply -fixnorm 1:3 -noopt norm:corrected.ply
Naturally, such a normal field would fail to completely eliminate the noise from the geometry during the position optimization stage. Fortunately, increasing the kernel size solves the problem.
Properly corrected normals mesh_opt panel-small.ply -fixnorm 2:3 -noopt norm:corrected.ply
Given the corrected normals, we can optimize for better positions. Below is a command line that runs the entire pipeline on the panel example, along with the output generated by the program:
[localhost ~] mesh_opt panel-small.ply -fc panel-small.fc -fixnorm 2:3 optimized.ply Reading panel-small.ply... Reading 116408 vertices... Reading range grid... Triangulating... 230778 faces. Removing faces... 480 faces removed... Done. Done. Fixing normals (2:3)... Computing point areas... Done. Finding vertex neighbors... Done. Smoothing normals... Done. Filtering took 2.496497 sec. Smoothing normals... Done. Filtering took 2.496554 sec. Smoothing normals... Done. Filtering took 2.494989 sec. Computing normals... Done. Smoothing normals... Done. Filtering took 2.491478 sec. Smoothing normals... Done. Filtering took 2.493829 sec. Smoothing normals... Done. Filtering took 2.494926 sec. Done. Range grid optimization... Analyzing range grid... Done. Building system (116407x349112)... Done. Analyzing matrix... Done. Factoring matrix... Done. Back substituting... Done. Updating range grid... Done. Writing optimized.ply... Done.
Result of position optimization mesh_opt panel-small.ply -fc panel-small.fc -fixnorm 2:3 optimized.ply
Occasionally, we have access to per-vertex confidence values. These capture the degree to which the optimization should favor the position or normal estimates, sample by sample. The following image shows the panel-small-conf.ply file that can be found within the samples. Red samples have a low confidence value for geometry.
The result of optimizing the example is that only the regions shown in red are corrected.
Effect of the confidence map