pywayne-cv-camera-model

Camera model wrapper for camera_models C++ library via pybind11. Use when working with pywayne.cv.camera_model module to load camera models from YAML configuration files, access camera properties (model type, image size, parameters), perform projection operations (lift_projective, space_to_plane), and export camera parameters as dictionaries.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "pywayne-cv-camera-model" with this command: npx skills add wangyendt/camera-model

Pywayne Camera Model

This module wraps the camera_models C++ library via pybind11, providing a Python interface for camera operations.

Quick Start

from pywayne.cv.camera_model import CameraModel
from pywayne.cv.tools import write_cv_yaml
import numpy as np

# Create camera model
camera = CameraModel()

# Load from YAML file
camera.load_from_yaml('camera_config.yaml')

# Access properties
print(f"Model: {camera.model_type}")
print(f"Size: {camera.image_width}x{camera.image_height}")

Loading from YAML

from pathlib import Path

# Sample YAML configuration
yaml_data = {
    "model_type": "PINHOLE",
    "camera_name": "my_camera",
    "image_width": 1280,
    "image_height": 720,
    "distortion_parameters": {"k1": 0.0, "k2": 0.0},
    "projection_parameters": {"fx": 600.0, "fy": 600.0, "cx": 640.0, "cy": 360.0}
}

# Write YAML file
write_cv_yaml('camera_config.yaml', yaml_data)

# Load model
camera.load_from_yaml('camera_config.yaml')

Supported Camera Models

Model TypeDescription
PINHOLEStandard pinhole camera with radial distortion
PINHOLE_FULLFull pinhole model with all distortion parameters
CATACatadioptric camera model
EQUIDISTANTEquidistant camera model
OCAMUnified camera model

Projection Operations

lift_projective()

Lifts a 2D image point to a 3D projective ray:

# Input can be tuple, list, or numpy array
ray_3d = camera.lift_projective([u, v])  # Returns np.ndarray (x, y, z)

space_to_plane()

Projects a 3D point onto the 2D image plane:

# Input can be tuple, list, or numpy array
uv = camera.space_to_plane([x, y, z])  # Returns np.ndarray (u, v)

Properties

PropertyDescription
model_typeCamera model type (enum)
camera_nameName of the loaded camera
image_widthImage width in pixels
image_heightImage height in pixels

Parameters Dictionary

Export all camera parameters as a dictionary:

params = camera.get_parameters_as_dict()
print(params)

Includes model-specific parameters:

  • Pinhole: k1, k2, p1, p2, fx, fy, cx, cy
  • Pinhole Full: k1-k6, p1-p2, fx, fy, cx, cy
  • CATA: xi, k1-k2, p1-p2, gamma1-2, u0, v0
  • Equidistant: k2-k5, mu, mv, u0, v0
  • OCAM: C, D, E, center_x, center_y, poly, inv_poly

Requirements

  • camera_models - C++ library (auto-downloaded via gettool if missing)
  • numpy - Array operations
  • pywayne.cv.tools.write_cv_yaml - For writing YAML files

Notes

  • Library is automatically checked and downloaded via gettool if not found
  • Supports both tuple/list and numpy array inputs for projection methods
  • Output from projection methods is always np.ndarray with dtype=np.float64

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Fitbit Tracker

Personal Fitbit integration for daily health tracking with adaptive sleep and activity reporting

Registry SourceRecently Updated
General

Ollama Load Balancer

Ollama load balancer for Llama, Qwen, DeepSeek, and Mistral inference across multiple machines. Load balancing with auto-discovery via mDNS, health checks, q...

Registry SourceRecently Updated
General

Google Merchant Center

Google Merchant Center integration. Manage Accounts. Use when the user wants to interact with Google Merchant Center data.

Registry SourceRecently Updated
General

Twitter/X All-in-One — Search, Monitor & Publish Text & Media Posts

Searches and reads X (Twitter): profiles, timelines, mentions, followers, tweet search, trends, lists, communities, and Spaces. Publishes posts, likes/unlike...

Registry SourceRecently Updated