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
cameraParameterReader.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_3D_CAMERA_PARAMETER_READER_HPP
2 #define OPENPOSE_3D_CAMERA_PARAMETER_READER_HPP
3
4 #include <opencv2/core/core.hpp>
5 #include <openpose/core/common.hpp>
6
7 namespace op
8 {
9 class OP_API CameraParameterReader
10 {
11 public:
12 explicit CameraParameterReader();
13
14 virtual ~CameraParameterReader();
15
16 // cameraExtrinsics is optional
17 explicit CameraParameterReader(const std::string& serialNumber,
18 const cv::Mat& cameraIntrinsics,
19 const cv::Mat& cameraDistortion,
20 const cv::Mat& cameraExtrinsics = cv::Mat(),
21 const cv::Mat& cameraExtrinsicsInitial = cv::Mat());
22
23 // serialNumbers is optional. If empty, it will load all the XML files available in the
24 // cameraParameterPath folder
25 void readParameters(const std::string& cameraParameterPath,
26 const std::vector<std::string>& serialNumbers = {});
27
28 // It simply calls the previous readParameters with a single element
29 void readParameters(const std::string& cameraParameterPath,
30 const std::string& serialNumber);
31
32 void writeParameters(const std::string& cameraParameterPath) const;
33
34 unsigned long long getNumberCameras() const;
35
36 const std::vector<std::string>& getCameraSerialNumbers() const;
37
38 const std::vector<cv::Mat>& getCameraMatrices() const;
39
40 const std::vector<cv::Mat>& getCameraDistortions() const;
41
42 const std::vector<cv::Mat>& getCameraIntrinsics() const;
43
44 const std::vector<cv::Mat>& getCameraExtrinsics() const;
45
46 const std::vector<cv::Mat>& getCameraExtrinsicsInitial() const;
47
48 bool getUndistortImage() const;
49
50 void setUndistortImage(const bool undistortImage);
51
52 void undistort(cv::Mat& frame, const unsigned int cameraIndex = 0u);
53
54 private:
55 std::vector<std::string> mSerialNumbers;
56 std::vector<cv::Mat> mCameraMatrices;
57 std::vector<cv::Mat> mCameraDistortions;
58 std::vector<cv::Mat> mCameraIntrinsics;
59 std::vector<cv::Mat> mCameraExtrinsics;
60 std::vector<cv::Mat> mCameraExtrinsicsInitial;
61
62 // Undistortion (optional)
63 bool mUndistortImage;
64 std::vector<cv::Mat> mRemoveDistortionMaps1;
65 std::vector<cv::Mat> mRemoveDistortionMaps2;
66
67 DELETE_COPY(CameraParameterReader);
68 };
69 }
70
71 #endif // OPENPOSE_3D_CAMERA_PARAMETER_READER_HPP
DELETE_COPY
#define DELETE_COPY(className)
Definition: macros.hpp:34
common.hpp
op::CameraParameterReader
Definition: cameraParameterReader.hpp:9
OP_API
#define OP_API
Definition: macros.hpp:19
cl::string
std::string string
Definition: cl2.hpp:574