All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
webcamReader.hpp
Go to the documentation of this file.
#ifndef OPENPOSE_PRODUCER_WEBCAM_READER_HPP
#define OPENPOSE_PRODUCER_WEBCAM_READER_HPP
#include <atomic>
#include <mutex>
#include <openpose/core/common.hpp>
#include <openpose/producer/videoCaptureReader.hpp>
namespace op
{
class OP_API WebcamReader : public VideoCaptureReader
{
public:
explicit WebcamReader(const int webcamIndex = 0, const Point<int>& webcamResolution = Point<int>{},
const double fps = 30., const bool throwExceptionIfNoOpened = true);
virtual ~WebcamReader();
std::vector<cv::Mat> getCameraMatrices();
std::vector<cv::Mat> getCameraExtrinsics();
std::vector<cv::Mat> getCameraIntrinsics();
std::string getNextFrameName();
bool isOpened() const;
double get(const int capProperty);
void set(const int capProperty, const double value);
private:
const int mIndex;
double mFps;
long long mFrameNameCounter;
bool mThreadOpened;
cv::Mat mBuffer;
std::mutex mBufferMutex;
std::atomic<bool> mCloseThread;
std::thread mThread;
// Detect camera unplugged
double mLastNorm;
std::atomic<int> mDisconnectedCounter;
Point<int> mResolution;
cv::Mat getRawFrame();
std::vector<cv::Mat> getRawFrames();
void bufferingThread();
bool reset();
DELETE_COPY(WebcamReader);
};
}
#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