Calibrate works?
This commit is contained in:
parent
26e34f7671
commit
cc711c6343
1104 changed files with 636510 additions and 75 deletions
38
lib/opencv_processing/examples/LiveCamTest/LiveCamTest.pde
Normal file
38
lib/opencv_processing/examples/LiveCamTest/LiveCamTest.pde
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import gab.opencv.*;
|
||||
import processing.video.*;
|
||||
import java.awt.*;
|
||||
|
||||
Capture video;
|
||||
OpenCV opencv;
|
||||
|
||||
void setup() {
|
||||
size(640, 480);
|
||||
video = new Capture(this, 640/2, 480/2);
|
||||
opencv = new OpenCV(this, 640/2, 480/2);
|
||||
opencv.loadCascade(OpenCV.CASCADE_FRONTALFACE);
|
||||
|
||||
video.start();
|
||||
}
|
||||
|
||||
void draw() {
|
||||
scale(2);
|
||||
opencv.loadImage(video);
|
||||
|
||||
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);
|
||||
rect(faces[i].x, faces[i].y, faces[i].width, faces[i].height);
|
||||
}
|
||||
}
|
||||
|
||||
void captureEvent(Capture c) {
|
||||
c.read();
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue