All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
op::ImageDirectoryReader Class Reference

`#include <imageDirectoryReader.hpp>`

Inherits op::Producer.

## Public Member Functions

| ImageDirectoryReader (const std::string &imageDirectoryPath, const unsigned int imageDirectoryStereo=1, const std::string &cameraParameterPath="")
virtual | ~ImageDirectoryReader ()
std::vector< cv::Mat > | getCameraMatrices ()
std::vector< cv::Mat > | getCameraExtrinsics ()
std::vector< cv::Mat > | getCameraIntrinsics ()
std::string | getNextFrameName ()
bool | isOpened () const
void | release ()
double | get (const int capProperty)
void | set (const int capProperty, const double value)
Public Member Functions inherited from op::Producer
| Producer (const ProducerType type)
virtual | ~Producer ()
cv::Mat | getFrame ()
std::vector< cv::Mat > | getFrames ()
void | setProducerFpsMode (const ProducerFpsMode fpsMode)
ProducerType | getType ()
double | get (const ProducerProperty property)
void | set (const ProducerProperty property, const double value)

## Additional Inherited Members

Protected Member Functions inherited from op::Producer
void | checkFrameIntegrity (cv::Mat &frame)
void | flipAndRotate (cv::Mat &cvMat) const
void | ifEndedResetOrRelease ()
void | keepDesiredFrameRate ()

## Detailed Description

ImageDirectoryReader is an abstract class to extract frames from a image directory. Its interface imitates the cv::VideoCapture class, so it can be used quite similarly to the cv::VideoCapture class. Thus, it is quite similar to VideoReader and WebcamReader.

## Constructor & Destructor Documentation

op::ImageDirectoryReader::ImageDirectoryReader | ( | const std::string & | imageDirectoryPath,
|  | const unsigned int | imageDirectoryStereo = `1`,
|  | const std::string & | cameraParameterPath = `""`
| ) |  |

explicit

Constructor of ImageDirectoryReader. It sets the image directory path from which the images will be loaded and generates a std::vector<std::string> with the list of images on that directory.

Parameters

  imageDirectoryPath | const std::string parameter with the folder path containing the images.
  imageDirectoryStereo | const int parameter with the number of images per iteration (>1 would represent stereo processing).
  cameraParameterPath | const std::string parameter with the folder path containing the camera parameters (only required if imageDirectorystereo > 1).

virtual op::ImageDirectoryReader::~ImageDirectoryReader | ( |  | ) |

virtual

## Member Function Documentation

double op::ImageDirectoryReader::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::Producer.

std::vector<cv::Mat> op::ImageDirectoryReader::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::ImageDirectoryReader::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::ImageDirectoryReader::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::ImageDirectoryReader::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::Producer.

bool op::ImageDirectoryReader::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::ImageDirectoryReader::release | ( |  | ) |

inlinevirtual

This function releases and closes the Producer. After it is called, no more frames can be retrieved from Producer::getFrames.

Implements op::Producer.

void op::ImageDirectoryReader::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::Producer.

The documentation for this class was generated from the following file:

- /home/travis/build/CMU-Perceptual-Computing-Lab/openpose/include/openpose/producer/imageDirectoryReader.hpp