Skip to content

Releases: keyqcloud/SwiftAprilTag

v1.3.1 — End-to-end coverage for all tag families

09 May 17:56

Choose a tag to compare

Added

End-to-end integration test now verifies all 8 tag families that ship pre-rendered upstream — every `TagFamily` case except `tag36h10` (which has no rendering in `AprilRobotics/apriltag-imgs`).

Each test loads a bundled id-0 fixture PNG, runs detection with only that family enabled, and asserts the wrapper decodes id 0 with hamming 0 and a high decision margin. Catches any future regression that breaks family-specific dispatch without breaking tag36h11.

Fixtures are nearest-neighbor 20× upscales of the native upstream PNGs. ~3.6KB total. CI impact ~25ms.

Full changelog: https://github.com/keyqcloud/SwiftAprilTag/blob/main/CHANGELOG.md

v1.3.0 — DocC + Examples

09 May 17:16

Choose a tag to compare

Added

Documentation:

Examples:

  • Examples/CLI/ — self-contained executable Swift package. swift run DetectAprilTag image.png --tag-size 0.1 decodes any image and prints detections + pose
  • Examples/iOS-Live/ — minimal SwiftUI iOS app: live-camera detection, real-time corner overlay on AVCaptureVideoPreviewLayer, per-frame 6-DOF pose readout. Source-files-only with thorough setup README

Full changelog: https://github.com/keyqcloud/SwiftAprilTag/blob/main/CHANGELOG.md

v1.2.0 — Apple-platform conveniences

09 May 17:07

Choose a tag to compare

Added

Apple-platform ergonomic conveniences saving callers from common conversion boilerplate. All gated behind canImport() so Linux continues to build.

  • Detector.detect(cgImage:) — renders any CGImage to 8-bit grayscale internally, then runs detection. CoreGraphics-only.
  • Detector.detect(uiImage:) — unwraps the UIImage's cgImage and forwards. iOS / tvOS / Mac Catalyst.
  • Detection.cgPath — closed CGPath of the detected corner polygon, ready to assign to CAShapeLayer.path or wrap with Path(cgPath) in SwiftUI overlays.
  • CameraIntrinsics(avCalibrationData:imageSize:) — convenience initializer from AVFoundation's AVCameraCalibrationData, with automatic rescaling between intrinsicMatrixReferenceDimensions and the actual image size you used for detection.
let detector = try Detector(families: [.tag36h11])
let detections = try detector.detect(uiImage: someUIImage)

if let detection = detections.first {
    let shape = CAShapeLayer()
    shape.path = detection.cgPath
}

Full changelog: https://github.com/keyqcloud/SwiftAprilTag/blob/main/CHANGELOG.md

v1.1.0 — Pose estimation

09 May 17:00

Choose a tag to compare

Added

6-DOF pose estimation. Given a detection plus camera intrinsics and the tag's known physical size, recover the rotation and translation of the tag in the camera's coordinate frame.

let intrinsics = CameraIntrinsics(fx: 800, fy: 800, cx: 320, cy: 240)
if let pose = detection.estimatePose(intrinsics: intrinsics, tagSize: 0.1) {
    let transform: simd_float4x4 = pose.transform  // Apple platforms
    // ...feed straight into SceneKit / RealityKit / Metal
}
  • New public types: CameraIntrinsics, TagPose
  • New method: Detection.estimatePose(intrinsics:tagSize:) -> TagPose?
  • New field: Detection.homography — the 3x3 homography matrix used for pose estimation, also exposed for users who want their own perspective warps or homography decomposition
  • Apple-only convenience accessors on TagPose for simd_float3x3 rotation, simd_float3 translation, and a combined simd_float4x4 transform
  • Cross-platform: rotation/translation stored as plain [Float] row-major arrays; simd accessors gated behind canImport(simd)

Integration test recovers the pose of the bundled fixture image against synthetic intrinsics, asserting translation within 5mm of expected, rotation near identity, and small reprojection error.

Full changelog: https://github.com/keyqcloud/SwiftAprilTag/blob/main/CHANGELOG.md

v1.0.2 — Integration test against bundled fixture

09 May 16:50

Choose a tag to compare

Added

  • Integration test that loads a real tag36h11_id0 fixture image, runs detection end-to-end, and asserts ID, hamming distance, decision margin, and sub-pixel corner positions. Apple-only (gated behind #if canImport(CoreGraphics) && canImport(ImageIO)) — Linux CI continues to run the unit tests only.
  • Counter-test verifying a flat gray image produces zero detections, guarding against false-positive regressions.
  • Bundled Tests/SwiftAprilTagTests/Fixtures/tag36h11_id0.png (200×200, 516 bytes) as a known-good detection target. Derived from the upstream AprilRobotics/apriltag-imgs 10×10 native rendering by 20× nearest-neighbor upscale.

The integration test also implicitly documents the corner convention pitfall: AprilTag's library returns the outer black border corners, not the white-margin extent. Distributors who label tags by overall image size (e.g. rgov/apriltag-pdfs "100mm") report margin-inclusive dimensions that don't match detection.corners.

Full changelog: https://github.com/keyqcloud/SwiftAprilTag/blob/main/CHANGELOG.md

v1.0.1 — Linux portability + CI

09 May 16:35

Choose a tag to compare

Fixed

  • Removed import CoreGraphics from public source files. CoreGraphics is Apple-only; CGPoint and CGSize are available on Linux directly via Foundation. SwiftAprilTag now builds cleanly on Linux too.
  • Dropped synthesized Hashable conformance from Detection (it was not reliably available across platforms). Equatable and Sendable are retained.

Added

  • GitHub Actions CI running swift build + swift test on macOS 14 and Ubuntu (Swift 5.10) for every push, pull request, and tag.
  • README badges for CI status, Swift version, supported platforms, SPM compatibility, and MIT license.
  • "Why this package?" section in the README explaining motivation and use cases.
  • CHANGELOG.md following Keep-a-Changelog conventions.
  • GitHub repository topics for discoverability.

Full changelog: https://github.com/keyqcloud/SwiftAprilTag/blob/main/CHANGELOG.md