You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ARCHITECTURE.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,12 +36,14 @@ The unified core library containing all AR functionality:
36
36
-`kpm::ref_data_set` — `.fset3` reference data I/O and compression modes.
37
37
-`kpm::types` — KPM data structures and constants.
38
38
-`kpm::freak` — FREAK descriptor math, homography, and matching utilities (pure Rust port of `WebARKitLib/lib/SRC/KPM/FreakMatcher`):
39
+
-`freak::visual_database` — top-level per-frame query orchestrator (M9-1): builds the query keyframe, then runs the two-pass pipeline (feature match → Hough voting → homography → inlier filter, then a homography-guided re-match) across stored reference keyframes. Exposes `query` / `query_from_keyframe` and facade-parity accessors on the database + `FeatureStore` slices (#147, #148).
39
40
-`freak::math` — linear algebra (matrix operations, linear solvers) and Padé matrix exponential.
40
41
-`freak::homography` — homography estimation and refinement pipeline.
41
42
-`freak::hough` — Hough similarity voting (4D bin discretization over translation × angle × scale) for filtering matches by transformation consistency.
42
43
-`freak::clustering` — K-Medoids partitioning + Binary Hierarchical Clustering (BHC) vocabulary tree for fast approximate-NN search on 96-byte FREAK descriptors. Hamming distance via 24×32-bit bit-magic. Includes a byte-identical port of C++ `vision::FastRandom` / `vision::ArrayShuffle` so the BHC tree topology matches the C++ baseline given the same seed.
43
44
-`freak::matcher` — `FeatureStore` (points + flat descriptor buffer) and `FeatureMatcher` with three match variants: brute force, BHC-indexed (fast path), and homography-guided (spatial filter via 3×3 inverse + `tr` radius). All three apply the C++ ratio test (default 0.7) and filter by `FeaturePoint::maxima`.
44
45
-`freak::image_pyramid` — image pyramid construction via `BoxFilterPyramid8u` (box filtering for 8-bit grayscale) and `BinomialPyramid32f` (32-bit floating-point binomial pyramid with scale-space interpolation).
46
+
-`freak::gaussian_pyramid` — Gaussian scale-space pyramid driving the DoG detector. Hot binomial-filter passes have NO-FMA SSE4.1 / AVX2 / wasm SIMD paths (runtime-detected, bit-exact against the scalar fallback for dual-mode parity) and rayon-parallelized rows (v0.8.0, #200–#207).
45
47
-`freak::feature_extraction` — keypoint detection via Difference-of-Gaussians (DoG), dominant orientation assignment via circular gradient voting, and FREAK descriptor computation with native Rust implementation of the FREAK binary pattern and bit-pair comparison.
46
48
-**Types** (`types`): core data structures (`ARHandle`, `ARParam`, etc.).
47
49
@@ -50,6 +52,13 @@ The unified core library containing all AR functionality:
50
52
WASM wrapper and JavaScript/TypeScript glue code for browser targets.
51
53
Depends only on `webarkitlib-rs` (the core crate).
52
54
55
+
Since **v0.8.0 (#161)** it exposes the pure-Rust NFT pipeline to the
56
+
browser: a `WasmKpmHandle` binding for KPM detection (load reference data
57
+
from bytes, detect), `console_log` wiring via `ar_log_init_wasm()`, a dual
58
+
**standard + SIMD** build pipeline (`npm run build:wasm`), and an
59
+
end-to-end browser NFT demo under `crates/wasm/www`. The `cc`/`bindgen`
60
+
build dependencies are optional so the wasm target builds pure-Rust.
61
+
53
62
## Feature Flags
54
63
55
64
| Feature | Description |
@@ -58,6 +67,7 @@ Depends only on `webarkitlib-rs` (the core crate).
58
67
|`simd`| Umbrella: enables all SIMD sub-features |
59
68
|`simd-wasm32`| WASM SIMD128 intrinsics |
60
69
|`simd-x86-sse41`| x86 SSE4.1 intrinsics |
70
+
|`simd-x86-avx2`| x86 AVX2 intrinsics (runtime-detected; NO-FMA for bit-exact scalar parity) |
61
71
|`log-helpers`| Enable logging infrastructure (installs `env_logger` for desktop/tests, `console_log` for WASM) |
62
72
|`ffi-backend`|**Opt-in** — compile the C++ FreakMatcher library and generate FFI bindings. Used for cross-validation and the regression-test suite; not required for production tracking. |
63
73
|`dual-mode`| Enables FFI-based parity tests that validate pure-Rust ports against the live C++ baseline (M6 math/solvers/homography, M7 BHC/matcher, PRNG). Transitively enables `ffi-backend`. Run in CI on Linux/macOS/Windows. |
Copy file name to clipboardExpand all lines: README.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@
14
14
This project aims to provide a pure-Rust implementation of the core ARToolKit algorithms, targeting both **native** systems and **WebAssembly (WASM)** for high-performance augmented reality in the browser.
15
15
16
16
> [!NOTE]
17
-
> This project is currently a **Work in Progress**. Core marker detection and pose estimation are functional. KPM/NFT (Natural Feature Tracking) is in an early stage with partial Rust porting -- a fully idiomatic Rust KPM pipeline with a working example is the primary goal for v1.0.0.
17
+
> Core marker detection and pose estimation are functional, and as of **v0.8.0** the **KPM/NFT (Natural Feature Tracking) pipeline is fully ported to pure Rust** — end-to-end keypoint matching, marker generation (`.iset`/`.fset`/`.fset3`), and runtime tracking all run with **no C++ toolchain**, natively and in the browser via WebAssembly. The project remains a **Work in Progress** toward v1.0.0 (broader API docs, multi-marker support, and a dedicated KPM benchmark are the remaining focus areas).
18
18
19
19
## 🌟 Key Features
20
20
@@ -40,7 +40,7 @@ Add `webarkitlib-rs` to your `Cargo.toml`:
40
40
41
41
```toml
42
42
[dependencies]
43
-
webarkitlib-rs = "0.7"
43
+
webarkitlib-rs = "0.8"
44
44
```
45
45
46
46
### Pure Rust tracking (no C++ compiler required)
@@ -66,7 +66,7 @@ need to do anything special:
66
66
67
67
```toml
68
68
[dependencies]
69
-
webarkitlib-rs = "0.7"# default backend is pure Rust
69
+
webarkitlib-rs = "0.8"# default backend is pure Rust
70
70
```
71
71
72
72
```bash
@@ -83,7 +83,7 @@ NFT tracking**:
83
83
84
84
```toml
85
85
[dependencies]
86
-
webarkitlib-rs = { version = "0.7", features = ["ffi-backend"] }
86
+
webarkitlib-rs = { version = "0.8", features = ["ffi-backend"] }
87
87
```
88
88
89
89
> When installing from crates.io, no extra setup is required — the C++
@@ -248,7 +248,7 @@ Enable the `log-helpers` feature and call the bundled initializer once in your b
248
248
249
249
```toml
250
250
[dependencies]
251
-
webarkitlib-rs = { version = "0.7", features = ["log-helpers"] }
251
+
webarkitlib-rs = { version = "0.8", features = ["log-helpers"] }
252
252
```
253
253
254
254
```rust
@@ -429,12 +429,16 @@ The workspace contains two crates:
429
429
- Cross-platform / cross-stack matcher determinism — Rust `HashMap` → `BTreeMap` and upstream C++ `unordered_map` → `std::map` ([WebARKitLib#39](https://github.com/webarkit/WebARKitLib/pull/39)).
430
430
- Hand-annotated absolute corner-error regression gate (browser-based annotation tool + 5 fixtures + Linux CI gate). Finding: pure-Rust backend is more accurate than C++ on `pinball-demo` (5.27 px vs 18.79 px max corner error).
431
431
- Cross-stack parity gate against `@webarkit/jsartoolkit-nft@1.10.0` ([jsartoolkitNFT#584](https://github.com/webarkit/jsartoolkitNFT/pull/584)) — guarantees native Rust pose matches what production WASM consumers see.
432
+
- **v0.8.0 — Pure-Rust completeness, validation & polish**: Closed out the remaining gaps on top of M9:
433
+
- **Full WASM/NFT support** ([#161](https://github.com/webarkit/WebARKitLib-rs/issues/161)): `WasmKpmHandle` KPM-detection bindings, `console_log` wiring, clean dual (standard + SIMD) wasm builds, and an end-to-end **browser NFT demo** of the pure-Rust pipeline.
434
+
- **Pure-Rust `.fset3` marker generation** ([#179](https://github.com/webarkit/WebARKitLib-rs/issues/179)): `nft_marker_gen` now produces `.iset` + `.fset` + `.fset3` entirely via `RustFreakMatcher` — the `ffi-backend` is no longer needed for marker creation.
435
+
- **`VisualDatabase` ergonomics** ([#147](https://github.com/webarkit/WebARKitLib-rs/issues/147), [#148](https://github.com/webarkit/WebARKitLib-rs/issues/148)): factored the per-frame query loop, added `query_from_keyframe`, and facade-parity accessors on `VisualDatabase` + `FeatureStore` slices.
- **KPM-specific benchmark** ([deferred from #142](https://github.com/webarkit/WebARKitLib-rs/issues/142)): Add a dedicated `kpm_bench.rs` Criterion bench so we can verify the pure-Rust backend stays within 20% of C++ on `pinball-demo`. The existing `marker_bench` only measures barcode marker detection.
435
-
- **WASM browser examples for KPM/NFT** ([#161](https://github.com/webarkit/WebARKitLib-rs/issues/161)): End-to-end runnable browser demo of the pure-Rust NFT pipeline.
436
-
- **Raise M9 patch coverage** ([#177](https://github.com/webarkit/WebARKitLib-rs/issues/177)): Lift M9 modules from 84.76% → ≥90% patch coverage with no file under 85%.
- **Live-camera WASM demo + pose parity** ([#215](https://github.com/webarkit/WebARKitLib-rs/issues/215)): Extend the browser NFT demo with a live camera feed and jsartoolkitNFT pose parity.
438
442
- **Enhanced Documentation**: Expand API reference with complete module-level docs, integration walkthroughs for JS/TS, and detailed usage examples.
439
443
- **WASM Memory Management**: Improve resource cleanup when switching engines or markers in long-running browser sessions.
0 commit comments