According to this: https://github.com/austinhappel/webcam-processingjs/blob/master/js/webcam-processing.js , you need to call the webcam's method, e.g.:
ctx.drawImage(myImg, imageOffset, 0, height / width * nb, nb);
from there on you can manipulate the pixels on the canvas manually
p.loadPixels();
imgPixelData = p.pixels.toArray();
They provide a WEBCAM class here that calls getUserMedia: https://github.com/austinhappel/webcam-processingjs/blob/master/js/webcam.js
Key lines are here:
if (navigator.getUserMedia) {
navigator.getUserMedia({video: true}, function (stream) {
self.video.src = stream;
self.localMediaStream = stream;
}, onWebcamFail);
} else if (navigator.webkitGetUserMedia) {
navigator.webkitGetUserMedia({video: true}, function (stream) {
self.video.src = window.webkitURL.createObjectURL(stream);
self.localMediaStream = stream;
}, onWebcamFail);
Good luck! I've only done this in Java, so let us know if you get javascript and the webcam to play nice. I presume you need the newest build of chrome for any of this to work.