ImFusion SDK 4.3
ColorMapOptimization Class Reference

#include <RGBD/Include/ImFusion/RGBD/ColorMapOptimization.h>

Provides color map optimization for textured mesh generation from RGB data. More...

+ Inheritance diagram for ColorMapOptimization:

Detailed Description

Provides color map optimization for textured mesh generation from RGB data.

This class is intended for post-processing reconstructed meshes to improve texture quality by optimizing the mapping between color images and mesh surfaces. It supports both rigid and non-rigid optimization, and exposes several parameters to control the optimization process.

Typical usage involves providing a set of RGB images and a reconstructed mesh, then calling texture() to generate a new mesh with improved texture mapping. The RGB images must be associated with camera poses and intrinsics. These are provided via the RGBDDataComponent elements in the SharedImageSet.

SharedImageSet imageSet; // needs to be given
Mesh inputMesh; // needs to be given
optimizer.setMaxIterations(200);
optimizer.setNonRigidOptimization(true);
optimizer.setSubdivisionResolution(2.0);
optimizer.setMaxDepth(3000);
Mesh* texturedMesh = nullptr;
bool success = optimizer.texture(imageSet, inputMesh, texturedMesh);
if (success)
{ /* use texturedMesh */
}
Provides color map optimization for textured mesh generation from RGB data.
Definition ColorMapOptimization.h:49
bool texture(const SharedImageSet &img, Mesh &meshIn, Mesh *&meshOut)
Optimizes the texture mapping of the input mesh using the provided RGB images.
void setSubdivisionResolution(double res)
Sets the target resolution (in world units, usually mm) for mesh subdivision.
Definition ColorMapOptimization.h:61
void setMaxIterations(int iter)
Sets the maximum number of optimization iterations.
Definition ColorMapOptimization.h:64
void setMaxDepth(double maxDepth)
Sets the maximum depth (in world units, usually mm) for considering points in the optimization.
Definition ColorMapOptimization.h:72
void setNonRigidOptimization(bool nonRigid)
Enables or disables non-rigid optimization.
Definition ColorMapOptimization.h:68
Represents a triangle mesh.
Definition Mesh.h:43
Set of images independent of their storage location.
Definition SharedImageSet.h:42
Note
  • All units for depth, resolution, and thresholds are in world units (usually millimeters) unless otherwise stated.
  • The input SharedImageSet must contain RGBDDataComponent elements for correct operation.
  • Ownership of the output mesh (meshOut) is transferred to the caller; caller is responsible for deletion.
See also
Mesh, SharedImageSet

All methods are not thread-safe unless otherwise stated.

Public Member Functions

void setErosionRadius (int radius)
 Sets the radius (in pixels) for erosion applied to the mask during optimization.
 
void setDepthDiscontinuityThreshold (double thresh)
 Sets the threshold (in world units, usually mm) for detecting depth discontinuities.
 
void setSubdivisionResolution (double res)
 Sets the target resolution (in world units, usually mm) for mesh subdivision.
 
void setMaxIterations (int iter)
 Sets the maximum number of optimization iterations.
 
void setNonRigidOptimization (bool nonRigid)
 Enables or disables non-rigid optimization.
 
void setMaxDepth (double maxDepth)
 Sets the maximum depth (in world units, usually mm) for considering points in the optimization.
 
void setDepthVisibilityThreshold (double thresh)
 Sets the threshold (in world units, usually mm) for depth visibility.
 
bool texture (const SharedImageSet &img, Mesh &meshIn, Mesh *&meshOut)
 Optimizes the texture mapping of the input mesh using the provided RGB images.
 
void configure (const Properties *p) override
 Configures the optimizer from a Properties object.
 
void configuration (Properties *p) const override
 Writes the current configuration to a Properties object.
 
- Public Member Functions inherited from Configurable
virtual void configureDefaults ()
 Retrieve the properties of this object, replaces values with their defaults and sets it again.
 
void registerParameter (ParameterBase *param)
 Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration().
 
void unregisterParameter (const ParameterBase *param)
 Remove the given Parameter or SubProperty from the list of registered parameters.
 
 Configurable (const Configurable &rhs)
 
 Configurable (Configurable &&rhs) noexcept
 
Configurableoperator= (const Configurable &)
 
Configurableoperator= (Configurable &&) noexcept
 

Additional Inherited Members

- Public Attributes inherited from Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
 
- Protected Attributes inherited from Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
 

Member Function Documentation

◆ setErosionRadius()

void setErosionRadius ( int radius)
inline

Sets the radius (in pixels) for erosion applied to the mask during optimization.

Larger values can help remove small artifacts but may reduce texture coverage.

◆ setDepthDiscontinuityThreshold()

void setDepthDiscontinuityThreshold ( double thresh)
inline

Sets the threshold (in world units, usually mm) for detecting depth discontinuities.

Higher values make the algorithm less sensitive to depth jumps.

◆ setSubdivisionResolution()

void setSubdivisionResolution ( double res)
inline

Sets the target resolution (in world units, usually mm) for mesh subdivision.

Use -1 to disable subdivision.

◆ setNonRigidOptimization()

void setNonRigidOptimization ( bool nonRigid)
inline

Enables or disables non-rigid optimization.

Non-rigid optimization can better handle local misalignments but is slower.

◆ setMaxDepth()

void setMaxDepth ( double maxDepth)
inline

Sets the maximum depth (in world units, usually mm) for considering points in the optimization.

Points beyond this depth are ignored.

◆ setDepthVisibilityThreshold()

void setDepthVisibilityThreshold ( double thresh)
inline

Sets the threshold (in world units, usually mm) for depth visibility.

Controls which points are considered visible during optimization.

◆ texture()

bool texture ( const SharedImageSet & img,
Mesh & meshIn,
Mesh *& meshOut )

Optimizes the texture mapping of the input mesh using the provided RGB images.

Parameters
imgSharedImageSet containing a set of RGB images with associated camera poses and intrinsics given by elementwise RGBDDataComponent.
meshInInput mesh to be textured.
meshOutOutput pointer to the newly textured mesh. Ownership is transferred to the caller.
Returns
true if optimization and texturing succeeded, false otherwise.

Precondition: meshIn must be a valid, reconstructed mesh; img must contain corresponding RGBDDataComponents (elementwise). Postcondition: meshOut points to a new mesh instance with optimized texture mapping.

◆ configure()

void configure ( const Properties * p)
overridevirtual

Configures the optimizer from a Properties object.

Parameters
pProperties object containing configuration parameters.

This method is typically used for loading settings from a workspace or configuration file.

Reimplemented from Configurable.

◆ configuration()

void configuration ( Properties * p) const
overridevirtual

Writes the current configuration to a Properties object.

Parameters
pProperties object to be filled with current settings.

Reimplemented from Configurable.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close