#include <videoCaptureReader.hpp>
Inherits op::Producer.
Inherited by op::IpCameraReader, op::VideoReader, and op::WebcamReader.
VideoCaptureReader is an abstract class to extract frames from a cv::VideoCapture source (video file, webcam stream, etc.). It has the basic and common functions of the cv::VideoCapture class (e.g. get, set, etc.).
op::VideoCaptureReader::VideoCaptureReader |
( |
const int |
index, |
|
|
const bool |
throwExceptionIfNoOpened |
|
) |
| |
|
explicit |
This constructor of VideoCaptureReader wraps cv::VideoCapture(const int).
- Parameters
-
index | const int indicating the cv::VideoCapture constructor int argument, in the range [0, 9]. |
op::VideoCaptureReader::VideoCaptureReader |
( |
const std::string & |
path, |
|
|
const ProducerType |
producerType |
|
) |
| |
|
explicit |
This constructor of VideoCaptureReader wraps cv::VideoCapture(const std::string).
- Parameters
-
path | const std::string indicating the cv::VideoCapture constructor string argument. |
producerType | const std::string indicating whether the frame source is an IP camera or video. |
virtual op::VideoCaptureReader::~VideoCaptureReader |
( |
| ) |
|
|
virtual |
Destructor of VideoCaptureReader. It releases the cv::VideoCapture member. It is virtual so that any children class can implement its own destructor.
virtual double op::VideoCaptureReader::get |
( |
const int |
capProperty | ) |
|
|
pure virtual |
This function is a wrapper of cv::VideoCapture::get. It allows getting different properties of the Producer (fps, width, height, etc.). See the OpenCV documentation for all the available properties.
- Parameters
-
capProperty | int indicating the property to be modified. |
- Returns
- double returning the property value.
Implements op::Producer.
Implemented in op::WebcamReader, op::VideoReader, and op::IpCameraReader.
virtual std::string op::VideoCaptureReader::getFrameName |
( |
| ) |
|
|
pure virtual |
virtual cv::Mat op::VideoCaptureReader::getRawFrame |
( |
| ) |
|
|
protectedpure virtual |
Function to be defined by its children class. It retrieves and returns a new frame from the frames producer.
- Returns
- cv::Mat with the new frame.
Implements op::Producer.
bool op::VideoCaptureReader::isOpened |
( |
| ) |
const |
|
inlinevirtual |
This function returns whether the Producer instance is still opened and able to retrieve more frames.
- Returns
- bool indicating whether the Producer is opened.
Implements op::Producer.
void op::VideoCaptureReader::release |
( |
| ) |
|
|
virtual |
virtual void op::VideoCaptureReader::set |
( |
const int |
capProperty, |
|
|
const double |
value |
|
) |
| |
|
pure virtual |
This function is a wrapper of cv::VideoCapture::set. It allows setting different properties of the Producer (fps, width, height, etc.). See the OpenCV documentation for all the available properties.
- Parameters
-
capProperty | int indicating the property to be modified. |
value | double indicating the new value to be assigned. |
Implements op::Producer.
Implemented in op::WebcamReader, op::VideoReader, and op::IpCameraReader.
void op::VideoCaptureReader::set |
( |
const ProducerProperty |
property, |
|
|
const double |
value |
|
) |
| |
|
inlinevirtual |
The documentation for this class was generated from the following file: