hiukim / mind-ar-js

Web Augmented Reality. Image Tracking, Face Tracking. Tensorflow.js
MIT License
2.22k stars 415 forks source link

Best practices for anchor image to reduce jitter #308

Closed LucusWebsites closed 1 year ago

LucusWebsites commented 1 year ago

First of all thanks a lot for this awesome library!

And I am wondering what are best practices to follow for an anchor image to minize jitter? When I am using the example anchor image (see below) my scene is more steady then when I compile and use my own anchor image.

card-06cb9111a8e32627db6bfafc7aa22a4d
marcusx2 commented 1 year ago

Take a look here. I find this configuration filterMinCF: 0.0001; filterBeta: 0.001; much more stable. However, there are probably other things that can be done here, such as checking for a threshold on the position, scale, and rotation before changing. Because if it's less than the threshold, don't do anything, etc. Or even, using the gyroscope and/or accelerometer to determine if the user is moving his hand, and if it's considered 'still', don't change the transform of the image, etc. A lot of things that in theory could make the tracking better. I couldn't achieve anything much better except when changing the filter settings though.