symforce.cam.posed_camera module#
- class PosedCamera(pose, calibration, image_size=None)[source]#
Bases:
Camera
Camera with a given pose, camera calibration, and an optionally specified image size.
If the image size is specified, we use it to check whether pixels (either given or computed by projection of 3D points into the image frame) are in the image frame and thus valid/invalid.
- PosedCameraT = ~PosedCameraT#
- pixel_from_global_point(point, epsilon=0.0)[source]#
Transforms the given point into the camera frame using the given camera pose, and then uses the given camera calibration to compute the resulted pixel coordinates of the projected point.
- global_point_from_pixel(pixel, range_to_point, epsilon=0.0)[source]#
Computes a point written in the global frame along the ray passing through the center of the given pixel. The point is positioned at a given range along the ray.
- Parameters:
- Returns:
global_point – The point in the global frame.
is_valid – 1 if point is valid
- Return type:
- warp_pixel(pixel, inverse_range, target_cam, epsilon=0.0)[source]#
Project a pixel in this camera into another camera.
- Parameters:
pixel (Matrix21) – Pixel in the source camera
inverse_range (float) – Inverse distance along the ray to the global point
target_cam (PosedCamera) – Camera to project global point into
epsilon (float) –
- Returns:
pixel – Pixel in the target camera
is_valid – 1 if given point is valid in source camera and target camera
- Return type: