how to increase webcam fps in processing with opencv library?? pls give me answer

import gab.opencv.*;

import processing.video.*;

import java.awt.*;

PImage trailsImg;

int hCycle;

Capture video;

OpenCV opencv;

PImage cam;

PImage fc;

int scale=1;

//final float obesaLowerLimit=1.0;
//final float obesaUpperLimit=2.0; //float obesaPar; //float orate;

//final int timeRange=120; // 120 seconds or 2 min.

void setup() {

size(1280, 720);

video = new Capture(this, 1280, 720);

opencv = new OpenCV(this, 1280, 720);

opencv.loadCascade(OpenCV.CASCADE_FRONTALFACE);

video.start();

}

void draw() {

video.read();

println(frameRate);

opencv.loadImage(video);

translate(1280, 0);

pushMatrix();

//scale(-pct, 1);

//image(video, 0, 0);

popMatrix();

scale(-1, 1);

image(video, 0, 0);

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);

int x=faces[i].x;

int y=faces[i].y;

int w=faces[i].width;

int h=faces[i].height;

rect(faces[i].xscale,faces[i].yscale,faces[i].widthscale,faces[i].heightscale); }

}``````````

Tagged:
Sign In or Register to comment.