Class JavaCvSink

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class JavaCvSink
    extends edu.wpi.cscore.ImageSink
    • Nested Class Summary

      • Nested classes/interfaces inherited from class edu.wpi.cscore.VideoSink

        edu.wpi.cscore.VideoSink.Kind
    • Field Summary

      • Fields inherited from class edu.wpi.cscore.VideoSink

        m_handle
    • Constructor Summary

      Constructors 
      Constructor Description
      JavaCvSink​(java.lang.String name)
      Create a sink for accepting OpenCV images.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      long grabFrame​(org.bytedeco.javacpp.opencv_core.Mat image)
      Wait for the next frame and get the image.
      long grabFrame​(org.bytedeco.javacpp.opencv_core.Mat image, double timeout)
      Wait for the next frame and get the image.
      • Methods inherited from class edu.wpi.cscore.ImageSink

        getError, setDescription, setEnabled
      • Methods inherited from class edu.wpi.cscore.VideoSink

        enumerateProperties, enumerateSinks, equals, getConfigJson, getDescription, getHandle, getKind, getKindFromInt, getName, getProperty, getSource, getSourceProperty, hashCode, isValid, setConfigJson, setSource
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JavaCvSink

        public JavaCvSink​(java.lang.String name)
        Create a sink for accepting OpenCV images. WaitForFrame() must be called on the created sink to get each new image.
        Parameters:
        name - Source name (arbitrary unique identifier)
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Overrides:
        close in class edu.wpi.cscore.VideoSink
      • grabFrame

        public long grabFrame​(org.bytedeco.javacpp.opencv_core.Mat image)
        Wait for the next frame and get the image. Times out (returning 0) after 0.225 seconds. The provided image will have three 3-bit channels stored in BGR order.
        Returns:
        Frame time, or 0 on error (call GetError() to obtain the error message)
      • grabFrame

        public long grabFrame​(org.bytedeco.javacpp.opencv_core.Mat image,
                              double timeout)
        Wait for the next frame and get the image. Times out (returning 0) after timeout seconds. The provided image will have three 3-bit channels stored in BGR order.
        Returns:
        Frame time, or 0 on error (call GetError() to obtain the error message); the frame time is in 1 us increments.