ascust / 3DMM-Fitting-Pytorch

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

some question about code #17

Closed UestcJay closed 2 years ago

UestcJay commented 2 years ago

` vs = torch.matmul(vs, self.reverse_z.repeat((batchsize, 1, 1))) + self.camera_pos

aug_projection = torch.matmul(vs, self.p_mat.repeat((batchsize, 1, 1)).permute((0, 2, 1)))` Hi, many thanks for your great work! I don’t know if I understand it right, the first line represents the orthographic projection? The second line indicates that the picture coordinate system is converted to the pixel coordinate system?

ascust commented 2 years ago

Hi, The first line is to:

  1. reverse the z direction.
  2. take the camera position into consideration.

So it basically transforms the world coords to cam coords.

The second line performs the projection, meaning converting 3d coords to 2d coords.