When using detect, if no recognizable object is within the window, what does a call to open.detect() return? If you know the answer, read no more, I'm just going to detail my thought process.
I have my code set so the x-y of the rectangle are printed. The confusing behavior I'm seeing is that when i duck my head to the side of the screen, the print messages simply stop coming. What is happening here?
detect() is of type Rectangle, no? calling faces[i].isEmpty() returns false when there is a face, but i can't seem to get it to return true. here's a link to the
Java API if that helps.
I expected to find a detect method in the OpenCV.java file, but instead just find this at the very end.
publicnative Rectangle[] detect( float scale, int min_neighbors, int flags, int min_width, int min_height );
public Rectangle[] detect() {
return detect( 1.1f, 3, 0, 0, 0 );
}
Maybe it's somewhere in the OpenCV frameworks files, but I can't track it down. I have little practical programming experience of this sort. What's goin on? Here is the code I'm using to troubleshoot.
import hypermedia.video.*;
import java.awt.Rectangle;
OpenCV opencv;
void setup() {
size( 320, 240 );
opencv = new OpenCV(this);
opencv.capture( width, height );
opencv.cascade( OpenCV.CASCADE_FRONTALFACE_ALT ); // load the FRONTALFACE description file