OpenPose 1.0.0rc2 OpenPose: A Real-Time Multi-Person Key-Point Detection And Multi-Threading C++ Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
producer.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_PRODUCER_PRODUCER_HPP
2 #define OPENPOSE_PRODUCER_PRODUCER_HPP
3
4 #include <opencv2/core/core.hpp> // cv::Mat
5 #include <opencv2/highgui/highgui.hpp> // capProperties of OpenCV
6 #include <openpose/3d/cameraParameterReader.hpp>
7 #include <openpose/core/common.hpp>
8 #include <openpose/producer/enumClasses.hpp>
9
10 namespace op
11 {
16 class OP_API Producer
17 {
18 public:
22 explicit Producer(const ProducerType type, const std::string& cameraParameterPath, const bool undistortImage,
23 const int mNumberViews);
24
29 virtual ~Producer();
30
35 cv::Mat getFrame();
36
41 std::vector<cv::Mat> getFrames();
42
48 virtual std::vector<cv::Mat> getCameraMatrices();
49
55 virtual std::vector<cv::Mat> getCameraExtrinsics();
56
62 virtual std::vector<cv::Mat> getCameraIntrinsics();
63
69 virtual std::string getNextFrameName() = 0;
70
76 void setProducerFpsMode(const ProducerFpsMode fpsMode);
77
82 inline ProducerType getType()
83 {
84 return mType;
85 }
86
92 virtual bool isOpened() const = 0;
93
98 virtual void release() = 0;
99
107 virtual double get(const int capProperty) = 0;
108
116 virtual void set(const int capProperty, const double value) = 0;
117
122 double get(const ProducerProperty property);
123
129 void set(const ProducerProperty property, const double value);
130
131 protected:
138 void checkFrameIntegrity(cv::Mat& frame);
139
144 void flipAndRotate(cv::Mat& cvMat) const;
145
150 void ifEndedResetOrRelease();
151
155 void keepDesiredFrameRate();
156
161 virtual cv::Mat getRawFrame() = 0;
162
168 virtual std::vector<cv::Mat> getRawFrames() = 0;
169
170 private:
171 const ProducerType mType;
172 ProducerFpsMode mProducerFpsMode;
173 std::array<double, (int)ProducerProperty::Size> mProperties;
174 unsigned int mNumberEmptyFrames;
175 // For ProducerFpsMode::OriginalFps
176 bool mTrackingFps;
177 unsigned long long mFirstFrameTrackingFps;
178 unsigned long long mNumberFramesTrackingFps;
179 unsigned int mNumberSetPositionTrackingFps;
180 std::chrono::high_resolution_clock::time_point mClockTrackingFps;
181 // Camera parameters
182 CameraParameterReader mCameraParameterReader;
183
184 DELETE_COPY(Producer);
185 };
186
190 OP_API std::shared_ptr<Producer> createProducer(
191 const ProducerType producerType = ProducerType::None, const std::string& producerString = "",
192 const Point<int>& cameraResolution = Point<int>{-1,-1},
193 const std::string& cameraParameterPath = "models/cameraParameters/", const bool undistortImage = true,
194 const int numberViews = -1);
195 }
196
197 #endif // OPENPOSE_PRODUCER_PRODUCER_HPP
DELETE_COPY
#define DELETE_COPY(className)
Definition: macros.hpp:34
op::RenderMode::None
cameraParameterReader.hpp
op::ProducerFpsMode
ProducerFpsMode
Definition: enumClasses.hpp:6
op::ProducerProperty
ProducerProperty
Definition: enumClasses.hpp:14
op::Producer
Definition: producer.hpp:16
common.hpp
op::Producer::getType
ProducerType getType()
Definition: producer.hpp:82
op::CameraParameterReader
Definition: cameraParameterReader.hpp:9
op::createProducer
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)
op::ProducerType
ProducerType
Definition: enumClasses.hpp:29
OP_API
#define OP_API
Definition: macros.hpp:19
enumClasses.hpp
cl::string
std::string string
Definition: cl2.hpp:574