Quantcast
Channel: Kinect - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 530

Flip Webcam opencv

$
0
0

Hi, as you can see from the code I was able to reverse the webcam, but how do I make the opencv with the webcam flipped? I would like to do face detection on the flip webcam

`import processing.video.*; import gab.opencv.*; import java.awt.Rectangle;

Capture cam; OpenCV opencv;

void setup() { size(640, 480);

cam = new Capture(this, width, height, 30); opencv = new OpenCV(this, width, height); opencv.loadCascade(OpenCV.CASCADE_FRONTALFACE);
cam.start(); }

void draw() { if (cam.available() == true) { cam.read(); }

pushMatrix(); scale(-1, 1); translate(-cam.width, 0); image(cam, 0, 0); popMatrix();

opencv.loadImage(cam); Rectangle[] faces = opencv.detect();

noFill(); stroke(0, 255, 0); strokeWeight(3); for (int i = 0; i < faces.length; i++) { rect(faces[i].x, faces[i].y, faces[i].width, faces[i].height); } }`


Viewing all articles
Browse latest Browse all 530

Trending Articles