Skip to content

Instantly share code, notes, and snippets.

@madhephaestus
Last active February 16, 2020 19:49
Show Gist options
  • Select an option

  • Save madhephaestus/4db9defef935e2905690 to your computer and use it in GitHub Desktop.

Select an option

Save madhephaestus/4db9defef935e2905690 to your computer and use it in GitHub Desktop.

Revisions

  1. Technocopia PC 01 revised this gist May 5, 2017. 1 changed file with 0 additions and 11 deletions.
    11 changes: 0 additions & 11 deletions camera.groovy
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,4 @@
    import java.awt.image.BufferedImage;
    import com.neuronrobotics.imageprovider.Detection;
    import java.util.List;
    import com.neuronrobotics.bowlerstudio.av.ImagesToVideo
    import javax.imageio.ImageIO;
    import com.neuronrobotics.imageprovider.AbstractImageProvider;
    import com.neuronrobotics.imageprovider.OpenCVImageProvider;
    import com.neuronrobotics.imageprovider.StaticFileProvider;
    import com.neuronrobotics.imageprovider.URLImageProvider;
    import javafx.stage.FileChooser;
    import javafx.application.Platform;

    String name = "imageProvider"
    AbstractImageProvider camera0=null;
    if(DeviceManager.getSpecificDevice(AbstractImageProvider.class, name)==null){
  2. madhephaestus revised this gist May 24, 2016. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions camera.groovy
    Original file line number Diff line number Diff line change
    @@ -91,20 +91,21 @@ while(!Thread.interrupted() && i<200){
    //dyio.setValue(0,position)

    }
    /*save images
    try {
    File outputfile = new File(dir+"/saved_"+i+".jpg");
    ImageIO.write(displayImage, "jpg", outputfile);
    inFiles.add(outputfile)
    } catch (IOException e) {
    e.printStackTrace()
    }
    }*/
    i++
    }

    println "Compiling to video"
    /*saved images to video
    //println "Compiling to video"
    File outFile = new File(dir+"/Video.mov")
    ImagesToVideo imageToMovie = new ImagesToVideo();
    imageToMovie.run(640, 480, 30, inFiles,outFile );
    println "Video exported to "+outFile.getAbsolutePath()

    */

  3. madhephaestus revised this gist Apr 19, 2016. 1 changed file with 6 additions and 3 deletions.
    9 changes: 6 additions & 3 deletions camera.groovy
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,9 @@ String name = "imageProvider"
    AbstractImageProvider camera0=null;
    if(DeviceManager.getSpecificDevice(AbstractImageProvider.class, name)==null){
    //BowlerStudio.speak("Connecting to camera 0.");
    //camera0 = new OpenCVImageProvider(0);// grab the first camera
    camera0 = new OpenCVImageProvider(0);// grab the first camera
    DeviceManager.addConnection(camera0,name);
    /**
    //Static File Image provider
    FileChooser fileChooser = new FileChooser();
    fileChooser.setTitle("Open Image File");
    @@ -26,10 +28,10 @@ if(DeviceManager.getSpecificDevice(AbstractImageProvider.class, name)==null){
    }else
    return null;
    })

    */


    /* URL Image Provider Evample
    /** URL Image Provider Evample
    *
    * TextInputDialog dialog = new TextInputDialog("http://neuronrobotics.com/img/AndrewHarrington/2014-09-15-86.jpg");
    dialog.setTitle("URL Image Source");
    @@ -50,6 +52,7 @@ if(DeviceManager.getSpecificDevice(AbstractImageProvider.class, name)==null){
    }
    }
    */


    }else{
    //
  4. madhephaestus revised this gist Apr 19, 2016. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion camera.groovy
    Original file line number Diff line number Diff line change
    @@ -62,8 +62,9 @@ while(DeviceManager.getSpecificDevice(AbstractImageProvider.class, name)==null){

    // Starting with the connected camera from BowlerStudio
    println(camera0)
    File haarCascadeFile = ScriptingEngine.fileFromGit("https://github.com/madhephaestus/DefaultHaarCascade.git", "lbpcascade_frontalface.xml")
    //Create the default detector using "lbpcascade_frontalface.xml"
    IObjectDetector detector = new HaarDetector("lbpcascade_frontalface.xml")
    IObjectDetector detector = new HaarDetector(haarCascadeFile)
    // Create the input and display images. The display is where the detector writes its detections overlay on the input image
    BufferedImage inputImage = AbstractImageProvider.newBufferImage(640,480)
    BufferedImage displayImage = AbstractImageProvider.newBufferImage(640,480)
  5. madhephaestus revised this gist Apr 19, 2016. 1 changed file with 23 additions and 13 deletions.
    36 changes: 23 additions & 13 deletions camera.groovy
    Original file line number Diff line number Diff line change
    @@ -7,21 +7,27 @@ import com.neuronrobotics.imageprovider.AbstractImageProvider;
    import com.neuronrobotics.imageprovider.OpenCVImageProvider;
    import com.neuronrobotics.imageprovider.StaticFileProvider;
    import com.neuronrobotics.imageprovider.URLImageProvider;
    import javafx.stage.FileChooser;
    import javafx.application.Platform;

    String name = "imageProvider"
    AbstractImageProvider camera0=null;
    if(DeviceManager.getSpecificDevice(OpenCVImageProvider.class, "imageProvider")==null){
    BowlerStudio.speak("Connecting to camera 0.");
    camera0 = new OpenCVImageProvider(0);// grab the first camera
    /* Static File Image provider
    if(DeviceManager.getSpecificDevice(AbstractImageProvider.class, name)==null){
    //BowlerStudio.speak("Connecting to camera 0.");
    //camera0 = new OpenCVImageProvider(0);// grab the first camera
    //Static File Image provider
    FileChooser fileChooser = new FileChooser();
    fileChooser.setTitle("Open Image File");
    File f = fileChooser.showOpenDialog(BowlerStudio.getPrimaryStage());
    if(f!=null){
    AbstractImageProvider p = camera0 = new StaticFileProvider(f);
    String name = "imageProvider";
    addConnection(p,name);
    }
    */
    Platform.runLater({
    File f = fileChooser.showOpenDialog(BowlerStudio.getPrimaryStage());
    if(f!=null){
    camera0 = new StaticFileProvider(f);
    DeviceManager.addConnection(camera0,name);
    }else
    return null;
    })



    /* URL Image Provider Evample
    *
    @@ -44,10 +50,14 @@ if(DeviceManager.getSpecificDevice(OpenCVImageProvider.class, "imageProvider")==
    }
    }
    */
    DeviceManager.addConnection(camera0,"imageProvider");

    }else{
    //
    camera0 = (OpenCVImageProvider)DeviceManager.getSpecificDevice(OpenCVImageProvider.class, "imageProvider");
    camera0 = (AbstractImageProvider)DeviceManager.getSpecificDevice(AbstractImageProvider.class, name);
    }

    while(DeviceManager.getSpecificDevice(AbstractImageProvider.class, name)==null){
    ThreadUtil.wait(100)
    }

    // Starting with the connected camera from BowlerStudio
  6. madhephaestus revised this gist Apr 19, 2016. 1 changed file with 42 additions and 6 deletions.
    48 changes: 42 additions & 6 deletions camera.groovy
    Original file line number Diff line number Diff line change
    @@ -3,15 +3,51 @@ import com.neuronrobotics.imageprovider.Detection;
    import java.util.List;
    import com.neuronrobotics.bowlerstudio.av.ImagesToVideo
    import javax.imageio.ImageIO;
    import com.neuronrobotics.imageprovider.AbstractImageProvider;
    import com.neuronrobotics.imageprovider.OpenCVImageProvider;
    import com.neuronrobotics.imageprovider.StaticFileProvider;
    import com.neuronrobotics.imageprovider.URLImageProvider;


    OpenCVImageProvider camera0=null;
    if(DeviceManager.getSpecificDevice(OpenCVImageProvider.class, "camera0")==null){
    BowlerStudio.speak("I did not fine a device called camera0. Connecting to camera 0.");
    AbstractImageProvider camera0=null;
    if(DeviceManager.getSpecificDevice(OpenCVImageProvider.class, "imageProvider")==null){
    BowlerStudio.speak("Connecting to camera 0.");
    camera0 = new OpenCVImageProvider(0);// grab the first camera
    DeviceManager.addConnection(camera0,"camera0");
    /* Static File Image provider
    FileChooser fileChooser = new FileChooser();
    fileChooser.setTitle("Open Image File");
    File f = fileChooser.showOpenDialog(BowlerStudio.getPrimaryStage());
    if(f!=null){
    AbstractImageProvider p = camera0 = new StaticFileProvider(f);
    String name = "imageProvider";
    addConnection(p,name);
    }
    */

    /* URL Image Provider Evample
    *
    * TextInputDialog dialog = new TextInputDialog("http://neuronrobotics.com/img/AndrewHarrington/2014-09-15-86.jpg");
    dialog.setTitle("URL Image Source");
    dialog.setHeaderText("This url will be loaded each capture.");
    dialog.setContentText("URL ");
    // Traditional way to get the response value.
    Optional<String> result = dialog.showAndWait();
    if (result.isPresent()){
    URLImageProvider p;
    try {
    p = new URLImageProvider(new URL(result.get()));
    String name = "url";
    addConnection(p,name);
    } catch (MalformedURLException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
    }
    */
    DeviceManager.addConnection(camera0,"imageProvider");
    }else{
    camera0 = (OpenCVImageProvider)DeviceManager.getSpecificDevice(OpenCVImageProvider.class, "camera0");
    //
    camera0 = (OpenCVImageProvider)DeviceManager.getSpecificDevice(OpenCVImageProvider.class, "imageProvider");
    }

    // Starting with the connected camera from BowlerStudio
  7. madhephaestus revised this gist Feb 6, 2016. 1 changed file with 43 additions and 16 deletions.
    59 changes: 43 additions & 16 deletions camera.groovy
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,17 @@
    import java.awt.image.BufferedImage;
    import com.neuronrobotics.imageprovider.Detection;
    import java.util.List;
    import com.neuronrobotics.bowlerstudio.av.ImagesToVideo
    import javax.imageio.ImageIO;


    OpenCVImageProvider camera0=null;
    if(DeviceManager.getSpecificDevice(OpenCVImageProvider.class, "camera")==null){
    BowlerStudio.speak("I did not fine a device called camera. Connecting to camera 0.");
    if(DeviceManager.getSpecificDevice(OpenCVImageProvider.class, "camera0")==null){
    BowlerStudio.speak("I did not fine a device called camera0. Connecting to camera 0.");
    camera0 = new OpenCVImageProvider(0);// grab the first camera
    DeviceManager.addConnection(camera0,"camera");
    DeviceManager.addConnection(camera0,"camera0");
    }else{
    camera0 = (OpenCVImageProvider)DeviceManager.getSpecificDevice(OpenCVImageProvider.class, "camera");
    camera0 = (OpenCVImageProvider)DeviceManager.getSpecificDevice(OpenCVImageProvider.class, "camera0");
    }

    // Starting with the connected camera from BowlerStudio
    @@ -18,16 +21,40 @@ IObjectDetector detector = new HaarDetector("lbpcascade_frontalface.xml")
    // Create the input and display images. The display is where the detector writes its detections overlay on the input image
    BufferedImage inputImage = AbstractImageProvider.newBufferImage(640,480)
    BufferedImage displayImage = AbstractImageProvider.newBufferImage(640,480)
    ArrayList<File> inFiles = new ArrayList<File>();
    String dir = ScriptingEngine.getWorkspace().getAbsolutePath()+"/imageCache/"
    File dirFile= new File(dir)
    if(!dirFile.exists()){
    dirFile.mkdir();
    }
    // Loop checking the camera for faces
    while(!Thread.interrupted()){
    camera0.getLatestImage(inputImage,displayImage) // capture image
    List<Detection> data = detector.getObjects(inputImage, displayImage)
    if(data.size()>0){
    println("Got: "+data.size()+
    " x location = "+data.get(0).getX()+
    " y location "+data.get(0).getY()+
    " size = "+data.get(0).getSize() )
    int position = (data.get(0).getX()/320.0)*255;
    //dyio.setValue(0,position)
    }
    }
    int i=0;
    while(!Thread.interrupted() && i<200){
    camera0.getLatestImage(inputImage,displayImage) // capture image
    List<Detection> data = detector.getObjects(inputImage, displayImage)
    if(data.size()>0){
    println("Got: "+data.size()+
    " x location = "+data.get(0).getX()+
    " y location "+data.get(0).getY()+
    " size = "+data.get(0).getSize() )
    int position = (data.get(0).getX()/320.0)*255;
    //dyio.setValue(0,position)

    }
    try {
    File outputfile = new File(dir+"/saved_"+i+".jpg");
    ImageIO.write(displayImage, "jpg", outputfile);
    inFiles.add(outputfile)
    } catch (IOException e) {
    e.printStackTrace()
    }
    i++
    }

    println "Compiling to video"
    File outFile = new File(dir+"/Video.mov")
    ImagesToVideo imageToMovie = new ImagesToVideo();
    imageToMovie.run(640, 480, 30, inFiles,outFile );
    println "Video exported to "+outFile.getAbsolutePath()


  8. madhephaestus revised this gist Sep 26, 2015. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions camera.groovy
    Original file line number Diff line number Diff line change
    @@ -3,12 +3,12 @@ import com.neuronrobotics.imageprovider.Detection;
    import java.util.List;

    OpenCVImageProvider camera0=null;
    if(DeviceManager.getSpecificDevice(OpenCVImageProvider.class, "camera0")==null){
    BowlerStudio.speak("I did not fine a device called camera. Connection camera 0.");
    if(DeviceManager.getSpecificDevice(OpenCVImageProvider.class, "camera")==null){
    BowlerStudio.speak("I did not fine a device called camera. Connecting to camera 0.");
    camera0 = new OpenCVImageProvider(0);// grab the first camera
    DeviceManager.addConnection(camera0,"camera0");
    DeviceManager.addConnection(camera0,"camera");
    }else{
    camera0 = (OpenCVImageProvider)DeviceManager.getSpecificDevice(OpenCVImageProvider.class, "camera0");
    camera0 = (OpenCVImageProvider)DeviceManager.getSpecificDevice(OpenCVImageProvider.class, "camera");
    }

    // Starting with the connected camera from BowlerStudio
  9. madhephaestus revised this gist Sep 26, 2015. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion camera.groovy
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,16 @@
    import java.awt.image.BufferedImage;
    import com.neuronrobotics.imageprovider.Detection;
    import java.util.List;

    OpenCVImageProvider camera0=null;
    if(DeviceManager.getSpecificDevice(OpenCVImageProvider.class, "camera0")==null){
    BowlerStudio.speak("I did not fine a device called camera. Connection camera 0.");
    camera0 = new OpenCVImageProvider(0);// grab the first camera
    DeviceManager.addConnection(camera0,"camera0");
    }else{
    camera0 = (OpenCVImageProvider)DeviceManager.getSpecificDevice(OpenCVImageProvider.class, "camera0");
    }

    // Starting with the connected camera from BowlerStudio
    println(camera0)
    //Create the default detector using "lbpcascade_frontalface.xml"
    @@ -18,6 +28,6 @@ while(!Thread.interrupted()){
    " y location "+data.get(0).getY()+
    " size = "+data.get(0).getSize() )
    int position = (data.get(0).getX()/320.0)*255;
    dyio.setValue(0,position)
    //dyio.setValue(0,position)
    }
    }
  10. madhephaestus revised this gist Sep 7, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion camera.groovy
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    import java.awt.image.BufferedImage;
    import com.neuronrobotics.jniloader.Detection;
    import com.neuronrobotics.imageprovider.Detection;
    import java.util.List;
    // Starting with the connected camera from BowlerStudio
    println(camera0)
  11. madhephaestus revised this gist May 29, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions camera.groovy
    Original file line number Diff line number Diff line change
    @@ -17,5 +17,7 @@ while(!Thread.interrupted()){
    " x location = "+data.get(0).getX()+
    " y location "+data.get(0).getY()+
    " size = "+data.get(0).getSize() )
    int position = (data.get(0).getX()/320.0)*255;
    dyio.setValue(0,position)
    }
    }
  12. madhephaestus revised this gist May 29, 2015. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions camera.groovy
    Original file line number Diff line number Diff line change
    @@ -12,6 +12,10 @@ BufferedImage displayImage = AbstractImageProvider.newBufferImage(640,480)
    while(!Thread.interrupted()){
    camera0.getLatestImage(inputImage,displayImage) // capture image
    List<Detection> data = detector.getObjects(inputImage, displayImage)
    if(data.size()>0)
    println("Got: "+data.size()+ " x location = "+data.get(0).getX()+" y location "+data.get(0).getY()+" size = "+data.get(0).getSize() )
    if(data.size()>0){
    println("Got: "+data.size()+
    " x location = "+data.get(0).getX()+
    " y location "+data.get(0).getY()+
    " size = "+data.get(0).getSize() )
    }
    }
  13. madhephaestus revised this gist May 29, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion camera.groovy
    Original file line number Diff line number Diff line change
    @@ -13,5 +13,5 @@ while(!Thread.interrupted()){
    camera0.getLatestImage(inputImage,displayImage) // capture image
    List<Detection> data = detector.getObjects(inputImage, displayImage)
    if(data.size()>0)
    println("Got: "+data.size()+ " x location = "+data.get(0).getX()+" y location "+data.get(0).getY()+" size = "+data.get(0)+getSize() )
    println("Got: "+data.size()+ " x location = "+data.get(0).getX()+" y location "+data.get(0).getY()+" size = "+data.get(0).getSize() )
    }
  14. madhephaestus revised this gist May 29, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion camera.groovy
    Original file line number Diff line number Diff line change
    @@ -12,5 +12,6 @@ BufferedImage displayImage = AbstractImageProvider.newBufferImage(640,480)
    while(!Thread.interrupted()){
    camera0.getLatestImage(inputImage,displayImage) // capture image
    List<Detection> data = detector.getObjects(inputImage, displayImage)
    println("Got: "+data.size())
    if(data.size()>0)
    println("Got: "+data.size()+ " x location = "+data.get(0).getX()+" y location "+data.get(0).getY()+" size = "+data.get(0)+getSize() )
    }
  15. madhephaestus revised this gist Apr 29, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions camera.groovy
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    import java.awt.image.BufferedImage;
    import com.neuronrobotics.jniloader.Detection;
    import java.util.List;
    // Starting with the connected camera from BowlerStudio
    println(camera0)
    //Create the default detector using "lbpcascade_frontalface.xml"
  16. madhephaestus revised this gist Apr 29, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions camera.groovy
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    import java.awt.image.BufferedImage;
    import com.neuronrobotics.jniloader.Detection;
    // Starting with the connected camera from BowlerStudio
    println(camera0)
    //Create the default detector using "lbpcascade_frontalface.xml"
  17. madhephaestus revised this gist Apr 26, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion camera.groovy
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ println(camera0)
    IObjectDetector detector = new HaarDetector("lbpcascade_frontalface.xml")
    // Create the input and display images. The display is where the detector writes its detections overlay on the input image
    BufferedImage inputImage = AbstractImageProvider.newBufferImage(640,480)
    BufferedImage outImage = AbstractImageProvider.newBufferImage(640,480)
    BufferedImage displayImage = AbstractImageProvider.newBufferImage(640,480)
    // Loop checking the camera for faces
    while(!Thread.interrupted()){
    camera0.getLatestImage(inputImage,displayImage) // capture image
  18. madhephaestus revised this gist Apr 26, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions camera.groovy
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    import java.awt.image.BufferedImage;
    // Starting with the connected camera from BowlerStudio
    println(camera0)
    //Create the default detector using "lbpcascade_frontalface.xml"
  19. madhephaestus revised this gist Apr 26, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions camera.groovy
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,6 @@ BufferedImage outImage = AbstractImageProvider.newBufferImage(640,480)
    // Loop checking the camera for faces
    while(!Thread.interrupted()){
    camera0.getLatestImage(inputImage,displayImage) // capture image
    KeyPoint[] data = detector.getObjects(inputImage, displayImage)
    println("Got: "+data.length)
    List<Detection> data = detector.getObjects(inputImage, displayImage)
    println("Got: "+data.size())
    }
  20. madhephaestus revised this gist Apr 26, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions camera.groovy
    Original file line number Diff line number Diff line change
    @@ -3,8 +3,8 @@ println(camera0)
    //Create the default detector using "lbpcascade_frontalface.xml"
    IObjectDetector detector = new HaarDetector("lbpcascade_frontalface.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()
    BufferedImage inputImage = AbstractImageProvider.newBufferImage(640,480)
    BufferedImage outImage = AbstractImageProvider.newBufferImage(640,480)
    // Loop checking the camera for faces
    while(!Thread.interrupted()){
    camera0.getLatestImage(inputImage,displayImage) // capture image
  21. madhephaestus revised this gist Apr 24, 2015. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions camera.groovy
    Original file line number Diff line number Diff line change
    @@ -6,8 +6,8 @@ IObjectDetector detector = new HaarDetector("lbpcascade_frontalface.xml")
    Mat inputImage = new Mat()
    Mat displayImage = new Mat()
    // Loop checking the camera for faces
    while(true){
    camera0.getLatestImage(inputImage,displayImage); // capture image
    KeyPoint[] data = detector.getObjects(inputImage, displayImage);
    System.out.println("Got: "+data.length);
    while(!Thread.interrupted()){
    camera0.getLatestImage(inputImage,displayImage) // capture image
    KeyPoint[] data = detector.getObjects(inputImage, displayImage)
    println("Got: "+data.length)
    }
  22. madhephaestus revised this gist Apr 24, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion camera.groovy
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    // Starting with the connected camera from BowlerStudio
    println(camera0)
    //Create the default detector using "lbpcascade_frontalface.xml"
    IObjectDetector detector = new HaarDetector("haarcascade_smile.xml")
    IObjectDetector detector = new HaarDetector("lbpcascade_frontalface.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()
  23. madhephaestus revised this gist Apr 24, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion camera.groovy
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    // Starting with the connected camera from BowlerStudio
    println(camera0)
    //Create the default detector using "haarcascade_frontalface_default.xml"
    //Create the default detector using "lbpcascade_frontalface.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()
  24. madhephaestus revised this gist Apr 21, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion camera.groovy
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    // Starting with the connected camera from BowlerStudio
    println(camera0)
    //Create the default detector using "haarcascade_frontalface_default.xml"
    IObjectDetector detector = new HaarDetector("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()
  25. madhephaestus revised this gist Apr 19, 2015. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion camera.groovy
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,6 @@ Mat inputImage = new Mat()
    Mat displayImage = new Mat()
    // Loop checking the camera for faces
    while(true){
    ThreadUtil.wait(100);
    camera0.getLatestImage(inputImage,displayImage); // capture image
    KeyPoint[] data = detector.getObjects(inputImage, displayImage);
    System.out.println("Got: "+data.length);
  26. madhephaestus revised this gist Apr 17, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions camera.groovy
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    // Starting with the connected camera from BowlerStudio
    println(camera0)
    //Create the default detector using "/harr/haarcascade_frontalface_default.xml"
    IObjectDetector detector = new HaarDetector("/harr/haarcascade_frontalface_default.xml")
    //Create the default detector using "haarcascade_frontalface_default.xml"
    IObjectDetector detector = new HaarDetector("haarcascade_frontalface_default.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()
  27. madhephaestus created this gist Apr 17, 2015.
    14 changes: 14 additions & 0 deletions camera.groovy
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    // Starting with the connected camera from BowlerStudio
    println(camera0)
    //Create the default detector using "/harr/haarcascade_frontalface_default.xml"
    IObjectDetector detector = new HaarDetector("/harr/haarcascade_frontalface_default.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){
    ThreadUtil.wait(100);
    camera0.getLatestImage(inputImage,displayImage); // capture image
    KeyPoint[] data = detector.getObjects(inputImage, displayImage);
    System.out.println("Got: "+data.length);
    }