Releases: keyqcloud/SwiftAprilTag
v1.3.1 — End-to-end coverage for all tag families
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
Added
Documentation:
- DocC catalog with a module landing page and three topic articles:
- Getting Started — installation, detector setup, the four detect() entry points
- Pose Estimation — deep-dive on intrinsics, TagPose, simd accessors
- Tag Size Convention — outer-black-border vs full-tag pitfall (read before printing tags)
.spi.ymlenables hosted DocC on Swift Package Index. Once SPI re-indexes, docs will be live at https://swiftpackageindex.com/keyqcloud/SwiftAprilTag/documentation
Examples:
Examples/CLI/— self-contained executable Swift package.swift run DetectAprilTag image.png --tag-size 0.1decodes any image and prints detections + poseExamples/iOS-Live/— minimal SwiftUI iOS app: live-camera detection, real-time corner overlay onAVCaptureVideoPreviewLayer, 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
Added
Apple-platform ergonomic conveniences saving callers from common conversion boilerplate. All gated behind canImport() so Linux continues to build.
Detector.detect(cgImage:)— renders anyCGImageto 8-bit grayscale internally, then runs detection. CoreGraphics-only.Detector.detect(uiImage:)— unwraps theUIImage'scgImageand forwards. iOS / tvOS / Mac Catalyst.Detection.cgPath— closedCGPathof the detected corner polygon, ready to assign toCAShapeLayer.pathor wrap withPath(cgPath)in SwiftUI overlays.CameraIntrinsics(avCalibrationData:imageSize:)— convenience initializer from AVFoundation'sAVCameraCalibrationData, with automatic rescaling betweenintrinsicMatrixReferenceDimensionsand 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
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
TagPoseforsimd_float3x3rotation,simd_float3translation, and a combinedsimd_float4x4transform - Cross-platform: rotation/translation stored as plain
[Float]row-major arrays; simd accessors gated behindcanImport(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
Added
- Integration test that loads a real
tag36h11_id0fixture 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 upstreamAprilRobotics/apriltag-imgs10×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
Fixed
- Removed
import CoreGraphicsfrom public source files. CoreGraphics is Apple-only;CGPointandCGSizeare available on Linux directly via Foundation. SwiftAprilTag now builds cleanly on Linux too. - Dropped synthesized
Hashableconformance fromDetection(it was not reliably available across platforms).EquatableandSendableare retained.
Added
- GitHub Actions CI running
swift build+swift teston 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.mdfollowing Keep-a-Changelog conventions.- GitHub repository topics for discoverability.
Full changelog: https://github.com/keyqcloud/SwiftAprilTag/blob/main/CHANGELOG.md