@srsergio/taptapp-ar 1.0.52 → 1.0.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -5
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -136,8 +136,73 @@ ar.stop();
|
|
|
136
136
|
|
|
137
137
|
---
|
|
138
138
|
|
|
139
|
-
###
|
|
140
|
-
|
|
139
|
+
### 2. Raw Controller (Advanced & Custom Engines)
|
|
140
|
+
The `Controller` is the core engine of TapTapp AR. You can use it to build your own AR components or integrate tracking into custom 3D engines.
|
|
141
|
+
|
|
142
|
+
#### ⚙️ Controller Configuration
|
|
143
|
+
| Property | Default | Description |
|
|
144
|
+
| :--- | :--- | :--- |
|
|
145
|
+
| `inputWidth` | **Required** | The width of the video or image source. |
|
|
146
|
+
| `inputHeight` | **Required** | The height of the video or image source. |
|
|
147
|
+
| `maxTrack` | `1` | Max number of images to track simultaneously. |
|
|
148
|
+
| `warmupTolerance` | `5` | Frames of consistent detection needed to "lock" a target. |
|
|
149
|
+
| `missTolerance` | `5` | Frames of missed detection before considering the target "lost". |
|
|
150
|
+
| `filterMinCF` | `0.001` | Min cutoff frequency for the OneEuroFilter (reduces jitter). |
|
|
151
|
+
| `filterBeta` | `1000` | Filter beta parameter (higher = more responsive, lower = smoother). |
|
|
152
|
+
| `onUpdate` | `null` | Callback for tracking events (Found, Lost, ProcessDone). |
|
|
153
|
+
| `debugMode` | `false` | If true, returns extra debug data (cropped images, feature points). |
|
|
154
|
+
| `worker` | `null` | Pass a custom worker instance if using a specialized environment. |
|
|
155
|
+
|
|
156
|
+
#### 🚀 Example: Tracking a Video Stream
|
|
157
|
+
Ideal for real-time AR apps in the browser:
|
|
158
|
+
|
|
159
|
+
```javascript
|
|
160
|
+
import { Controller } from '@srsergio/taptapp-ar';
|
|
161
|
+
|
|
162
|
+
const controller = new Controller({
|
|
163
|
+
inputWidth: video.videoWidth,
|
|
164
|
+
inputHeight: video.videoHeight,
|
|
165
|
+
onUpdate: (data) => {
|
|
166
|
+
if (data.type === 'updateMatrix') {
|
|
167
|
+
const { targetIndex, worldMatrix } = data;
|
|
168
|
+
if (worldMatrix) {
|
|
169
|
+
console.log(`Target ${targetIndex} detected! Matrix:`, worldMatrix);
|
|
170
|
+
// Apply worldMatrix (Float32Array[16]) to your 3D object
|
|
171
|
+
} else {
|
|
172
|
+
console.log(`Target ${targetIndex} lost.`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
// Single target
|
|
179
|
+
await controller.addImageTargets('./targets.taar');
|
|
180
|
+
|
|
181
|
+
// OR multiple targets from different .taar files
|
|
182
|
+
await controller.addImageTargets(['./target1.taar', './target2.taar', './target3.taar']);
|
|
183
|
+
controller.processVideo(videoElement); // Starts the internal RAF loop
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
#### 📸 Example: One-shot Image Matching
|
|
187
|
+
Use this for "Snap and Detect" features without a continuous video loop:
|
|
188
|
+
|
|
189
|
+
```javascript
|
|
190
|
+
const controller = new Controller({ inputWidth: 1024, inputHeight: 1024 });
|
|
191
|
+
await controller.addImageTargets('./targets.taar');
|
|
192
|
+
|
|
193
|
+
// 1. Detect features in a static image
|
|
194
|
+
const { featurePoints } = await controller.detect(canvasElement);
|
|
195
|
+
|
|
196
|
+
// 2. Attempt to match against a specific target index
|
|
197
|
+
const { targetIndex, modelViewTransform } = await controller.match(featurePoints, 0);
|
|
198
|
+
|
|
199
|
+
if (targetIndex !== -1) {
|
|
200
|
+
// Found a match! Use modelViewTransform for initial pose estimation
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### 📚 Legacy Usage
|
|
205
|
+
For **A-Frame** or **Three.js** wrappers, please refer to the [Advanced Usage Documentation](./docs/advanced-usage.md).
|
|
141
206
|
|
|
142
207
|
---
|
|
143
208
|
|
|
@@ -151,8 +216,15 @@ TapTapp AR uses a proprietary **Moonshot Vision Codec** that is significantly mo
|
|
|
151
216
|
|
|
152
217
|
---
|
|
153
218
|
|
|
154
|
-
## 📄 License &
|
|
219
|
+
## 📄 License & Recognition
|
|
220
|
+
|
|
221
|
+
**Taptapp AR** is created and maintained by **Sergio Lazaro**.
|
|
222
|
+
|
|
223
|
+
This project is licensed under the **GPL-3.0 License**.
|
|
224
|
+
This ensures that the project remains open and free, and that authorship is properly recognized. No "closed-source" usage is allowed without a commercial agreement.
|
|
225
|
+
|
|
226
|
+
Commercial licenses are available for proprietary applications. Please contact the author for details.
|
|
155
227
|
|
|
156
|
-
|
|
228
|
+
### Acknowledgements
|
|
229
|
+
This project evolved from the incredible work of [MindAR](https://github.com/hiukim/mind-ar-js). While the codebase has been extensively rewritten and optimized for performance, we gratefully acknowledge the foundation laid by the original authors.
|
|
157
230
|
|
|
158
|
-
Based on the core research of MindAR, but completely re-written for high-performance binary processing and JS-only execution.
|
package/package.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@srsergio/taptapp-ar",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.54",
|
|
4
|
+
"author": "Sergio Lazaro <srsergiolazaro@gmail.com>",
|
|
5
|
+
"license": "GPL-3.0",
|
|
4
6
|
"description": "Ultra-fast, lightweight Augmented Reality Image Tracking SDK for the web. Features an optimized offline compiler, React components, and compatibility with Three.js/A-Frame. No heavy ML frameworks required.",
|
|
5
7
|
"keywords": [
|
|
6
8
|
"web-ar",
|