Ask Your Question

Revision history [back]

Flip Video in openCV

//I am having a problem when using the openCV facial recognition. My webcam is mounted upside down, so I have flipped the video wth the pushMatrix, however the video is still coming in upside down in openCV I believe, therefor it is not recognizing anything. How can I flip "video"?

void draw() {

scale(2);

pushMatrix();
  scale(1,-1);
  translate(0, -video.height);
  image(video, 0, 0); 
popMatrix();

opencv.loadImage(video);

noFill(); stroke(0, 255, 0); strokeWeight(3); Rectangle[] faces = opencv.detect(); println(faces.length);

for (int i = 0; i < faces.length; i++) { println(faces[i].x + "," + faces[i].y); rect(faces[i].x, faces[i].y, faces[i].width, faces[i].height);

click to hide/show revision 2
Formatted code; fixed typos.

Flip Video in openCV

//I I am having a problem when using the openCV OpenCV facial recognition. My webcam is mounted upside down, so I have flipped the video wth the pushMatrix, with pushMatrix, however the video is still coming in upside down in openCV OpenCV I believe, therefor therefore it is not recognizing anything. How can I flip "video"?

void draw() {

scale(2);

{
    scale(2);
    pushMatrix();
   scale(1,-1);
   translate(0, -video.height);
   image(video, 0, 0); 
 popMatrix();
opencv.loadImage(video);

opencv.loadImage(video);

noFill(); stroke(0, 255, 0); strokeWeight(3); Rectangle[] faces = opencv.detect(); println(faces.length);

println(faces.length);

for (int i = 0; i < faces.length; i++) { println(faces[i].x + "," + faces[i].y); rect(faces[i].x, faces[i].y, faces[i].width, faces[i].height);

faces[i].height);