No project description provided
Project description
jaxcam
Jaxcam is a camera library for JAX. Jaxcam is designed to accelerate research by abstracts cameras and common operations through a simple API.
This is not an officially supported Google product.
Usage Examples
Basic imports
from jax import numpy as jnp
from jax import random
import jaxcam
Creating a camera:
>> camera = jaxcam.Camera.create(
orientation=jnp.eye(3),
position=jnp.array([0.0, 0.0, 5.0]),
image_size=jnp.array([512, 512]),
focal_length=jnp.array(512)
)
>> camera
Camera(orientation=Array([[1., 0., 0.],
[0., 1., 0.],
[0., 0., 1.]], dtype=float32), position=Array([0., 0., 5.], dtype=float32), focal_length=Array(512., dtype=float32), principal_point=Array([256., 256.], dtype=float32), image_size=Array([512., 512.], dtype=float32), skew=Array(0., dtype=float32), pixel_aspect_ratio=Array(1., dtype=float32), radial_distortion=None, tangential_distortion=None, projection_type=<ProjectionType.PERSPECTIVE: 'perspective'>, use_inverted_distortion=False)
Projecting 3D world points to camera pixels:
>> points = random.normal(random.PRNGKey(0), (5, 3))
>> pixels = jaxcam.project(camera, points)
>> pixels
Array([[246.76802 , 48.151352],
[157.49011 , 226.61935 ],
[198.61266 , 347.66937 ],
[311.53983 , 178.945 ],
[281.20334 , 342.3573 ]], dtype=float32)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jaxcam-0.3.0.tar.gz
(22.6 kB
view details)
Built Distribution
jaxcam-0.3.0-py3-none-any.whl
(26.1 kB
view details)
File details
Details for the file jaxcam-0.3.0.tar.gz
.
File metadata
- Download URL: jaxcam-0.3.0.tar.gz
- Upload date:
- Size: 22.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1167d246ebd42d70925ca1b3869b936bc4b7f46370d9684522ebf62a842ca6c |
|
MD5 | 88b8b91395a93c0ee8c94a559ef6f21d |
|
BLAKE2b-256 | ff9d0c71c74b5ed50e046ccba259edee9938d85f7c81f8e73a973e96abfef9f1 |
File details
Details for the file jaxcam-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: jaxcam-0.3.0-py3-none-any.whl
- Upload date:
- Size: 26.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9c35d0ba47b330c77be64447908634ca4eb6a18e30e5db9f69b294b70542d91 |
|
MD5 | aa4291831e82fd70888ac02843963cf7 |
|
BLAKE2b-256 | 560fa97ba59f66f0038dd15b0e63a0480456b66db80ee1c75ff14ac53b2182e2 |