Tastenkunst / brfv4_javascript_examples

BRFv4 - HTML5/Javascript - examples project. Reference implementation for all other platform example packages.
463 stars 148 forks source link

How can I rotate the camera to portrait? #7

Closed david43 closed 7 years ago

david43 commented 7 years ago

Hi, How can I rotate the camera to portrait for FaceDetection? Is it rotate the imageData?

        imageData.update = function() {
            var _imageDataCtx = imageDataCanvas.getContext("2d");
            _imageDataCtx.setTransform(1.0, 0, 0, 1, resolution.width, 0); // mirrored
            _imageDataCtx.rotate(90*Math.PI/180);

            _imageDataCtx.drawImage(webcamVideo, 0, 0, resolution.height, resolution.width);
        };

It seems not working perfectly.