File size: 1,451 Bytes
7fc5a59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef OPENPOSE_PRODUCER_IP_CAMERA_READER_HPP
#define OPENPOSE_PRODUCER_IP_CAMERA_READER_HPP

#include <openpose/core/common.hpp>
#include <openpose/producer/videoCaptureReader.hpp>

namespace op
{
    /**
     * IpCameraReader is a wrapper of the cv::VideoCapture class for IP camera streaming.
     */
    class OP_API IpCameraReader : public VideoCaptureReader
    {
    public:
        /**
         * Constructor of IpCameraReader. It opens the IP camera as a wrapper of cv::VideoCapture.
         * @param cameraPath const std::string parameter with the full camera IP link.
         */
        explicit IpCameraReader(const std::string& cameraPath, const std::string& cameraParameterPath = "",
                                const bool undistortImage = false);

        virtual ~IpCameraReader();

        std::string getNextFrameName();

        inline bool isOpened() const
        {
            return VideoCaptureReader::isOpened();
        }

        inline double get(const int capProperty)
        {
            return VideoCaptureReader::get(capProperty);
        }

        inline void set(const int capProperty, const double value)
        {
            VideoCaptureReader::set(capProperty, value);
        }

    private:
        const std::string mPathName;

        Matrix getRawFrame();

        std::vector<Matrix> getRawFrames();

        DELETE_COPY(IpCameraReader);
    };
}

#endif // OPENPOSE_PRODUCER_IP_CAMERA_READER_HPP