public static Class<? extends FrameGrabber> get(String className) throws Exception { className = FrameGrabber.class.getPackage().getName() + "." + className; try { return Class.forName(className).asSubclass(FrameGrabber.class); } catch (ClassNotFoundException e) { String className2 = className + "FrameGrabber"; try { return Class.forName(className2).asSubclass(FrameGrabber.class); } catch (ClassNotFoundException ex) { throw new Exception("Could not get FrameGrabber class for " + className + " or " + className2, e); } } }
@Override public Frame grab() throws Exception { try { final byte[] b = readImage(); final Mat mat = new Mat(1, b.length, CV_8UC1, new BytePointer(b)); releaseDecoded(); return converter.convert(decoded = imdecode(mat, IMREAD_COLOR)); } catch (IOException e) { throw new Exception(e.getMessage(), e); } }
public static RealSenseFrameGrabber createDefault(String devicePath) throws Exception { throw new Exception(RealSenseFrameGrabber.class + " does not support path."); }
public void trigger() throws Exception { if (myVideoInput == null) { throw new Exception("videoInput is null. (Has start() been called?)"); } int w = myVideoInput.getWidth(deviceNumber), h = myVideoInput.getHeight(deviceNumber); if (bgrImage == null || bgrImage.width() != w || bgrImage.height() != h) { bgrImage = IplImage.create(w, h, IPL_DEPTH_8U, 3); bgrImageData = bgrImage.imageData(); } for (int i = 0; i < numBuffers+1; i++) { myVideoInput.getPixels(deviceNumber, bgrImageData, false, true); } }
private void enqueue(dc1394video_frame_t image) throws Exception { if (image != null) { int err = dc1394_capture_enqueue(camera, image); if (err != DC1394_SUCCESS) { throw new Exception("dc1394_capture_enqueue() Error " + err + ": Could not release a frame."); } } }
public AVPacket grabPacket() throws Exception { if (oc == null || oc.isNull()) { throw new Exception("Could not trigger: No AVFormatContext. (Has start() been called?)"); } // Return the next frame of a stream. if (av_read_frame(oc, pkt) < 0) { return null; } return pkt; } }
public void trigger() throws Exception { Mat mat = new Mat(); for (int i = 0; i < numBuffers+1; i++) { capture.read(mat); } if (!capture.grab()) { throw new Exception("grab() Error: Could not grab frame. (Has start() been called?)"); } }
public static void tryLoad() throws Exception { if (loadingException != null) { throw loadingException; } else { try { Loader.load(org.bytedeco.javacpp.videoInputLib.class); } catch (Throwable t) { throw loadingException = new Exception("Failed to load " + VideoInputFrameGrabber.class, t); } } }
public static void tryLoad() throws Exception { if (loadingException != null) { throw loadingException; } else { try { Loader.load(org.bytedeco.javacpp.opencv_highgui.class); } catch (Throwable t) { throw loadingException = new Exception("Failed to load " + OpenCVFrameGrabber.class, t); } } }
public static void tryLoad() throws FrameGrabber.Exception { if (loadingException != null) { loadingException.printStackTrace(); throw loadingException; } else { try { Loader.load(org.bytedeco.javacpp.FlyCapture2.class); } catch (Throwable t) { throw loadingException = new FrameGrabber.Exception("Failed to load " + FlyCapture2FrameGrabber.class, t); } } }
public device loadDevice() throws FrameGrabber.Exception { if (context == null) { context = new context(); } if (context == null || context.get_device_count() <= deviceNumber) { throw new Exception("FATAL error: Realsense camera: " + deviceNumber + " not connected/found"); } device = context.get_device(deviceNumber); return device; }
@Override public void setTimestamp(long timestamp) throws Exception { if (capture == null) { super.setTimestamp(timestamp); } else { if (!capture.set(CAP_PROP_POS_MSEC, timestamp/1000.0)) { throw new Exception("set() Error: Could not set CAP_PROP_POS_MSEC to " + timestamp/1000.0 + "."); } } }
/** * @throws org.bytedeco.javacv.FrameGrabber.Exception */ public void trigger() throws FrameGrabber.Exception { waitForTriggerReady(); Error error = camera.FireSoftwareTrigger(); if (error.notEquals(PGRERROR_OK)) { throw new FrameGrabber.Exception("flycaptureSetCameraRegister() Error " + error); } }
/** Stop camera. It can be re-started if needed. * * @return success/failure (true/false) */ public void stop() throws Exception { boolean b = camera.stopCamera(); if (b) stat = "stopped"; else throw new Exception("Camera stop() failed"); }
public void stop() throws FrameGrabber.Exception { Error error = camera.StopCapture(); if (error.notEquals(PGRERROR_OK)) { PrintError(error); throw new FrameGrabber.Exception("flycapture camera StopCapture() Error " + error); } temp_image = null; return_image = null; timestamp = 0; frameNumber = 0; }
public static void tryLoad() throws Exception { if (loadingException != null) { throw loadingException; } else { try { Loader.load(org.bytedeco.javacpp.freenect.class); } catch (Throwable t) { throw loadingException = new Exception("Failed to load " + OpenKinectFrameGrabber.class, t); } } }
public static void tryLoad() throws Exception { if (loadingException != null) { throw loadingException; } else { try { CLCamera.IsLibraryLoaded(); } catch (Throwable t) { throw loadingException = new Exception("Failed to load " + PS3EyeFrameGrabber.class, t); } } }
public static void tryLoad() throws Exception { if (loadingException != null) { throw loadingException; } else { try { Loader.load(org.bytedeco.javacpp.dc1394.class); } catch (Throwable t) { throw loadingException = new Exception("Failed to load " + DC1394FrameGrabber.class, t); } } }
public static void tryLoad() throws Exception { if (loadingException != null) { throw loadingException; } else { try { Loader.load(org.bytedeco.javacpp.opencv_highgui.class); } catch (Throwable t) { throw loadingException = new Exception("Failed to load " + IPCameraFrameGrabber.class, t); } } }
@Override public void setFrameNumber(int frameNumber) throws Exception { if (capture == null) { super.setFrameNumber(frameNumber); } else { if (!capture.set(CAP_PROP_POS_FRAMES, frameNumber)) { throw new Exception("set() Error: Could not set CAP_PROP_POS_FRAMES to " + frameNumber + "."); } } }