zorah / Elastic2D3D

Implementation of "Efficient Globally Optimal 2D-to-3D Deformable Shape Matching" (Lähner, Rodola, Schmidt, Bronstein and Cremers, 2016)
MIT License
11 stars 6 forks source link

Data generation #2

Open YanhaoZhang opened 4 years ago

YanhaoZhang commented 4 years ago

Thank you so much for open-source this project. I plan to try it using my own data. May I ask you how to generate the data for your code? What I have are a 3D mesh containing the VERT & TRIV and some 2D pixels of the contour of this 3D model.

To be specific, I think N is for the 2D contour and M is for the 3D model. I can guess the meaning of some of the data, may I ask you the meaning for the rest of them? Thank you so much. Data in N VERT: coordinate TRIV: boundary: n&n: size normals: normals in 2D S_tri: evecs: evals: S: proj: segmentation

zorah commented 4 years ago

Okay, so there is additional code on my homepage to help with this: https://vision.in.tum.de/~laehner/Elastic2D3D/ (the link retrieval code gives a rough framework of how to do retrieval as well as a function prepare_data which is probably what you need) It assumes that the contour is given as a silhouette image (but you can probably skip the first part as you already have the contour in pixels)

Here are the meaning of the properties: VERT: coordinate TRIV: we triangulate the inside of the contour and these are the triangles (see the code I referenced) boundary: the triangulation of the inside adds more vertices in the inside of the contour, this is an indicator which were the original boundary vertices n&n: size normals: normals in 2D S_tri: the areas of the triangles (see above) evecs: the eigenfunctions of the LBO on the triangulation (see code) evals: the eigenvalues of the LBO on the triangulation (see code) S: the stiffness matrix part of the LBO proj: this is a mxn matrix (m being number of triangles, n number of vertices) which converts vertex-wise functions into triangle-wise functions (without anything special just an average over the three values on the corner of each triangle) segmentation: a consistent segmentation of the triangulation after Robust Region Detection via Consensus Segmentation of Deformable Shapes, Rodola Rota-Bulo Cremers (see https://vision.in.tum.de/members/rodola/code), this is not strictly necessary

Hope that helped!

YanhaoZhang commented 4 years ago

@zorah Thank you so much for your reply! Sorry, I just saw it. I will try the code you mentioned.