![]() |
OpenPose
1.7.0
The first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints
|
#include <producer.hpp>
Public Member Functions | |
| Producer (const ProducerType type, const std::string &cameraParameterPath, const bool undistortImage, const int mNumberViews) | |
| virtual | ~Producer () |
| Matrix | getFrame () |
| std::vector< Matrix > | getFrames () |
| virtual std::vector< Matrix > | getCameraMatrices () |
| virtual std::vector< Matrix > | getCameraExtrinsics () |
| virtual std::vector< Matrix > | getCameraIntrinsics () |
| virtual std::string | getNextFrameName ()=0 |
| void | setProducerFpsMode (const ProducerFpsMode fpsMode) |
| ProducerType | getType () |
| virtual bool | isOpened () const =0 |
| virtual void | release ()=0 |
| virtual double | get (const int capProperty)=0 |
| virtual void | set (const int capProperty, const double value)=0 |
| double | get (const ProducerProperty property) |
| void | set (const ProducerProperty property, const double value) |
Protected Member Functions | |
| void | checkFrameIntegrity (Matrix &frame) |
| void | ifEndedResetOrRelease () |
| void | keepDesiredFrameRate () |
| virtual Matrix | getRawFrame ()=0 |
| virtual std::vector< Matrix > | getRawFrames ()=0 |
Producer is an abstract class to extract frames from a source (image directory, video file, webcam stream, etc.). It has the basic and common functions (e.g., getFrame, release & isOpened).
Definition at line 14 of file producer.hpp.
|
explicit |
Constructor of Producer.
|
virtual |
Destructor of Producer. It is virtual so that any children class can implement its own destructor.
|
protected |
Protected function which checks that the frames keeps their integry (some OpenCV versions might return corrupted frames within a video or webcam with a size different to the standard resolution). If the frame is corrupted, it is set to an empty Mat.
| frame | Mat with the frame matrix to be checked and modified. |
|
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.
| capProperty | int indicating the property to be modified. |
Implemented in op::VideoCaptureReader, op::WebcamReader, op::VideoReader, op::IpCameraReader, op::ImageDirectoryReader, and op::FlirReader.
| double op::Producer::get | ( | const ProducerProperty | property | ) |
Extra attributes that VideoCapture::get/set do not contain.
| property | ProducerProperty indicating the property to be modified. |
|
virtual |
It retrieves and returns the camera extrinsic parameters from the frames producer. Virtual class because FlirReader implements their own.
Reimplemented in op::FlirReader.
|
virtual |
It retrieves and returns the camera intrinsic parameters from the frames producer. Virtual class because FlirReader implements their own.
Reimplemented in op::FlirReader.
|
virtual |
It retrieves and returns the camera matrixes from the frames producer. Virtual class because FlirReader implements their own.
Reimplemented in op::FlirReader.
| Matrix op::Producer::getFrame | ( | ) |
Main function of Producer, it retrieves and returns a new frame from the frames producer.
| std::vector<Matrix> op::Producer::getFrames | ( | ) |
Analogous to getFrame, but it could return > 1 frame.
|
pure 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.).
Implemented in op::VideoCaptureReader, op::WebcamReader, op::VideoReader, op::IpCameraReader, op::ImageDirectoryReader, and op::FlirReader.
|
protectedpure virtual |
Function to be defined by its children class. It retrieves and returns a new frame from the frames producer.
Implemented in op::VideoCaptureReader.
|
protectedpure virtual |
Function to be defined by its children class. It retrieves and returns a new frame from the frames producer. It is equivalent to getRawFrame when more than 1 image can be returned.
Implemented in op::VideoCaptureReader.
|
inline |
This function returns the type of producer (video, webcam, ...).
Definition at line 80 of file producer.hpp.
|
protected |
Protected function which checks that the frame producer has ended. If so, if resets or releases the producer according to mRepeatWhenFinished.
|
pure virtual |
This function returns whether the Producer instance is still opened and able to retrieve more frames.
Implemented in op::WebcamReader, op::VideoReader, op::VideoCaptureReader, op::IpCameraReader, op::ImageDirectoryReader, and op::FlirReader.
|
protected |
Protected function which forces the producer to get frames at the rate of get(CV_CAP_PROP_FPS).
|
pure virtual |
This function releases and closes the Producer. After it is called, no more frames can be retrieved from Producer::getFrames.
Implemented in op::VideoCaptureReader, op::ImageDirectoryReader, and op::FlirReader.
|
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.
| capProperty | int indicating the property to be modified. |
| value | double indicating the new value to be assigned. |
Implemented in op::VideoCaptureReader, op::WebcamReader, op::VideoReader, op::IpCameraReader, op::ImageDirectoryReader, and op::FlirReader.
| void op::Producer::set | ( | const ProducerProperty | property, |
| const double | value | ||
| ) |
Extra attributes that VideoCapture::get/set do not contain.
| property | ProducerProperty indicating the property to be modified. |
| value | double indicating the new value to be assigned. |
| void op::Producer::setProducerFpsMode | ( | const ProducerFpsMode | fpsMode | ) |
This function sets whether the producer must keep the original fps frame rate or extract the frames as quick as possible.
| fpsMode | ProducerFpsMode parameter specifying the new value. |