WPILibC++  2020.3.2-60-g3011ebe
cs::RawCvSource Class Reference

A source for using the raw frame API to provide opencv images. More...

#include <cscore_raw_cv.h>

Inheritance diagram for cs::RawCvSource:

Public Member Functions

 RawCvSource (const wpi::Twine &name, const VideoMode &mode)
 Create a Raw OpenCV source. More...
 
 RawCvSource (const wpi::Twine &name, VideoMode::PixelFormat pixelFormat, int width, int height, int fps)
 Create a Raw OpenCV source. More...
 
void PutFrame (cv::Mat &image)
 Put an OpenCV image and notify sinks. More...
 

Detailed Description

A source for using the raw frame API to provide opencv images.

If you are using the WPILib OpenCV builds, do not use this, and instead include "cscore_cv.h" to get a more performant version.

This is not dependent on any opencv binary ABI, and can be used with versions of OpenCV that are not 3. If using OpenCV 3, use CvSource.

Constructor & Destructor Documentation

◆ RawCvSource() [1/2]

cs::RawCvSource::RawCvSource ( const wpi::Twine name,
const VideoMode mode 
)
inline

Create a Raw OpenCV source.

Parameters
nameSource name (arbitrary unique identifier)
modeVideo mode being generated

◆ RawCvSource() [2/2]

cs::RawCvSource::RawCvSource ( const wpi::Twine name,
VideoMode::PixelFormat  pixelFormat,
int  width,
int  height,
int  fps 
)
inline

Create a Raw OpenCV source.

Parameters
nameSource name (arbitrary unique identifier)
pixelFormatPixel format
widthwidth
heightheight
fpsfps

Member Function Documentation

◆ PutFrame()

void cs::RawCvSource::PutFrame ( cv::Mat &  image)
inline

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 cv::Mat::convertTo() and/or cv::cvtColor() to convert it first.

Parameters
imageOpenCV image

The documentation for this class was generated from the following file: