MATLAB Answers

How to fit a 2d image onto 3d mesh?

23 views (last 30 days)
Elangkumaran
Elangkumaran on 27 May 2014
Answered: shuai zhang on 22 Apr 2019
I have a face image (read using imread) that has labelled face features (matrix stored in [x y] format)
I have generated depth information (a 3d mesh) for each of the labelled points, and have a matrix in `[x y z]` format, where the coordinates x and y are the same as that of the points. It looks like this:
How do I fit or warp the original image (at least the region enclosed by the points) over the 3d mesh, using the x and y coordinates for mapping? I know I have to do a lot of interpolation in the 3d mesh before I see good results, but I'd like to know how to fit an image to that
I've looked at similar threads http://www.mathworks.in/matlabcentral/newsreader/view_thread/256787 and http://www.mathworks.com/matlabcentral/answers/91858-is-it-possible-to-perform-texture-mapping-within-matlab, but the instructions there warp the face out of position with the 3d mesh (i.e. the face part of the image is not aligned with the 3d mesh)

  0 Comments

Sign in to comment.

Answers (2)

Marwa Jabberi
Marwa Jabberi on 25 Apr 2018
hello this code is usefull for fitting http://www.cbsr.ia.ac.cn/users/xiangyuzhu/projects/HPEN/main.htm can i have instructions that you used to create the mesh from xy keypoints plz?

  0 Comments

Sign in to comment.


shuai zhang
shuai zhang on 22 Apr 2019
hi. how is this going, I also meet this kind of problem, i need to fit 2d image on 3d mesh with specific coordinate correspondences. Hope to discuss with you.

  0 Comments

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by