mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-13 03:14:00 +08:00
* 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
13 lines
460 B
Python
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
|