Skip to content

OpenCV 5.x API coverage: objdetect, aruco, barcode, bgsegm gaps #2013

Description

@shimat

Summary

Audit of the objdetect, aruco, and bgsegm OpenCV 5.x C++ API surface against the current OpenCvSharp C# wrapper. Part of a broader coverage sweep that started from closing the geometry/segment.hpp gap (#2000/#2001).

Baseline: opencv @ 40738fb, opencv_contrib @ 755e506 (both pinned submodule commits on main).

Corrections found during verification

Two of the items below were initially reported as "already wrapped" by an early research pass; direct verification (grep over src/OpenCvSharp/Modules/) confirmed they do not exist — they're listed as real gaps below.

mcc (Macbeth color-checker detection, mcc_checker_detector.hpp) also surfaced as a candidate under objdetect, but cmake/opencv_build_options.cmake explicitly sets BUILD_opencv_mcc OFF — it isn't compiled into this project's native build, so it is excluded here rather than listed as a gap. (Re-evaluate only if the build config changes.)

Gaps by module

objdetect — CascadeClassifier/HOGDescriptor/QRCodeDetector core is solid; two whole classes were missed (4 items)
  • FaceRecognizerSF (objdetect/face.hpp:122) — face recognition/embedding model (create/feature/match/alignCrop); completely absent despite FaceDetectorYN being wrapped — corrected finding, confirmed missingmedium
  • QRCodeEncoder + Params (objdetect.hpp:152) — no encoder counterpart to the decoder side — corrected finding, confirmed missingmedium
  • QRCodeDetectorAruco + Params (objdetect.hpp:268) — Aruco-based QR detector variant — medium
  • estimateChessboardSharpness (objdetect.hpp:495) — sharpness metric for detected chessboard corners — small
  • CirclesGridFinderParameters (objdetect.hpp:518) — params struct for findCirclesGrid; no way to pass custom finder params today — small-medium
aruco — CharucoBoard/CharucoDetector work, but the base Board type and most of ArucoDetector's own surface are missing (cross-checked independently 3×) (4 items)
  • Board / GridBoard (aruco_board.hpp:25,107) — base board class (matchImagePoints/getObjPoints/getIds/generateImage) and plain grid-of-markers board; neither exists — CharucoBoard doesn't derive from anything today — medium
  • ArucoDetector — most of the class (aruco_detector.hpp:300-453) — only the single-dictionary constructor and DetectMarkers exist. Missing: RefineDetectedMarkers (native bridge already exists, just no C# caller), DetectMarkersWithConfidence, DetectMarkersMultiDict, multi-dict constructor, Get/SetDictionary(ies), Get/SetDetectorParameters, Get/SetRefineParameters, read/writelarge
  • Dictionary gaps (aruco_dictionary.hpp:36-155) — missing constructors (default, Dictionary(Mat,int,int)), instance ReadDictionary/WriteDictionary, GetMarkerBits, the extendDictionary free function, and a getPredefinedDictionary(int) overload — medium
  • CharucoBoard/CharucoDetector accessors (aruco_board.hpp:167-175, charuco_detector.hpp:51-61) — GetChessboardCorners, GetNearestMarkerIdx/Corners, and CharucoDetector's Get/SetBoard/Get-SetCharucoParameters/Get-SetDetectorParameters/Get-SetRefineParameters are missing — medium
bgsegm — only MOG and GMG exist; 4 of 6 background subtractors are missing entirely, native side included (4 items)
  • BackgroundSubtractorCNT + createBackgroundSubtractorCNT (bgsegm.hpp:250,310) — counting-based subtractor — medium
  • BackgroundSubtractorGSOC + createBackgroundSubtractorGSOC (bgsegm.hpp:325,375) — GSOC algorithm — medium
  • BackgroundSubtractorLSBP + BackgroundSubtractorLSBPDesc + createBackgroundSubtractorLSBP (bgsegm.hpp:337,349,395) — LSBP algorithm plus its static descriptor helper — medium
  • SyntheticSequenceGenerator + createSyntheticSequenceGenerator (bgsegm.hpp:402,436) — test-sequence generator Algorithm subclass — small-medium
  • LSBPCameraMotionCompensation enum (bgsegm.hpp:316) — used by the GSOC/LSBP factories above — small
barcode — nearly complete, two small gaps (2 items)
  • GetDownsamplingThreshold/GetDetectorScales/GetGradientThreshold (barcode.hpp:71,87,102) — only setters are wrapped (native bridge also lacks the getters) — small
  • DecodeWithType (barcode.hpp:49) — native bridge already has barcode_BarcodeDetector_decodeWithType, but no C# method calls it — small

Notes

Effort tags: small = a native bridge function/property + thin C# wrapper; medium = a small class or multi-member accessor set; large = a substantial class or multi-class family.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions