MoMoRendrer for correspondence images. Separates rasterization and shading which allows to cache rasterization.
A correspondence image allows to create a mapping between the pixels and the mesh.
The renderCorrespondenceImage function returns a PixelImage containing TriangleFragments, which contains the TriangleId and the BarycentricCoordinates specifying the exact location on a TriangleMesh.
Features:
Allows to reuse previously rasterized images for different applications such as rendering of depth maps.
Implementations for rendering depth maps and correspondence color images.
renderImage() returns the same result as the default MoMoRenderer.
Test
We have this functionality without backface culling in the parametric-face-image-generator-project, but I think the Correspondence MoMoRenderer belongs into scalismo-faces.
What do you think?
Code example to create a color coded correspondence image:
val model = ???
val correspondenceRenderer = CorrespondenceMoMoRenderer(model).cached(5)
val param = RenderParameter.defaultSquare
.withMoMo(MoMoInstance.zero(model, new URI("model")))
val renderer = CorrespondenceColorImageRenderer(correspondenceRenderer, RGBA.BlackTransparent)
val colorCodedCorrespondence = renderer.renderImage(param)
val depthRenderer = DepthMapRenderer(correspondenceRenderer, RGBA.BlackTransparent)
val depthImage = depthRenderer.renderImage(param)
MoMoRendrer for correspondence images. Separates rasterization and shading which allows to cache rasterization.
A correspondence image allows to create a mapping between the pixels and the mesh. The renderCorrespondenceImage function returns a PixelImage containing TriangleFragments, which contains the TriangleId and the BarycentricCoordinates specifying the exact location on a TriangleMesh.
Features:
We have this functionality without backface culling in the parametric-face-image-generator-project, but I think the Correspondence MoMoRenderer belongs into scalismo-faces.
What do you think?
Code example to create a color coded correspondence image: