Metadata-Version: 2.4
Name: rpnp_pp
Version: 0.1.0
Summary: RPnP++: Hough voting-based 2-point RANSAC solver for robust Perspective-n-Point estimation
Keywords: computer vision,camera pose,PnP,RANSAC,Hough voting
Author: Tingrui Guo, Yuan Huang, Li Cheng
Author-Email: Chi Xu <xuchi@cug.edu.cn>
Maintainer-Email: RaneWouters <1540656951@qq.com>
License-Expression: MIT
License-File: 3rdparty/eigen3/COPYING.BSD
License-File: 3rdparty/eigen3/COPYING.GPL
License-File: 3rdparty/eigen3/COPYING.LGPL
License-File: 3rdparty/eigen3/COPYING.MINPACK
License-File: 3rdparty/eigen3/COPYING.MPL2
License-File: 3rdparty/eigen3/COPYING.README
License-File: 3rdparty/licenses/pybind11-LICENSE
License-File: LICENSE
License-File: THIRD_PARTY_NOTICES.md
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: C++
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Image Processing
Project-URL: Homepage, https://github.com/RaneWouters/RPnP_plusplus
Project-URL: Repository, https://github.com/RaneWouters/RPnP_plusplus
Project-URL: Original-MATLAB, https://github.com/xuchi7/RPnP_plusplus
Project-URL: Paper, https://doi.org/10.1109/TIP.2025.3622336
Project-URL: Issues, https://github.com/RaneWouters/RPnP_plusplus/issues
Requires-Python: >=3.9
Requires-Dist: numpy>=1.23
Provides-Extra: test
Requires-Dist: pytest>=7; extra == "test"
Requires-Dist: pytest-timeout>=2; extra == "test"
Description-Content-Type: text/markdown

# RPnP++ Python package

`rpnp_pp` provides the Python interface to RPnP++, a calibrated-camera PnP
solver using Hough voting and 2-point RANSAC.

## Install

```bash
python -m pip install rpnp_pp
```

## Minimal usage

```python
import numpy as np
import rpnp_pp

result = rpnp_pp.solve(
    world_points,          # (3, N) or (N, 3)
    pixel_points,          # (2, N) or (N, 2)
    camera_matrix,         # (3, 3)
    th_pixel=10.0,
    config=rpnp_pp.Config(seed=3, finalize=True),
)

if result.success:
    rotation = result.R
    translation = result.t
    rvec = result.rvec  # OpenCV-compatible Rodrigues vector, shape (3, 1)
    tvec = result.tvec  # OpenCV-compatible translation column, shape (3, 1)
```

The inputs must be finite and undistorted. At least six correspondences are
required. `solve_normalized` accepts normalized image coordinates, and
`refine` refines a supplied pose estimate.

The user-facing algorithm name is RPnP++; `rpnp_pp` is the package and import
name. The complete source build, C++ SDK instructions, benchmark, and
paper citation are available in the [GitHub repository](https://github.com/xuchi7/RPnP_plusplus).
