Package edu.wpi.first.cscore
Class CvSource
- java.lang.Object
-
- edu.wpi.first.cscore.VideoSource
-
- edu.wpi.first.cscore.ImageSource
-
- edu.wpi.first.cscore.CvSource
-
- All Implemented Interfaces:
AutoCloseable
public class CvSource extends ImageSource
A source that represents a video camera. These sources require the WPILib OpenCV builds. For an alternate OpenCV, see the documentation how to build your own with RawSource.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.wpi.first.cscore.VideoSource
VideoSource.ConnectionStrategy, VideoSource.Kind
-
-
Field Summary
-
Fields inherited from class edu.wpi.first.cscore.VideoSource
m_handle
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
putFrame(Mat image)
Put an OpenCV image and notify sinks.-
Methods inherited from class edu.wpi.first.cscore.ImageSource
createBooleanProperty, createIntegerProperty, createProperty, createStringProperty, notifyError, setConnected, setDescription, setEnumPropertyChoices
-
Methods inherited from class edu.wpi.first.cscore.VideoSource
close, enumerateProperties, enumerateSinks, enumerateSources, enumerateVideoModes, equals, getActualDataRate, getActualFPS, getConfigJson, getDescription, getHandle, getKind, getKindFromInt, getLastFrameTime, getName, getProperty, getVideoMode, hashCode, isConnected, isEnabled, isValid, setConfigJson, setConnectionStrategy, setFPS, setPixelFormat, setResolution, setVideoMode, setVideoMode
-
-
-
-
Constructor Detail
-
CvSource
public CvSource(String name, VideoMode mode)
Create an OpenCV source.- Parameters:
name
- Source name (arbitrary unique identifier)mode
- Video mode being generated
-
CvSource
public CvSource(String name, VideoMode.PixelFormat pixelFormat, int width, int height, int fps)
Create an OpenCV source.- Parameters:
name
- Source name (arbitrary unique identifier)pixelFormat
- Pixel formatwidth
- widthheight
- heightfps
- fps
-
-
Method Detail
-
putFrame
public void putFrame(Mat image)
Put an OpenCV image and notify sinks.Only 8-bit single-channel or 3-channel (with BGR channel order) images are supported. If the format, depth or channel order is different, use Mat.convertTo() and/or cvtColor() to convert it first.
- Parameters:
image
- OpenCV image
-
-