shunsukesaito / PIFu

This repository contains the code for the paper "PIFu: Pixel-Aligned Implicit Function for High-Resolution Clothed Human Digitization"
https://shunsukesaito.github.io/PIFu/
Other
1.76k stars 340 forks source link

Question about reprojection of reconstructed mesh #13

Closed fyviezhao closed 4 years ago

fyviezhao commented 4 years ago

Hi Shunsukesaito, amazing work! I want to get the depth map from the predict mesh (e.g. result_ryota.obj reconstructed from the sample imgs in the repo), but have trouble in reprojecting the mesh to (512*512) image plane. I use the Camera in lib.renderer.camera for projection but get a all-black image. Can you or anyone give me some tips on how to correctly set the camera and reproject the reconstructed mesh to depth map? Thanks a lot!

shunsukesaito commented 4 years ago

The reconstructed mesh is in normalized image coordinates [-1,1]. If you want to align it with image pixels, you may need to do something like v = 512 * (0.5 * v + 0.5) assuming 512 is the input image resolution.

bbico commented 4 years ago

Hi, I have same issue about reprojecting mesh to image. Is the equation means that the camera have orthogonal view so that I can project the mesh?

shunsukesaito commented 4 years ago

Yes. The released PIFu is trained with weak perspective camera model (orthogonal projection + scale), so the equation above lets you align the reconstructed mesh with the input image in the pixel coordinate space.