LINKS
[Chuang et al. 2009], [Prada et al. 2016], [Chuang et al. 2016]
Windows (x64) Executables
Source Code
GitHub Repository
(Older Versions: V3.0, V2.0, V1.0)
DESCRIPTION
This code performs gradient domain processing [Chuang et al. 2009, Chuang et al. 2016] on signals defined on a mesh, where the signal can be either a color-field represented as a color per vertex or is the position of the vertices themselves.
The code supports both sharpening and smoothing of the signals through the solution of a screened-Poisson equation.
Specifically, given an input signal F, it solves for the signal G minimizing:
where β is the gradient-fitting weight and λ is the gradient scale factor.
The code supports inhomogenous processing by allowing the user to replace the Riemannian metric, g, given by the embedding, with a metric that adjusts to the curvature of the surface. Specifically, given orthonormal principal curvature directions, the (idenity) metric is replaced with:
Id. + ε⋅Κ2 where Id. is the identity matrix, Κ2 is the diagonal matrix whose entries are the squares of the principal curature values, and ε is the curvature weight.
Curvatures are estimated using the surface normals. If none are provided, the vertex normals are estimated as the area-weighted sum of adjacent triangle normals.
For more robust estimation of normals, the executable also supports harmonic smoothing of normals as described in [Prada et al. 2016]. As with the code above, this amounts to minimizing:
where γ is the diffusion weight.
In the case that the signal processed describes the vertices' normals, we also support fitting the original geometry to the processed normals using the approach of [Yu et al. 2004]. Given input positions F and a target normal field N This amounts to minimizing:
where δ is the projected gradient fitting weight weight.
EXECUTABLE
- --in <input geometry>
- This string specifies the name of the input geometry, represented in PLY format.
- [--out <ouput geometry>]
- This string specifies the name of the output geometry, represented in PLY format.
- [--nIters <normal smoothing iterations>]
- This integer value gives the number of iterations of harmonic normal smoothing to be performed before estimating curvatures. (If normal smoothing is desired, we have found that a single iteration suffices.)
The default value for this parameter is 0.
- [--nTime <normal diffusion time>]
- This floating point value gives the normal diffusion time (γ).
The default value for this parameter is 10-4.
- [--gWeight <gradient interpolation weight>]
- This floating point value gives the weight for gradient interpolation (β).
The default value for this parameter is 10-4.
- [--gScale <gradient scale>]
- This floating point value gives the scale factor for the target gradient field (λ).
The default value for this parameter is 1.0.
- [--kWeight <curvature weight>]
- This floating point value gives the curvature weight for adjusting the metric (ε).
The default value for this parameter is 0.0.
- [--npWeight <normal projection weight>]
- This floating point value gives the normal projection weight (δ).
The default value for this parameter is 10-3.
- [--signal]
- This inter value describes which signal is to be processed:
- 0: Vertex positions
- 1: Vertex normals (will be assigned if none are give)
- 2: Vertex colors
- 3: Vertex normals used to fit the geometry.
- [--verbose]
- If this flag is enabled, the code will output processing information.
ShapeGradientDomain: Processes either the vertex positions, or per-vertex colors, performing isotropic/anisotropic gradient-domain smoothing and sharpening (with the option of smoothing normals in a pre-processing step)
NOTES
- The code requires Eigen as a numerical solver.
If you are using Eigen and your implementation is backed by Intel's Math Kernel Library (see discussion here), enable theEIGEN_USE_MKL_ALL
macro by defining it in the filePreProcessor.h
. (The two versions of the Windows executables are compiled with and without MKL support.)
EXAMPLES
-
The figure below shows example of both isotropic and anisotropic geometry processing.
- Top row: Isotropic sharpening:
ShapeGradientDomain --in armadillo.ply --out armadillo.sharp.ply --gScale 2 --gWeight <gradient weight>
- Middle row: Isotropic smoothing:
ShapeGradientDomain --in armadillo.ply --out armadillo.smooth.ply --gScale 0 --gWeight <gradient weight>
- Bottom row: Anisotropic smoothing:
ShapeGradientDomain --in armadillo.ply --out armadillo.smooth.ply --gScale 0 --gWeight <gradient weight> --kWeight 0.02 --nIters 1
<gradient weight>
is chosen from {1e-3
, 1e-4
, 1e-5
}
HISTORY OF CHANGES
- Added options to weight both value and gradient interpolation terms.
- Changed default values to correspond to diffusion time.
- Integrated normal smoothing within the gradient-domain processing application.
- Fixed default value weight to 1.0.
- Added support for fitting the geometry to prescribed normals.