Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I cannot use the getCurrentPositions() #31

Closed
wffger opened this issue Dec 24, 2014 · 4 comments
Closed

I cannot use the getCurrentPositions() #31

wffger opened this issue Dec 24, 2014 · 4 comments

Comments

@wffger
Copy link

wffger commented Dec 24, 2014

            function getPositions() {
                ctrack.start(document.getElementById('image'));
                var positions = ctrack.getCurrentPositions();
                document.getElementById('cpo').innerHTML = positions;
            }

The third line returns "Uncaught TypeError: undefined is not a function"

@auduno
Copy link
Owner

auduno commented Dec 24, 2014

Hi, you've used the wrong name of the function. The corrected line should be:

var positions = ctrack.getCurrentPosition();

@auduno auduno closed this as completed Dec 24, 2014
@wffger
Copy link
Author

wffger commented Dec 25, 2014

The reference.html is wrong.

@wffger
Copy link
Author

wffger commented Dec 25, 2014

I need to click the button which called the function twice, then I get the right return.

@auduno
Copy link
Owner

auduno commented Dec 25, 2014

Yep, you're right, the reference was wrong. Fixed it now, sorry for that.

The reason why you have to click the button twice to get positions is probably because you start the detection/tracking on the first line of the function. It usually takes some time (a second or two) for the model to fit correctly on the face, so you have to wait a bit longer to get the positions. You can check the fit of the model by using getConvergence() for instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants