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

canvas inputs #9

Open
forresto opened this issue Feb 21, 2013 · 2 comments
Open

canvas inputs #9

forresto opened this issue Feb 21, 2013 · 2 comments

Comments

@forresto
Copy link

My project has a camera module already, so I wanted to us that canvas instead of the video. To headtrackr.js I added:

this.customStart = function(canvas, context) {
    canvasElement = canvas;
    canvasContext = context;

    // create ui if needed
    if (params.ui) {
        ui = new headtrackr.Ui();
    }

    // create smoother if enabled
    smoother = new headtrackr.Smoother(0.35, params.detectionInterval+15);

    this.initialized = true;
    run = false;

}
this.customTrack = function(canvas){
    videoElement = canvas;
    track();
}

and in my app:

// on receive canvas from other module
this._htracker.customTrack(canvas);

I also made some hacks around not sending an image before getting a response for the previous one. It could be useful to have a less-hacky way of bypassing the built-in getUserMedia handling.

Here is my demo: http://meemoo.org/iframework/#gist/5005786
Vid: http://vine.co/v/b6PntIHlaj6

@auduno
Copy link
Owner

auduno commented Feb 24, 2013

Yes, I think it makes sense to add support for providing just a canvas as input. I'll look at adding it.

Meemoo looks very cool, by the way!

@forresto
Copy link
Author

Thanks! And thanks for the great library... I knew that it was just a matter of time before somebody made a good one. Meemoo is all about tying these libraries together for quick experimentation and prototyping.

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