Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CorrespondenceMoMoRenderer #97

Merged
merged 1 commit into from
Mar 29, 2018

Conversation

andreas-schneider
Copy link

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)

colorcodedcorrespondenceimage
depthimage

@Andreas-Forster Andreas-Forster merged commit be5095e into master Mar 29, 2018
@Andreas-Forster Andreas-Forster deleted the feature-correspondence-renderer branch March 29, 2018 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants