Skip to content

Plain-C interop input structs for tracker interfaces - #67

Merged
kobejean merged 1 commit into
mainfrom
tracker-interop-input-structs
Jun 29, 2026
Merged

Plain-C interop input structs for tracker interfaces#67
kobejean merged 1 commit into
mainfrom
tracker-interop-input-structs

Conversation

@kobejean

Copy link
Copy Markdown
Owner

Adds two plain-C POD structs so the tracker inputs can be shared across C++, Objective-C, and Swift without dragging opencv/C++ headers across the language boundary:

  • LARImageInputlar/tracking/image_input.h (grayscale buffer: data, width, height, bytesPerRow)
  • LARSpatialQuerylar/core/spatial/spatial_query.h (x, z, diameter)

One struct per header so each can live in (and move between) the appropriate module — LARSpatialQuery sits in core/spatial next to region_tree.h.

Adds struct-taking overloads to Tracker::localize and FilteredTracker::measurementUpdate that wrap the grayscale buffer in a cv::Mat (no copy) and forward to the existing cv::InputArray methods. This moves the cv::Mat wrapping out of the consuming Obj-C bridge. The cv::InputArray methods are kept for internal callers (lar_localize, colmap_refiner).

🤖 Generated with Claude Code

Introduce LARImageInput (lar/tracking/image_input.h) and LARSpatialQuery
(lar/core/spatial/spatial_query.h): plain-C POD structs that can be shared
verbatim across C++, Objective-C, and Swift without dragging opencv/C++
headers across the language boundary.

Add struct-taking overloads to Tracker::localize and
FilteredTracker::measurementUpdate that wrap the grayscale buffer in a
cv::Mat (no copy) and forward to the existing cv::InputArray methods. This
moves the cv::Mat wrapping out of the Objective-C bridge and lets non-C++
callers (Obj-C/Swift) localize without touching opencv types. The
cv::InputArray methods are kept for internal callers (lar_localize,
colmap_refiner).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kobejean
kobejean merged commit fcdce5c into main Jun 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant