hiukim / mind-ar-js

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

help needed / feature request: smoothing off the target position and rotation to fight off jittering #146

Closed gtnbssn closed 2 years ago

gtnbssn commented 2 years ago

I am trying to smooth things a little as my app is extremely jittery at the moment, using the instructions given here: https://hiukim.github.io/mind-ar-js-doc/quick-start/tracking-config/

Not having much success though, so i am having a look at this: https://stackoverflow.com/questions/53380400/aframe-smoothing-position-and-rotation

If i understand correctly, the idea is that real life objects do not move as fast as we update frames, or more precisely, they don't jump position that fast. And so instead of directly updating the values, it helps to interpolate.

I cannot get this to work with mind ar though. I think i probably should use the targetFound and targetLost events, but not sure where to head apart from this.

Any leads will be appreciated!

gtnbssn commented 2 years ago

Ok my bad, please forgive a beginner in A-Frame!

The example code from stack overflow requires adding the created component in the document like so:

<a-entity listener></a-entity>

I'm going to keep experimenting with this. I'm not sure i got it working yet.

Maybe it could still be useful to implement this kind of smoothing directly.

juanfajardodv commented 2 years ago

@gtnbssn did it worked? I've tried but the position / rotations doesn't look to change.

gtnbssn commented 2 years ago

I have had to focus on other more urgent aspects of my app, so kind of leaving this hanging for now, but i hope to get back to it!

One thing i noticed is that the examples from the docs are pretty smooth and stable, so it could be that my targets just aren't great...

Nikozil commented 2 years ago

Hello my friends. I spent a lot of time on this problem. The following configuration oneEuroFilter worked for me:

<a-scene mindar-image="filterMinCF:0.0001; filterBeta: 0.001"/>

It would be great to set it or a working analogue as the default.

w4nch0 commented 2 years ago

Hello my friends. I spent a lot of time on this problem. The following configuration oneEuroFilter worked for me:

<a-scene mindar-image="filterMinCF:0.0001; filterBeta: 0.001"/>

It would be great to set it or a working analogue as the default.

It works, great! Thanks a lot.

gtnbssn commented 2 years ago

It does work! I'll close the issue, thanks!

rizkydipahiyat commented 1 year ago

<a-scene mindar-image="filterMinCF:0.0001; filterBeta: 0.001"/>

It works, thanks! filterMinCF:0.0001; filterBeta: 0.0001"

seamofreality commented 1 year ago

Yes, I'd say this is a million times better than the jitter I had before. Thanks!

jessicachrist commented 1 year ago

Thanks for this hint!

binhudakhalid commented 1 year ago

Thanks, please make it the default configuration.

philipp-lehmann commented 1 year ago

This also works for threejs (and react)

const mindarThree = new MindARThree({
            container: containerRef.current,
            imageTargetSrc: `/target-01.mind`,
            filterMinCF: 0.0001,
            filterBeta: 0.001,
        });

This made the tracking so much better in my case.

loktarscript commented 1 year ago

Hello my friends. I spent a lot of time on this problem. The following configuration oneEuroFilter worked for me:

<a-scene mindar-image="filterMinCF:0.0001; filterBeta: 0.001"/>

It would be great to set it or a working analogue as the default.

this worked for me, the popup image stops shaking. Arigato

ehsanwwe commented 11 months ago

after the 7 days to read all of the code writen at MindAR project :D i has been add my own filter to reduce shaking , to day i see this topic and set this setting to default MindAR it works better than my Filter , i got my times was totaly wast

git1bhay commented 7 months ago

for glass try on this value not work const mindarThree = new MindARThree({ container: document.querySelector("#container"), filterMinCF:0.0001, filterBeta: 25000, warmupTolerance: 3, missTolerance: 1, }); some delay in mobile between glass and head please help