WPILibC++ 2023.4.3
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 ()=default
 
 RawCvSource (std::string_view name, const VideoMode &mode)
 Create a Raw OpenCV source. More...
 
 RawCvSource (std::string_view 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/3]

cs::RawCvSource::RawCvSource ( )
default

◆ RawCvSource() [2/3]

cs::RawCvSource::RawCvSource ( std::string_view  name,
const VideoMode mode 
)
inline

Create a Raw OpenCV source.

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

◆ RawCvSource() [3/3]

cs::RawCvSource::RawCvSource ( std::string_view  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: