ReconstructMe SDK 2.6.43-0
Real-time 3D reconstruction engine
How to colorize your reconstruction.
ReconstructMe allows you to create colorized triangular surface representations of your reconstruction. There are many approaches to colorize your result and the one that ReconstructMe currently supports is colorization of surface vertices. That is, each vertex receives a distinct color that is generated from all RGB frames.
The following video shows the result created by the following sections.
In order to digitize with color support, you need to have a sensor or file stream that supports colors. Since the camera that captures the depth stream is physically offsetted by the camera that provides the RGB stream, you need to register the depth and color stream. Most supported sensors provide this ability directly in their SDK and you only need to enable it via the sensor options as follows
For file streams this property is not available. However, file streams recorded with sensors that have the alignment property turned on will equally work well.
Next, you need to instruct ReconstructMe to compile with color support enabled. This is done by
256(res-x) x 256(res-y) x 256(res-z) x 4(bytes per voxel) x 2(account for color support) = 128 Mbytes.
Finally, we'd like to render the volume image using colors, so we get a nice preview of the result
That's all there is to setup ReconstructMe with color support enabled.
The function reme_surface_colorize_vertices will colorize all vertices that lie within a valid region of the color volume. At volume borders and unseen regions no color information can be extracted. Vertices inside those areas will receive an invalid vertex color with is currently mapped to pure green (subject to change in later versions).
In order to paint vertices with invalid colors you can use reme_surface_inpaint_vertices. This algorithm will attempt to find a suitable color for each vertex with invalid color by looking at neighboring vertex colors. In case a connected component is isolated and every vertex in that component has an invalid vertex color, the algorithm cannot determine a suitable color.
You might want to invoke any of the surface manipulating functions before colorizing/inpainting the surface. E.g colorizing a Poisson reconstructed surface is also supported. Holes closed by the algorithm would then be automatically colorized (actually inpainted).
Finally save the colored surface.
That's it! The entire example can be found in example_reconstructmesdk_colorize.cpp