diff --git a/README.md b/README.md index 3a28e79..36dea26 100644 --- a/README.md +++ b/README.md @@ -197,6 +197,9 @@ pipeline.RetrievePointCloud(pointCloud.ptr(), pointCloud.step[0]); - 🔨 [**Tutorials**](https://docs.retinify.ai/tutorials.html) Guided explanations of retinify concepts +- 🎯 [**Calibration**](https://docs.retinify.ai/calibration.html) + Calibration Parameters Specification + - 🐍 [**Python Docs**](https://docs.retinify.ai/python.html) Python API documentation diff --git a/docs/Doxyfile b/docs/Doxyfile index e596d78..c4f1f9e 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -947,6 +947,7 @@ INPUT = content/index.md \ content/installation.md \ content/demos.md \ content/tutorials.md \ + content/calibration.md \ content/python.md \ content/cpp.md \ content/ros2.md \ diff --git a/docs/content/calibration.md b/docs/content/calibration.md new file mode 100644 index 0000000..98f0907 --- /dev/null +++ b/docs/content/calibration.md @@ -0,0 +1,113 @@ +@page calibration Calibration + + +## Calibration Parameters + +retinify::CalibrationParameters supports the pinhole camera model. + +- Intrinsic Parameters: retinify::Intrinsics + + - Focal lengths: `fx`, `fy` + - Principal point: `cx`, `cy` + - Skew coefficient: `skew` + +- Distortion Coefficients: retinify::Distortion + + - Radial distortion coefficients: `k1`, `k2`, `k3`, `k4`, `k5`, `k6` + - Tangential distortion coefficients: `p1`, `p2` + +- Rotation matrix: retinify::Mat3x3d + +- Translation vector: retinify::Vec3d + + +## Loading Calibration Parameters + +retinify::CalibrationParameters can be loaded directly from a JSON file as follows: + +
+Sample Stereo Calibration JSON + +This JSON file defines stereo camera calibration parameters. + +```json +{ + // Reprojection error after calibration (optional) + "calibration_error": 0.0, + + // Calibration timestamp or duration (optional) + "calibration_time": 0, + + // Image resolution used for calibration + "image_width": 1241, + "image_height": 376, + + // Left camera intrinsics + "left_intrinsics": { + "fx": 718.856, + "fy": 718.856, + "cx": 607.1928, + "cy": 185.2157, + "skew": 0.0 + }, + + // Right camera intrinsics + "right_intrinsics": { + "fx": 718.856, + "fy": 718.856, + "cx": 607.1928, + "cy": 185.2157, + "skew": 0.0 + }, + + // Left camera distortion coefficients + "left_distortion": { + "k1": 0.0, + "k2": 0.0, + "k3": 0.0, + "k4": 0.0, + "k5": 0.0, + "k6": 0.0, + "p1": 0.0, + "p2": 0.0 + }, + + // Right camera distortion coefficients + "right_distortion": { + "k1": 0.0, + "k2": 0.0, + "k3": 0.0, + "k4": 0.0, + "k5": 0.0, + "k6": 0.0, + "p1": 0.0, + "p2": 0.0 + }, + + // Rotation matrix + "rotation": [ + [1.0, 0.0, 0.0], + [0.0, 1.0, 0.0], + [0.0, 0.0, 1.0] + ], + + // Translation vector + "translation": [-0.5371657, 0.0, 0.0] +} +``` + +
+ +```cpp +// Load calibration parameters from JSON file +retinify::CalibrationParameters calib_params; +retinify::LoadCalibrationParameters("calib.json", calib_params); + +// Initialize pipeline with calibration parameters +retinify::Pipeline pipeline; +pipeline.Initialize(image_width, + image_height, + retinify::PixelFormat::RGB8, + retinify::DepthMode::ACCURATE, + calib_params); +``` diff --git a/docs/content/index.md b/docs/content/index.md index 65ddb06..8f45c1b 100644 --- a/docs/content/index.md +++ b/docs/content/index.md @@ -20,6 +20,7 @@ Retinify is open-source, and the source code is publicly available: - [Installation](@ref installation) - [Demos](@ref demos) - [Tutorials](@ref tutorials) +- [Calibration](@ref calibration) - [Python Docs](@ref python) - [C++ Docs](@ref cpp) - [ROS2 Docs](@ref ros2)