예제 #1
0
  @Override
  public void setup() {
    size(2 * w, h + 150);

    // Camera initiated to capture from device
    capture = HighGui.captureFromCAM(0);

    im = CxCore.createImage(w, h, PixelDepth.IPL_DEPTH_8U, ColorModel.BGR);
    im_thresh = CxCore.createImage(w, h, PixelDepth.IPL_DEPTH_8U, ColorModel.BGR);

    // Init GUI
    ControlP5 controlP5 = new ControlP5(this);
    thresh_slider = controlP5.addSlider("thresh_val", 0, 255, 20, h + 20, 10, 100);
    r = controlP5.addRadioButton("thresh_type", 80, h + 20);
    for (int i = 0; i < ThresholdType.values().length; i++) {
      r.addItem(ThresholdType.values()[i].toString(), i + 1);
    }
    r.activate(0);
  }