CvSource¶
- class cscore.CvSource(*args, **kwargs)¶
Bases:
ImageSource
A source for user code to provide OpenCV images as video frames.
Overloaded function.
__init__(self: cscore._cscore.CvSource, name: str, mode: cscore._cscore.VideoMode) -> None
Create an OpenCV source.
- Parameters:
name – Source name (arbitrary unique identifier)
mode – Video mode being generated
__init__(self: cscore._cscore.CvSource, name: str, pixelFormat: cscore._cscore.VideoMode.PixelFormat, width: int, height: int, fps: int) -> None
Create an OpenCV source.
- Parameters:
name – Source name (arbitrary unique identifier)
pixelFormat – Pixel format
width – width
height – height
fps – fps
- putFrame(image: numpy.ndarray) None ¶
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:
image – OpenCV image