OpenPose  1.0.0rc2
OpenPose: A Real-Time Multi-Person Key-Point Detection And Multi-Threading C++ Library
 All Classes Namespaces Files Functions Variables Enumerations Enumerator 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::string getFrameName();
33 
34  double get(const int capProperty);
35 
36  void set(const int capProperty, const double value);
37 
38  private:
39  double mFps;
40  long long mFrameNameCounter;
41  bool mThreadOpened;
42  cv::Mat mBuffer;
43  std::mutex mBufferMutex;
44  std::atomic<bool> mCloseThread;
45  std::thread mThread;
46 
47  cv::Mat getRawFrame();
48 
49  void bufferingThread();
50 
52  };
53 }
54 
55 #endif // OPENPOSE_PRODUCER_WEBCAM_READER_HPP
#define DELETE_COPY(className)
Definition: macros.hpp:24
Definition: videoCaptureReader.hpp:15
Definition: webcamReader.hpp:16
#define OP_API
Definition: macros.hpp:9