Skip to content
Skills Library
Programming · Building & coding

pywayne-cv-camera-model

/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.

Licence
MIT
Last repository change
23.10.2026

Assessment and security

95/ 100Class: good
Format20 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 23.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

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.

Original author description

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.

How it works

  1. Quick Start
  2. Loading from YAML
  3. Supported Camera Models
  4. Projection Operations
  5. Properties
  6. Parameters Dictionary
  7. Requirements
  8. Notes
Original SKILL.md headings · 112 lines, 390 words
SKILL.md preview
---
name: pywayne-cv-camera-model
description: 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.
---

# Pywayne Camera Model

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

## Quick Start

```python
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

```python
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 Type | Description |
|------------|-------------|
| `PINHOLE` | Standard pinhole camera with radial distortion |
| `PINHOLE_FULL` | Full pinhole model with all distortion parameters |
| `CATA` | Catadioptric camera model |
| `EQUIDISTANT` | Equidistant camera model |
| `OCAM` | Unified camera model |

## Projection Operations

### lift_projective()

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

```python
# 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:

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

## Properties

| Property | Description |
|---------|-------------|
| `model_type` | Camera model type (enum) |
| `camera_name` | Name of the loaded camera |
| `image_width` | Image width in pixels |
| `image_height` | Image height in pixels |

## Parameters Dictionary

Export all camera parameters as a dictionary:

```python
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`

Versions

The database has no other skills named pywayne-cv-camera-model.

Database snapshot: 13.11.2026 · package version 2dafa6e21627 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 95pywayne-cv-tools
    OpenCV YAML file read/write utilities. Use when working with pywayne.cv.tools module to read OpenCV FileStorage YAML files with support for nested structures, numpy arrays, basic types, and lists. Handles cv2.FileNode parsing including Map, Seq, and matrix nodes.
  • 95pywayne-helper
    Project configuration management helper for YAML config files. Use when projects need cross-process/cross-file parameter sharing via a centralized config file. Supports automatic project root detection, nested config key management, and waiting mechanism for values set by other processes.
  • 100camera-interface
    Guides creation and configuration of VideoSystem instances for camera acquisition. Covers constructor parameters, lifecycle methods, system ID allocation, and encoding selection. Use when writing code that creates VideoSystem instances or needs to understand the VideoSystem API.
  • 100yaml-config
    Use this skill when reading or writing YAML configuration files, loading vehicle parameters, or handling config file parsing with proper error handling.
  • 100camera-setup
    Guides use of ataraxis-video-system MCP tools for camera discovery, runtime verification, interactive video session testing, and GenICam camera configuration. Use when discovering connected cameras, verifying system encoding requirements, testing camera acquisition, or reading…
  • 100camera-api
    摄像头设备与云事件 API 技能。用于查询设备列表、根据设备名解析 device_id、查询设备最新封面图、查询设备在线状态、按天查询或汇总云事件、查询单个事件详情,以及在需要最新画面时向设备发送截图指令并轮询结果。当用户要求查看某个摄像头当前画面、最新封面、在线状态、今天/昨天/某天/最近几天发生了什么、某个事件详情,或只知道设备名称不知道 device_id 时使用。

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.