ShichenLiu / SoftRas

Project page of paper "Soft Rasterizer: A Differentiable Renderer for Image-based 3D Reasoning"
MIT License
1.24k stars 156 forks source link

How to import camera parameters? #39

Closed zyuanbing closed 3 years ago

zyuanbing commented 4 years ago

Hi, I want to import a camera parameter file in json format, which include camera eye position, camera focal position, camera up vector, camera focal length, camera skew and principal point, is there any support for importing this?

ForrestPi commented 4 years ago

yeah I have similar question. I want camera parameters as input tensor . How to realize it ?

hzhao1997 commented 3 years ago

the same question.

ShichenLiu commented 3 years ago

Hi @hzhao1997 , you can use the projection transform module here: https://github.com/ShichenLiu/SoftRas/blob/0beb8aec26e65bac6fe5d41bb2a265f13b616057/soft_renderer/transform.py#L61-L80

P is the extrinsic parameters and orig_size is the image size.