Closed kalwalt closed 1 year ago
With https://github.com/kalwalt/webarkit-testing/pull/9/commits/1dcd3e69581c75cb986d49030f36b3da55386274 i finally found a working solution, now the pinball image can be detected, tracked and the blue rect is correctly displayed around the printed image. The iframe instead is positioned inside the rect but it doesn't fit the whole pinball image (i had also this issue in the non Worker version). This new example example_w_worker.html create a new Worker inside index_w_worker.js and not anymore use the class WebARKitWorker. This will be deleted and all associated methods.
Now the example display the iframe correctly, see comments in the PR commits, the flickering issue in detection pahse will be solved in another step.
Detection and tracking in a WebWorker
I will try to move the computing part of the code to a Worker, to improve performances. I found that it's not so obviuous and simple as one may think. I implemented the WebWorker and all the methods necessary to send data to and from it but i have a strange result, it seems that it's not consistently updating (?) or some other reason that i can not found at the moment. Maybe it's not a good idea to implement the Worker in the project, maybe it should be outside? and leave webarkit as a lowlevel engine? Also another issue could be the fact i implemented the processFrameData https://github.com/kalwalt/WebARKitLib/blob/abced5cd4e6d6b4555806b58ff616c434d688a0c/lib/SRC/WebARKitTrackers/WebARKitOpticalTracking/WebARKitAkazeTracker.cpp#L40-L53 in a different manner in rispect of wasm-ar (this method does not exist in it) Maybe i could reproduce the same approach in wasm-ar creating bindings for resetTracking and track methods.
Features to add: