OpenPose  1.7.0
The first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints
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 
5 
6 namespace op
7 {
9  {
10  public:
12 
14 
15  // cameraExtrinsics is optional
16  explicit CameraParameterReader(const std::string& serialNumber,
17  const Matrix& cameraIntrinsics,
18  const Matrix& cameraDistortion,
19  const Matrix& cameraExtrinsics = Matrix(),
20  const Matrix& cameraExtrinsicsInitial = Matrix());
21 
22  // serialNumbers is optional. If empty, it will load all the XML files available in the
23  // cameraParameterPath folder
24  void readParameters(const std::string& cameraParameterPath,
25  const std::vector<std::string>& serialNumbers = {});
26 
27  // It simply calls the previous readParameters with a single element
28  void readParameters(const std::string& cameraParameterPath,
29  const std::string& serialNumber);
30 
31  void writeParameters(const std::string& cameraParameterPath) const;
32 
33  unsigned long long getNumberCameras() const;
34 
35  const std::vector<std::string>& getCameraSerialNumbers() const;
36 
37  const std::vector<Matrix>& getCameraMatrices() const;
38 
39  const std::vector<Matrix>& getCameraDistortions() const;
40 
41  const std::vector<Matrix>& getCameraIntrinsics() const;
42 
43  const std::vector<Matrix>& getCameraExtrinsics() const;
44 
45  const std::vector<Matrix>& getCameraExtrinsicsInitial() const;
46 
47  bool getUndistortImage() const;
48 
49  void setUndistortImage(const bool undistortImage);
50 
51  void undistort(Matrix& frame, const unsigned int cameraIndex = 0u);
52 
53  private:
54  // PIMPL idiom
55  // http://www.cppsamples.com/common-tasks/pimpl.html
56  struct ImplCameraParameterReader;
57  std::shared_ptr<ImplCameraParameterReader> spImpl;
58 
60  };
61 }
62 
63 #endif // OPENPOSE_3D_CAMERA_PARAMETER_READER_HPP
void readParameters(const std::string &cameraParameterPath, const std::string &serialNumber)
bool getUndistortImage() const
const std::vector< Matrix > & getCameraIntrinsics() const
void writeParameters(const std::string &cameraParameterPath) const
const std::vector< Matrix > & getCameraExtrinsics() const
const std::vector< Matrix > & getCameraExtrinsicsInitial() const
unsigned long long getNumberCameras() const
const std::vector< Matrix > & getCameraDistortions() const
void readParameters(const std::string &cameraParameterPath, const std::vector< std::string > &serialNumbers={})
const std::vector< Matrix > & getCameraMatrices() const
CameraParameterReader(const std::string &serialNumber, const Matrix &cameraIntrinsics, const Matrix &cameraDistortion, const Matrix &cameraExtrinsics=Matrix(), const Matrix &cameraExtrinsicsInitial=Matrix())
const std::vector< std::string > & getCameraSerialNumbers() const
void setUndistortImage(const bool undistortImage)
void undistort(Matrix &frame, const unsigned int cameraIndex=0u)
#define OP_API
Definition: macros.hpp:18
#define DELETE_COPY(className)
Definition: macros.hpp:32