1 #ifndef OPENPOSE_CORE_MAT_HPP
2 #define OPENPOSE_CORE_MAT_HPP
13 #define OP_OP2CVMAT(opMat) \
14 (*((cv::Mat*)((opMat).getCvMat())))
20 #define OP_OP2CVCONSTMAT(opMat) \
21 (*((cv::Mat*)((opMat).getConstCvMat())))
27 #define OP_CV2OPMAT(cvMat) \
28 (op::Matrix((void*)&(cvMat)))
34 #define OP_CV2OPCONSTMAT(cvMat) \
35 (op::Matrix((const void*)&(cvMat)))
42 #define OP_OP2CVVECTORMAT(cvMats, opMats) \
43 std::vector<cv::Mat> cvMats; \
44 for (auto& opMat : (opMats)) \
46 const auto cvMat = OP_OP2CVCONSTMAT(opMat); \
47 cvMats.emplace_back(cvMat); \
55 #define OP_CV2OPVECTORMAT(opMats, cvMats) \
56 std::vector<op::Matrix> opMats; \
57 for (auto& cvMat : (cvMats)) \
59 const auto opMat = OP_CV2OPMAT(cvMat); \
60 opMats.emplace_back(opMat); \
71 #define OP_MAT_VOID_FUNCTION(opMat, function) \
73 cv::Mat cvMat = OP_OP2CVMAT(cvMat, opMat); \
76 #define OP_CONST_MAT_VOID_FUNCTION(opMat, function) \
78 const cv::Mat cvMat = OP_OP2CVCONSTMAT(opMat); \
81 #define OP_MAT_RETURN_FUNCTION(outputVariable, opMat, function) \
83 cv::Mat cvMat = OP_OP2CVMAT(cvMat, opMat); \
84 outputVariable = cvMat.function; \
86 #define OP_CONST_MAT_RETURN_FUNCTION(outputVariable, opMat, function) \
88 const cv::Mat cvMat = OP_OP2CVCONSTMAT(opMat); \
89 outputVariable = cvMat.function; \
118 explicit Matrix(
const int rows,
const int cols,
const int type);
127 explicit Matrix(
const int rows,
const int cols,
const int type,
void* cvMatPtr);
161 static Matrix eye(
const int rows,
const int cols,
const int type);
173 int size(
const int dimension)
const;
189 size_t step1(
const int i = 0)
const;
192 int checkVector(
const int elemChannels,
const int depth = -1,
const bool requireContinuous =
true)
const;
204 std::shared_ptr<ImplMatrix> spImpl;
static void splitCvMatIntoVectorMatrix(std::vector< Matrix > &matrixesResized, const void *const cvMatPtr)
const void * getConstCvMat() const
size_t step1(const int i=0) const
Matrix(const int rows, const int cols, const int type, void *cvMatPtr)
void copyTo(Matrix &outputMat) const
Matrix(const int rows, const int cols, const int type)
int checkVector(const int elemChannels, const int depth=-1, const bool requireContinuous=true) const
static Matrix eye(const int rows, const int cols, const int type)
int size(const int dimension) const
const unsigned char * dataConst() const
unsigned char * dataPseudoConst() const
void setTo(const double value)
bool isContinuous() const
Matrix(const void *cvMatPtr)