OpenPose  1.7.0
The first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints
producer.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_PRODUCER_PRODUCER_HPP
2 #define OPENPOSE_PRODUCER_PRODUCER_HPP
3 
7 
8 namespace op
9 {
15  {
16  public:
20  explicit Producer(const ProducerType type, const std::string& cameraParameterPath, const bool undistortImage,
21  const int mNumberViews);
22 
27  virtual ~Producer();
28 
34 
39  std::vector<Matrix> getFrames();
40 
46  virtual std::vector<Matrix> getCameraMatrices();
47 
53  virtual std::vector<Matrix> getCameraExtrinsics();
54 
60  virtual std::vector<Matrix> getCameraIntrinsics();
61 
67  virtual std::string getNextFrameName() = 0;
68 
74  void setProducerFpsMode(const ProducerFpsMode fpsMode);
75 
81  {
82  return mType;
83  }
84 
90  virtual bool isOpened() const = 0;
91 
96  virtual void release() = 0;
97 
105  virtual double get(const int capProperty) = 0;
106 
114  virtual void set(const int capProperty, const double value) = 0;
115 
120  double get(const ProducerProperty property);
121 
127  void set(const ProducerProperty property, const double value);
128 
129  protected:
137 
143 
148 
153  virtual Matrix getRawFrame() = 0;
154 
160  virtual std::vector<Matrix> getRawFrames() = 0;
161 
162  private:
163  const ProducerType mType;
164  ProducerFpsMode mProducerFpsMode;
165  std::array<double, (int)ProducerProperty::Size> mProperties;
166  unsigned int mNumberEmptyFrames;
167  // For ProducerFpsMode::OriginalFps
168  bool mTrackingFps;
169  unsigned long long mFirstFrameTrackingFps;
170  unsigned long long mNumberFramesTrackingFps;
171  unsigned int mNumberSetPositionTrackingFps;
172  std::chrono::high_resolution_clock::time_point mClockTrackingFps;
173  // Camera parameters
174  CameraParameterReader mCameraParameterReader;
175 
177  };
178 
182  OP_API std::shared_ptr<Producer> createProducer(
183  const ProducerType producerType = ProducerType::None, const std::string& producerString = "",
184  const Point<int>& cameraResolution = Point<int>{-1,-1},
185  const std::string& cameraParameterPath = "models/cameraParameters/", const bool undistortImage = true,
186  const int numberViews = -1);
187 }
188 
189 #endif // OPENPOSE_PRODUCER_PRODUCER_HPP
void setProducerFpsMode(const ProducerFpsMode fpsMode)
Matrix getFrame()
virtual std::vector< Matrix > getCameraMatrices()
virtual std::vector< Matrix > getCameraExtrinsics()
virtual double get(const int capProperty)=0
virtual bool isOpened() const =0
virtual std::vector< Matrix > getCameraIntrinsics()
virtual void release()=0
virtual ~Producer()
double get(const ProducerProperty property)
ProducerType getType()
Definition: producer.hpp:80
std::vector< Matrix > getFrames()
Producer(const ProducerType type, const std::string &cameraParameterPath, const bool undistortImage, const int mNumberViews)
virtual Matrix getRawFrame()=0
virtual void set(const int capProperty, const double value)=0
virtual std::string getNextFrameName()=0
void checkFrameIntegrity(Matrix &frame)
void ifEndedResetOrRelease()
virtual std::vector< Matrix > getRawFrames()=0
void set(const ProducerProperty property, const double value)
void keepDesiredFrameRate()
#define OP_API
Definition: macros.hpp:18
#define DELETE_COPY(className)
Definition: macros.hpp:32
ProducerType
Definition: enumClasses.hpp:30
OP_API std::shared_ptr< Producer > createProducer(const ProducerType producerType=ProducerType::None, const std::string &producerString="", const Point< int > &cameraResolution=Point< int >{-1,-1}, const std::string &cameraParameterPath="models/cameraParameters/", const bool undistortImage=true, const int numberViews=-1)
ProducerProperty
Definition: enumClasses.hpp:15
ProducerFpsMode
Definition: enumClasses.hpp:7