ascust / 3DMM-Fitting-Pytorch

A 3DMM fitting framework using Pytorch.
600 stars 95 forks source link

Why should reverse z and puls camera position? #26

Closed shoutOutYangJie closed 1 year ago

shoutOutYangJie commented 1 year ago

Here is your code

face_shape = torch.matmul(face_shape,reverse_z) + camera_pos I don't know what it really means?

ascust commented 1 year ago

This is used to transform the coordinates of the mesh from the world system to cameras local system.

shoutOutYangJie commented 1 year ago

but why not directly use rotation and translale matrix?

312358434 @.***

 

------------------ 原始邮件 ------------------ 发件人: "ascust/3DMM-Fitting-Pytorch" @.>; 发送时间: 2022年11月21日(星期一) 上午10:20 @.>; @.**@.>; 主题: Re: [ascust/3DMM-Fitting-Pytorch] Why should reverse z and puls camera position? (Issue #26)

This is used to transform the coordinates of the mesh from the world system to cameras local system.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

ascust commented 1 year ago

I am not really sure about your question. My understanding is that the rotation and translation matrices are defined in the global coordinates to alter mesh's pose. If you want to project the mesh to the camera (or any camera), you have to transform the coordinates to the camera's local ones and convert 3d points to 2d points to have them on the image plane.