Camera Model¶
The CameraModel encapsulates the mapping between pixel coordinates and tangent-plane (gnomonic projection) coordinates. It bundles all camera intrinsics into a single struct used throughout the solving and calibration pipeline.
Parameters¶
| Parameter | Description |
|---|---|
focal_length_px |
Focal length in pixels (= image_width / (2 × tan(FOV/2))) |
image_width |
Image width in pixels |
image_height |
Image height in pixels |
crpix |
Optical center offset from image center [x, y] in pixels |
parity_flip |
Whether the image x-axis is mirrored |
distortion |
Optional RadialDistortion or PolynomialDistortion model |
Pixel → Tangent Plane Pipeline¶
The pixel_to_tanplane() method applies the following steps:
- Subtract CRPIX — shift to optical-center-relative coordinates
- Undistort — apply the inverse distortion model (if any)
- Parity flip — negate x if
parity_flipis True - Divide by focal length — convert from pixels to radians
The result is tangent-plane coordinates (ξ, η) in radians, suitable for gnomonic (TAN) projection.
Creating a Camera Model¶
Using with the Solver¶
Pass a CameraModel to solve_from_centroids() to apply distortion correction and parity during solving:
result = db.solve_from_centroids(
centroids,
fov_estimate_deg=10.0,
image_shape=image.shape,
camera_model=cam,
)
The returned SolveResult uses the camera model's distortion and parity for its pixel_to_world() and world_to_pixel() methods.
Calibration¶
Use calibrate_camera() to fit a camera model from one or more solved images. See CalibrateResult for details.