#include <webcamReader.hpp>
Inherits op::VideoCaptureReader.
WebcamReader is a wrapper of the cv::VideoCapture class for webcam. It allows controlling a video (extracting frames, setting resolution & fps, seeking to a particular frame, etc).
op::WebcamReader::WebcamReader |
( |
const int |
webcamIndex = 0 , |
|
|
const Point< int > & |
webcamResolution = Point< int >{} , |
|
|
const double |
fps = 30. , |
|
|
const bool |
throwExceptionIfNoOpened = true |
|
) |
| |
|
explicit |
Constructor of WebcamReader. It opens the webcam as a wrapper of cv::VideoCapture. It includes an argument to indicate the desired resolution.
- Parameters
-
webcamIndex | const int indicating the camera source (see the OpenCV documentation about cv::VideoCapture for more details), in the range [0, 9]. |
webcamResolution | const Point<int> parameter which specifies the desired camera resolution. |
fps | Double parameter which specifies the desired camera frame rate. |
virtual op::WebcamReader::~WebcamReader |
( |
| ) |
|
|
virtual |
double op::WebcamReader::get |
( |
const int |
capProperty | ) |
|
|
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::VideoCaptureReader.
std::vector<cv::Mat> op::WebcamReader::getCameraExtrinsics |
( |
| ) |
|
|
virtual |
It retrieves and returns the camera extrinsic parameters from the frames producer.
- Returns
- std::vector<cv::Mat> with the camera extrinsic parameters.
Implements op::Producer.
std::vector<cv::Mat> op::WebcamReader::getCameraIntrinsics |
( |
| ) |
|
|
virtual |
It retrieves and returns the camera intrinsic parameters from the frames producer.
- Returns
- std::vector<cv::Mat> with the camera intrinsic parameters.
Implements op::Producer.
std::vector<cv::Mat> op::WebcamReader::getCameraMatrices |
( |
| ) |
|
|
virtual |
It retrieves and returns the camera matrixes from the frames producer.
- Returns
- std::vector<cv::Mat> with the camera matrices.
Implements op::Producer.
std::string op::WebcamReader::getNextFrameName |
( |
| ) |
|
|
virtual |
This function returns a unique frame name (e.g., the frame number for video, the frame counter for webcam, the image name for image directory reader, etc.).
- Returns
- std::string with an unique frame name.
Implements op::VideoCaptureReader.
bool op::WebcamReader::isOpened |
( |
| ) |
const |
|
virtual |
This function returns whether the Producer instance is still opened and able to retrieve more frames.
- Returns
- bool indicating whether the Producer is opened.
Reimplemented from op::VideoCaptureReader.
void op::WebcamReader::set |
( |
const int |
capProperty, |
|
|
const double |
value |
|
) |
| |
|
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::VideoCaptureReader.
The documentation for this class was generated from the following file:
- /home/travis/build/CMU-Perceptual-Computing-Lab/openpose/include/openpose/producer/webcamReader.hpp