@@ -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
6565std::unordered_map<int , arController> arControllers;
6666std::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