Skip to content

Add missing SolvePnPMethod enum values (AP3P, IPPE, IPPE_SQUARE, SQPNP) - #1898

Merged
shimat merged 1 commit into
mainfrom
fix/solvepnp-enum-missing-values
Jun 19, 2026
Merged

shimat merged 1 commit into
mainfrom
fix/solvepnp-enum-missing-values

Conversation

@shimat

@shimat shimat commented Jun 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes #1895.

The SolvePnPMethod enum was missing the last 4 values defined in OpenCV's
calib3d.hpp. This PR adds them to match the OpenCV 4.13.0 definition:

  • AP3P = 5
  • IPPE = 6
  • IPPE_SQUARE = 7
  • SQPNP = 8

Each value includes an XML doc comment referencing the corresponding paper,
consistent with the existing entries.

Reference: https://github.com/opencv/opencv/blob/4.13.0/modules/calib3d/include/opencv2/calib3d.hpp#L563

Notes

The obsolete SolvePnPFlags enum (marked [Obsolete(..., true)], which is a
compile-time error) was intentionally left unchanged, since it is no longer usable.

Test

dotnet build src/OpenCvSharp/OpenCvSharp.csproj -c Release succeeds with 0 errors
(net8.0 / netstandard2.0 / netstandard2.1).

Summary by CodeRabbit

  • New Features
    • Extended camera pose estimation capabilities with four new algorithms: AP3P, IPPE, IPPE_SQUARE, and SQPNP for improved flexibility in solving perspective-n-point problems.

Add the 4 values defined in OpenCV calib3d.hpp that were missing from the
SolvePnPMethod enum: AP3P=5, IPPE=6, IPPE_SQUARE=7, SQPNP=8.

Fixes #1895

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@shimat shimat self-assigned this Jun 19, 2026
@shimat shimat added the enhancement New feature or improvement to OpenCvSharp label Jun 19, 2026
@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cad6026b-ac49-44b7-a5de-13276d9b036b

📥 Commits

Reviewing files that changed from the base of the PR and between 6521669 and 0d57c6b.

📒 Files selected for processing (1)
  • src/OpenCvSharp/Modules/calib3d/Enum/SolvePnPFlags.cs

📝 Walkthrough

Walkthrough

Four new members (AP3P = 5, IPPE = 6, IPPE_SQUARE = 7, SQPNP = 8) with XML documentation are appended to the SolvePnPMethod enum in SolvePnPFlags.cs, aligning the enum with the OpenCV 4.13 calib3d header. No logic or existing members are modified.

Changes

SolvePnPMethod Enum Extension

Layer / File(s) Summary
New SolvePnPMethod enum members
src/OpenCvSharp/Modules/calib3d/Enum/SolvePnPFlags.cs
Appends AP3P = 5, IPPE = 6, IPPE_SQUARE = 7, and SQPNP = 8 with XML doc comments to SolvePnPMethod, matching OpenCV 4.13's SOLVEPNP_* constants.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • shimat/opencvsharp#1819: Updates SolvePnP/SolvePnPRansac overloads to accept SolvePnPMethod instead of SolvePnPFlags, directly connected to the same enum's API surface being extended here.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: adding four missing enum values to SolvePnPMethod.
Linked Issues check ✅ Passed The PR fully addresses issue #1895 by adding all four missing enum values (AP3P=5, IPPE=6, IPPE_SQUARE=7, SQPNP=8) with XML documentation.
Out of Scope Changes check ✅ Passed All changes are directly scoped to adding the four missing enum values to SolvePnPMethod; no unrelated modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/solvepnp-enum-missing-values

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@shimat
shimat merged commit 7667bcd into main Jun 19, 2026
11 checks passed
@shimat
shimat deleted the fix/solvepnp-enum-missing-values branch June 19, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or improvement to OpenCvSharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SolvePnPMethod enum is missing

1 participant