fix: initial camera position for viewer

This commit is contained in:
Wlad 2021-01-23 12:59:51 +01:00
parent 377dd5ab39
commit 0bcdabb039
2 changed files with 6 additions and 4 deletions

View File

@ -2,14 +2,13 @@
- [ ] Camera 2d projection (PyTorch pinhole camera)
- [ ] 3D transformation rewrite using PyTorch or SciPy
- [ ] PyRenderer camera initial location + position (?)
- [x] PyRenderer camera initial location + position (?)
- [ ] Setup Pose PyTorch module (W)
- [ ] pose cost function
## Nice to have
- [ ]
- [ ] add original input image to scene
- [ ] Render a camera to the scene for projection visualization
- [ ] Vposer or other technique for mesh intersection priors

View File

@ -1,6 +1,7 @@
import numpy as np
from utils import render_model, render_points
import pyrender
from scipy.spatial.transform import Rotation as R
class Renderer:
@ -17,10 +18,12 @@ class Renderer:
if camera is None:
camera = pyrender.OrthographicCamera(ymag=1, xmag=1)
if camera_pose is None:
camera_pose = np.eye(4)
camera_pose[:3, 3] = np.array([0, 0, -2])
camera_pose[0, 0] *= -1.0
camera_pose[:3, :3] = R.from_rotvec(np.pi/2 * np.array([0, 0, 0])).as_matrix()
camera_pose[:3, 3] = np.array([0, 0, 4])
self.groups = {
"body": [],