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
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 <openpose/core/common.hpp>
7 #include <openpose/producer/videoCaptureReader.hpp>
8
9 namespace op
10 {
15 class OP_API WebcamReader : public VideoCaptureReader
16 {
17 public:
27 explicit WebcamReader(const int webcamIndex = 0, const Point<int>& webcamResolution = Point<int>{},
28 const bool throwExceptionIfNoOpened = true, const std::string& cameraParameterPath = "",
29 const bool undistortImage = false);
30
31 virtual ~WebcamReader();
32
33 std::string getNextFrameName();
34
35 bool isOpened() const;
36
37 double get(const int capProperty);
38
39 void set(const int capProperty, const double value);
40
41 private:
42 const int mIndex;
43 long long mFrameNameCounter;
44 bool mThreadOpened;
45 cv::Mat mBuffer;
46 std::mutex mBufferMutex;
47 std::atomic<bool> mCloseThread;
48 std::thread mThread;
49 // Detect camera unplugged
50 double mLastNorm;
51 std::atomic<int> mDisconnectedCounter;
52 Point<int> mResolution;
53
54 cv::Mat getRawFrame();
55
56 std::vector<cv::Mat> getRawFrames();
57
58 void bufferingThread();
59
60 bool reset();
61
62 DELETE_COPY(WebcamReader);
63 };
64 }
65
66 #endif // OPENPOSE_PRODUCER_WEBCAM_READER_HPP
DELETE_COPY
#define DELETE_COPY(className)
Definition: macros.hpp:34
op::VideoCaptureReader
Definition: videoCaptureReader.hpp:15
op::Point< int >
common.hpp
op::WebcamReader
Definition: webcamReader.hpp:15
videoCaptureReader.hpp
OP_API
#define OP_API
Definition: macros.hpp:19
cl::string
std::string string
Definition: cl2.hpp:574