コード例 #1
0
 @Override
 public void disconnect() {
   try {
     cam.disconnect();
   } catch (CameraConnectionException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   }
 }
コード例 #2
0
  @Override
  public boolean captureNewImage(BufferedImage imageData) {
    int failure = 0;
    while (failure < 5) {
      try {
        // Thread.sleep(3000);
        // bufferedImageToMat(cam.getPicture(), imageData);
        AbstractImageProvider.deepCopy(cam.getPicture(), imageData);
        return true;
      } catch (CameraConnectionException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        return false;
      } catch (CameraShootException e) {
        e.printStackTrace();

        failure++;
      }
    }
    return false;
  }
コード例 #3
0
 public CHDKImageProvider() throws PTPTimeoutException, GenericCameraException {
   cam = CameraFactory.getCamera(SupportedCamera.SX160IS);
   cam.connect();
   cam.setOperaionMode(CameraMode.RECORD);
 }