Skip to content

Instantly share code, notes, and snippets.

@acamilo
Forked from madhephaestus/camera.groovy
Last active August 29, 2015 14:19
Show Gist options
  • Save acamilo/3c207094062f94674a00 to your computer and use it in GitHub Desktop.
Save acamilo/3c207094062f94674a00 to your computer and use it in GitHub Desktop.
// Starting with the connected camera from BowlerStudio
println(cameraCHDK)
//Create the default detector using "haarcascade_frontalface_default.xml"
IObjectDetector detector = new HaarDetector("haarcascade_smile.xml")
// Create the input and display images. The display is where the detector writes its detections overlay on the input image
Mat inputImage = new Mat()
Mat displayImage = new Mat()
// Loop checking the camera for faces
while(true){
cameraCHDK.getLatestImage(inputImage,displayImage); // capture image
KeyPoint[] data = detector.getObjects(inputImage, displayImage);
System.out.println("Got: "+data.length);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment