Files
nerfstudio/tests/structures/test_cameras.py
T
Ethan Weber 0b7dfcdc5d Initial ray generation and dataset code (#12)
* ray generator and cameras structure progress

* test renames

* added pass

* conflicts

* fixing some black errors

* reformated files

* merged master and .gitignore

* fixing linting

* removing old folder

* removed return False

* pylint fixes

* update

* updates

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update
2022-04-12 15:08:16 -07:00

13 lines
460 B
Python

import torch
from mattport.structures.cameras import PinholeCamera
from mattport.structures.rays import RayBundle, CameraRayBundle
def test_pinhole_camera():
pinhole_camera = PinholeCamera(cx=400.0, cy=400.0, fx=10.0, fy=10.0)
camera_ray_bundle = pinhole_camera.generate_camera_rays()
assert isinstance(camera_ray_bundle, CameraRayBundle)
assert torch.allclose(camera_ray_bundle.origins[0], torch.tensor([0.0, 0.0, 0.0]))
# assert False