Skip to content

Commit 8758933

Browse files
kalwaltclaude
andcommitted
docs(#51): rewrite README + bump version to 0.8.0
README: replace the stub with a developer-oriented map — the two lineages (WebARKit/ = ArtoolkitX-OCVT-derived active code vs vendored lib/SRC + include/AR = old ARToolKit5, built by jsartoolkitNFT; ARnft consumes jsartoolkitNFT as an npm module), code layout, pose pipeline, who-builds-what (webarkit-testing builds WebARKit/ to WASM via makem.js, CMake migration planned), the gtest/CMake tests, and the contribution path. version: 0.8.0 (was 1.0.0) -- 1.0.0 should denote a complete/LTS release, which this isn't yet. Updates WEBARKIT_HEADER_VERSION_STRING + MAJOR/MINOR. Refs #51. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e6f87fa commit 8758933

2 files changed

Lines changed: 82 additions & 10 deletions

File tree

README.md

Lines changed: 79 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,87 @@
1-
21
![github releases](https://flat.badgen.net/github/release/webarkit/WebARKitLib)
32
![github stars](https://flat.badgen.net/github/stars/webarkit/WebARKitLib)
43
![github forks](https://flat.badgen.net/github/forks/webarkit/WebARKitLib)[![Test](https://github.com/webarkit/WebARKitLib/actions/workflows/test.yml/badge.svg)](https://github.com/webarkit/WebARKitLib/actions/workflows/test.yml)
4+
55
# WebARKitLib
66

7-
The C/C++ source code of WebARKit, from Artoolkit5 and extended.
7+
The C/C++ source of **WebARKit** — a browser-side Augmented Reality tracker. The
8+
active code (`WebARKit/`) is an emscripten-friendly port of the **OCVT** planar
9+
image-tracking design from [ArtoolkitX](https://github.com/artoolkitx/artoolkitx),
10+
built on OpenCV. It is normally compiled to WebAssembly and consumed from the
11+
[webarkit-testing](https://github.com/webarkit/webarkit-testing) superproject.
12+
13+
> **Two lineages live here, keep them straight:**
14+
> - **`WebARKit/`** — the WebAR OCVT planar tracker (the design reference is *ArtoolkitX*). This is the code under active development.
15+
> - **`lib/SRC/**`, `include/AR/**`** — vendored **old ARToolKit5** utility sources/headers, kept only because [jsartoolkitNFT](https://github.com/webarkit/jsartoolkitNFT) needs them (and [ARnft](https://github.com/webarkit/ARnft) in turn consumes jsartoolkitNFT as an npm module). Treated as untouched upstream. (Updated to Eigen 3.4.0 / emsdk 3.1.26.)
16+
17+
## Code layout (`WebARKit/`)
18+
19+
| Component | Role |
20+
|---|---|
21+
| `WebARKitManager` | top-level façade — owns the tracker, drives init/process, exposes the output (homography, pose, GL-view, projection) |
22+
| `WebARKitTrackers/WebARKitOpticalTracking/WebARKitTracker` | the OCVT tracker core: feature detect/match → homography → optical-flow + template-match tracking |
23+
| `…/TrackingPointSelector` + `…/TrackedPoint` | bin-based selection of template tracking points (ArtoolkitX-derived) |
24+
| `…/WebARKitHomographyInfo` + `WebARKitUtils.h` | RANSAC homography estimation/validation (`getHomographyInliers`) |
25+
| `…/WebARKitConfig` | tuning constants (feature counts, match ratios, pyramid/template sizes, version) |
26+
| `…/TrackerVisualization` | optional debug-overlay scaffolding (inert until wired) |
27+
| `WebARKitCamera` | camera intrinsics from a diagonal-FOV estimate |
28+
| `WebARKitGL` | CV→GL matrix conversion (`arglCameraViewRHf`) + GL projection |
29+
| `WebARKitPattern` | the reference marker (`WebARKitPattern`) and per-frame pose state (`WebARKitPatternTrackingInfo`) |
30+
| `WebARKitLog` | logging |
31+
32+
## Pose pipeline (one glance)
33+
34+
```
35+
solvePnP (cameraPoseFromPoints) // OpenCV-convention camera pose
36+
-> getTrackablePose / updateTrackable // CV->GL handedness fix, D*R*D (see #42)
37+
-> arglCameraViewRHf // right-handed GL modelview
38+
-> matrixGL_RH // what the examples attach content to
39+
```
40+
41+
Pose getters: **`getPoseMatrixCV()`** (raw 4×4 OpenCV pose) and **`getPoseMatrixGL()`**
42+
(the GL/right-handed pose); projection via `getCameraProjectionMatrix()`. The full
43+
derivation is in
44+
[`docs/design-projection-and-pose-artoolkitx-alignment.md`](https://github.com/webarkit/webarkit-testing/blob/dev/docs/design-projection-and-pose-artoolkitx-alignment.md)
45+
(webarkit-testing).
46+
47+
## Building
48+
49+
This repo isn't built as a single unit — each consumer compiles the **subset it
50+
needs**:
51+
52+
- **`WebARKit/` (the OCVT tracker)** is built by the
53+
[webarkit-testing](https://github.com/webarkit/webarkit-testing) superproject, which
54+
compiles it to WebAssembly with emscripten (emsdk **3.1.26**) inside Docker and wires
55+
it to JS through `emscripten/WebARKitJS.{cpp,h}` + `bindings.cpp` (which live in
56+
webarkit-testing). webarkit-testing currently drives that compile with the Node script
57+
`tools/makem.js` (`npm run build-docker``build-es6`); migrating to the CMake config
58+
(`WebARKit/CMakeLists.txt`) is planned.
59+
- **The vendored `lib/SRC/**` + `include/AR/**` (old ARToolKit5)** is built by
60+
[jsartoolkitNFT](https://github.com/webarkit/jsartoolkitNFT) as part of its build —
61+
not by webarkit-testing. ([ARnft](https://github.com/webarkit/ARnft) consumes
62+
jsartoolkitNFT as an npm module and doesn't build the emscripten code itself.)
63+
64+
A standalone CMake config also exists for the unit tests (see below).
65+
66+
## Tests
67+
68+
C++ unit tests (GoogleTest) live in [`tests/`](tests/) (`webarkit_test.cc`,
69+
`CMakeLists.txt`, `pinball.jpg`) and run in CI via
70+
[`.github/workflows/test.yml`](https://github.com/webarkit/WebARKitLib/actions/workflows/test.yml).
71+
Build them standalone with CMake:
72+
73+
```bash
74+
cmake -S tests -B tests/build && cmake --build tests/build && ctest --test-dir tests/build
75+
```
76+
77+
## Contributing
878

9-
Updated to [Eigen](https://eigen.tuxfamily.org) 3.4.0 and Emscripten emsdk 3.1.26.
79+
- Branch from `dev`; PR back to `dev`; sign your commits and reference the issue.
80+
- Library changes are usually paired with a build/bump in webarkit-testing — see that
81+
repo's "cross-repo PR pair" flow.
82+
- Don't modify the vendored `lib/SRC/**` / `include/AR/**` (old ARToolKit5) as part of
83+
WebAR work.
1084

11-
## Features
85+
## License
1286

13-
The library containes the following features:
14-
**Artoolkit5** C/C++ code used by [jsartoolkitNFT](https://github.com/webarkit/jsartoolkitNFT) and [ARnft](https://github.com/webarkit/ARnft) (see lib and include folders). Note that is not the full Artoolkit5 library, but only the code needed by jsartoolkitNFT and ARnft. The code is updated to Eigen 3.4.0 and can be compiled with Emscripten emsdk 3.1.26.
15-
**WebARKit** C++ code, which is our experimental code for WebAR. It is completetly independent from Artoolkit5 and can be used as a standalone library. It can be compiled with Emscripten emsdk 3.1.26.
87+
LGPL-3.0 (see `LICENSE.txt`).

WebARKit/WebARKitTrackers/WebARKitOpticalTracking/WebARKitConfig.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ extern const cv::Size blurSize(3, 3);
2121
extern const double ransac_thresh = 2.5f;
2222
extern cv::RNG rng( 0xFFFFFFFF );
2323
extern const double m_pi = 3.14159265358979323846;
24-
extern const std::string WEBARKIT_HEADER_VERSION_STRING = "1.0.0";
24+
extern const std::string WEBARKIT_HEADER_VERSION_STRING = "0.8.0";
2525
/*@
2626
The MAJOR version number defines non-backwards compatible
2727
changes in the ARToolKit API. Range: [0-99].
2828
*/
29-
extern const int WEBARKIT_HEADER_VERSION_MAJOR = 1;
29+
extern const int WEBARKIT_HEADER_VERSION_MAJOR = 0;
3030

3131
/*@
3232
The MINOR version number defines additions to the ARToolKit
3333
API, or (occsasionally) other significant backwards-compatible
3434
changes in runtime functionality. Range: [0-99].
3535
*/
36-
extern const int WEBARKIT_HEADER_VERSION_MINOR = 0;
36+
extern const int WEBARKIT_HEADER_VERSION_MINOR = 8;
3737

3838
/*@
3939
The TINY version number defines bug-fixes to existing

0 commit comments

Comments
 (0)