Skip to content

Commit a3e19c3

Browse files
committed
tested a different conditional
1 parent 6f46ad1 commit a3e19c3

File tree

5 files changed

+2036
-2029
lines changed

5 files changed

+2036
-2029
lines changed

build/artoolkitNft.debug.js

Lines changed: 2008 additions & 1997 deletions
Large diffs are not rendered by default.

build/artoolkitNft.min.js

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/artoolkitNft_wasm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/artoolkitNft_wasm.wasm

47 Bytes
Binary file not shown.

emscripten/ARToolKitJS.cpp

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct arController {
4646
AR2HandleT* ar2Handle;
4747
THREAD_HANDLE_T *threadHandle = NULL;
4848
int detectedPage = -2; // -2 Tracking not inited, -1 tracking inited OK, >= 0 tracking online on page.
49-
49+
// Markers.
5050
int surfaceSetCount = 0; // Running NFT marker id
5151
std::unordered_map<int, AR2SurfaceSetT*> surfaceSets;
5252
AR2SurfaceSetT *surfaceSet[PAGES_MAX];
@@ -64,7 +64,10 @@ struct arController {
6464

6565
std::unordered_map<int, arController> arControllers;
6666
std::unordered_map<int, ARParam> cameraParams;
67-
67+
// ARMarker private: to verify
68+
//static ARFilterTransMatInfo *ftmi;
69+
//static ARdouble filterCutoffFrequency;
70+
//static ARdouble filterSampleRate;
6871

6972
// ============================================================================
7073
// Global variables
@@ -95,21 +98,27 @@ extern "C" {
9598
return MARKER_INDEX_OUT_OF_BOUNDS;
9699
}
97100

98-
KpmResult *kpmResult = NULL;
99-
int kpmResultNum = -1;
101+
//KpmResult *kpmResult = NULL;
102+
//int kpmResultNum = -1;
100103
int pageNo;
101104
int i, j, k;
102105
int flag = -1;
103106
float err = -1;
104107
float trans[3][4];
105-
float trackingTrans[3][4] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
108+
float trackingTrans[3][4];
109+
// filetring to verify
110+
//filterCutoffFrequency = AR_FILTER_TRANS_MAT_CUTOFF_FREQ_DEFAULT;
111+
//filterSampleRate = AR_FILTER_TRANS_MAT_SAMPLE_RATE_DEFAULT;
112+
//ftmi = arFilterTransMatInit(filterSampleRate, filterCutoffFrequency);
106113
if (arc->threadHandle) {
107114
int ret;
108115
if( arc->detectedPage == -1 ) {
116+
//ARLOGi("arc->detectedPage: %d \n", arc->detectedPage);
109117
ret = trackingInitGetResult( arc->threadHandle, trackingTrans, &pageNo);
110118
if( ret == 1 ) {
119+
ARLOGi("page detected ret: %d \n", ret);
111120
if (pageNo >= 0 && pageNo < arc->surfaceSetCount) {
112-
ARLOGd("Detected page %d.\n", pageNo);
121+
ARLOGi("Detected page %d.\n", pageNo);
113122
arc->detectedPage = pageNo;
114123
ar2SetInitTrans(arc->surfaceSet[pageNo], trackingTrans);
115124
} else {
@@ -134,26 +143,13 @@ extern "C" {
134143
arc->detectedPage = -2;
135144
}
136145

137-
for( i = 0; i < kpmResultNum; i++ ) {
138-
//if (kpmResult[i].pageNo == markerIndex && kpmResult[i].camPoseF == 0 ) {
139-
if (pageNo == markerIndex ) {
140-
// if( flag == -1 || err > kpmResult[i].error ) { // Take the first or best result.
141-
if( flag == -1 ) { // Take the first or best result.
142-
flag = i;
143-
err = kpmResult[i].error;
144-
ARLOGe("error in the tracking: %d \n", err);
145-
}
146-
}
147-
}
148-
149-
//ARLOGi("flag is: %d\n", arc->detectedPage);
150-
if (pageNo >= 0 && pageNo == arc->detectedPage) {
146+
//if (pageNo >= 0 && pageNo == arc->detectedPage) {
147+
if (arc->detectedPage > -1) {
151148
for (j = 0; j < 3; j++) {
152149
for (k = 0; k < 4; k++) {
153150
trans[j][k] = trackingTrans[j][k];
154151
}
155152
}
156-
157153
EM_ASM_({
158154
var $a = arguments;
159155
var i = 0;

0 commit comments

Comments
 (0)