OpenPose  1.0.0rc2
OpenPose: A Real-Time Multi-Person Key-Point Detection And Multi-Threading C++ Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
webcamReader.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_PRODUCER_WEBCAM_READER_HPP
2 #define OPENPOSE_PRODUCER_WEBCAM_READER_HPP
3 
4 #include <atomic>
5 #include <mutex>
6 #include <thread>
9 
10 namespace op
11 {
17  {
18  public:
27  explicit WebcamReader(const int webcamIndex = 0, const Point<int>& webcamResolution = Point<int>{},
28  const double fps = 30., const bool throwExceptionIfNoOpened = true);
29 
30  ~WebcamReader();
31 
32  std::vector<cv::Mat> getCameraMatrices();
33 
34  std::vector<cv::Mat> getCameraExtrinsics();
35 
36  std::vector<cv::Mat> getCameraIntrinsics();
37 
38  std::string getNextFrameName();
39 
40  double get(const int capProperty);
41 
42  void set(const int capProperty, const double value);
43 
44  private:
45  double mFps;
46  long long mFrameNameCounter;
47  bool mThreadOpened;
48  cv::Mat mBuffer;
49  std::mutex mBufferMutex;
50  std::atomic<bool> mCloseThread;
51  std::thread mThread;
52 
53  cv::Mat getRawFrame();
54 
55  std::vector<cv::Mat> getRawFrames();
56 
57  void bufferingThread();
58 
60  };
61 }
62 
63 #endif // OPENPOSE_PRODUCER_WEBCAM_READER_HPP
#define DELETE_COPY(className)
Definition: macros.hpp:31
Definition: videoCaptureReader.hpp:15
Definition: webcamReader.hpp:16
#define OP_API
Definition: macros.hpp:16
std::string string
Definition: cl2.hpp:574