Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capture image from camera into form or html5 canvas

I need to capture an image from a webcam (tethered camera, etc.) into a form or html5 canvas so that I can save the image to the server. Also, I would like to be able to preview the image live in the page.

For example, I have a browser running at a registration check in station. I would like to take a picture of the attendee currently standing in front of the table, and submit that image into the database. Then I can use that image to print the attendee's badge with their picture on it.

I'm using rails and paperclip, though I doubt that matters.

Anyone done this before, or have some ideas how to do it?

like image 522
Karl Avatar asked Sep 23 '10 20:09

Karl


1 Answers

There is a plugin for jQuery entitled 'jQuery Webcam Plugin' that provides a friendly and easy way to interact with a webcam. It actually relies on a small flash component (unfortunately), but it does a great job of making the interaction easy - as well as providing functionality to copy imagery direct into an HTML5 canvas.

Again, it's unfortunate that it relies on Flash, but I think any reliable solution is going to need flash at this point in time.

The plugin is available here: http://www.xarg.org/project/jquery-webcam-plugin/

like image 100
John Wordsworth Avatar answered Sep 19 '22 14:09

John Wordsworth