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

Get back 2d image from 3d model and texture map #78

Closed
vidit09 opened this issue Dec 16, 2016 · 6 comments
Closed

Get back 2d image from 3d model and texture map #78

vidit09 opened this issue Dec 16, 2016 · 6 comments
Labels

Comments

@vidit09
Copy link

vidit09 commented Dec 16, 2016

Hi Patrik

I'm using the library for fitting but also would like generate 2D image using genrated Mesh and Isomap. I've tried using the render method in render.hpp for this task but I'm not getting a proper 2d image rather image similar to the isomap. Could you please tell what does render function exactly do? Also I've tried with different model view projection values but couldn't get proper 2d image. Any suggestions in this regard will be helpful.

Thanks
Vidit

@patrikhuber
Copy link
Owner

Hi,

You can have a look at how 4dface uses the render::render() function: https://github.com/patrikhuber/4dface/blob/master/apps/4dface.cpp#L235

If you want a frontal face, you can just set the modelview matrix to a 4x4 identity matrix.

Hope that helps!

@vidit09
Copy link
Author

vidit09 commented Dec 17, 2016

Thanks Patrik. It works now!!

@vidit09 vidit09 closed this as completed Dec 17, 2016
@Sampson-Lee
Copy link

Sampson-Lee commented Jun 6, 2018

Hi,

I want generate 2D image using genrated Mesh and Isomap in python, but I am confused about the code: https://github.com/patrikhuber/4dface/blob/master/apps/4dface.cpp#L235. How can I get a texture from Isomap or generate python binding of render::render()? Please give me some advice, thanks a lot.

@siarez
Copy link

siarez commented Jan 22, 2020

I have the same question. How to do this in Python?

@patrikhuber
Copy link
Owner

Just have a look at the python/demo.py example in the eos repository, you can fit and extract texture there. Then, use OpenGL or any other rendering library in Python to render the mesh in Python in whichever way you'd like. See also #294.

@sicilyliulc
Copy link

Hi,

You can have a look at how 4dface uses the render::render() function: https://github.com/patrikhuber/4dface/blob/master/apps/4dface.cpp#L235

If you want a frontal face, you can just set the modelview matrix to a 4x4 identity matrix.

Hope that helps!

hi, when i use eos.render.render(mesh, model_view_matrix,projection_matrix, image_height, image_width) get a 2d picture,but it get error ,python=3.7 eos-py==1.1.2
AttributeError: module 'eos.render' has no attribute 'render'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants