Flip Video in openCV [closed]
I am having a problem when using the OpenCV facial recognition. My webcam is mounted upside down, so I have flipped the video with pushMatrix
, however the video is still coming in upside down in OpenCV I believe, therefore 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);
is that processing or something similar ?
OpenCV has a working function for that called flip. But just like berad I have no idea if this will help you, since you are using no standard OpenCV interface as it seems.
Thank you, I figured it out. Yes, I am sing processing. It just required that I use flip(0);
What is sing processing? Sounds interesting...
@thdrksdfthmn he forgot to type an extra 'u' so the actual name of the language is 'Processing'. More info on the package can be found here. It wraps OpenCV functionality for their purpose.
Could you please tell me what you did to flip the video? I understand the flip function requires and input and output array but I am unable to give the VideoCapture array as an input to this function. Could you tell me how to go about this? Thank you.
@SVijayan, please do not post answer here, if you have a question or comment, thank you !