OpenPose  1.7.0
The first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints
op::Matrix Class Reference

#include <matrix.hpp>

Public Member Functions

 Matrix ()
 
 Matrix (const void *cvMatPtr)
 
 Matrix (const int rows, const int cols, const int type)
 
 Matrix (const int rows, const int cols, const int type, void *cvMatPtr)
 
Matrix clone () const
 
void * getCvMat ()
 
const void * getConstCvMat () const
 
unsigned char * data ()
 
const unsigned char * dataConst () const
 
unsigned char * dataPseudoConst () const
 
int cols () const
 
int rows () const
 
int size (const int dimension) const
 
int dims () const
 
bool isContinuous () const
 
bool isSubmatrix () const
 
size_t elemSize () const
 
size_t elemSize1 () const
 
int type () const
 
int depth () const
 
int channels () const
 
size_t step1 (const int i=0) const
 
bool empty () const
 
size_t total () const
 
int checkVector (const int elemChannels, const int depth=-1, const bool requireContinuous=true) const
 
void setTo (const double value)
 
void copyTo (Matrix &outputMat) const
 

Static Public Member Functions

static void splitCvMatIntoVectorMatrix (std::vector< Matrix > &matrixesResized, const void *const cvMatPtr)
 
static Matrix eye (const int rows, const int cols, const int type)
 

Detailed Description

Matrix: Bind of cv::Mat to avoid OpenCV as dependency in the headers.

Definition at line 95 of file matrix.hpp.

Constructor & Destructor Documentation

◆ Matrix() [1/4]

op::Matrix::Matrix ( )

◆ Matrix() [2/4]

op::Matrix::Matrix ( const void *  cvMatPtr)
explicit
Parameters
cvMatPtrshould be a cv::Mat element or it will provoke a core dumped. Done to avoid explicitly exposing 3rdparty libraries on the headers.

◆ Matrix() [3/4]

op::Matrix::Matrix ( const int  rows,
const int  cols,
const int  type 
)
explicit

Analog to cv::Mat(int rows, int cols, int type, void *data, size_t step=AUTO_STEP)

◆ Matrix() [4/4]

op::Matrix::Matrix ( const int  rows,
const int  cols,
const int  type,
void *  cvMatPtr 
)
explicit

Analog to cv::Mat(int rows, int cols, int type, void *data, size_t step=AUTO_STEP) Very important: This Matrix will only "borrow" this pointer, so the caller must make sure to maintain the memory allocated until this Matrix destructor is called and also to handle the ucharPtr memory deallocation.

Parameters
ucharPtrshould be a cv::Mat::data (or analog) element or it will provoke a core dumped. Done to avoid explicitly exposing 3rdparty libraries on the headers.

Member Function Documentation

◆ channels()

int op::Matrix::channels ( ) const

◆ checkVector()

int op::Matrix::checkVector ( const int  elemChannels,
const int  depth = -1,
const bool  requireContinuous = true 
) const

◆ clone()

Matrix op::Matrix::clone ( ) const

◆ cols()

int op::Matrix::cols ( ) const

Equivalent to cv::Mat::cols

◆ copyTo()

void op::Matrix::copyTo ( Matrix outputMat) const

◆ data()

unsigned char* op::Matrix::data ( )

Equivalent to cv::Mat::data

Returns
A raw pointer to the internal data of cv::Mat.

◆ dataConst()

const unsigned char* op::Matrix::dataConst ( ) const

Equivalent to cv::Mat::data

Returns
A raw pointer to the internal data of cv::Mat.

◆ dataPseudoConst()

unsigned char* op::Matrix::dataPseudoConst ( ) const

Similar to dataConst(), but it allows the data to be edited. This function is only implemented for Pybind11 usage.

Returns
A raw pointer to the internal data of cv::Mat.

◆ depth()

int op::Matrix::depth ( ) const

◆ dims()

int op::Matrix::dims ( ) const

Equivalent to cv::Mat::dims

◆ elemSize()

size_t op::Matrix::elemSize ( ) const

◆ elemSize1()

size_t op::Matrix::elemSize1 ( ) const

◆ empty()

bool op::Matrix::empty ( ) const

◆ eye()

static Matrix op::Matrix::eye ( const int  rows,
const int  cols,
const int  type 
)
static

Equivalent to cv::Mat::eye

◆ getConstCvMat()

const void* op::Matrix::getConstCvMat ( ) const
Returns
const cv::Mat*.

◆ getCvMat()

void* op::Matrix::getCvMat ( )
Returns
cv::Mat*.

◆ isContinuous()

bool op::Matrix::isContinuous ( ) const

Equivalent to their analog cv::Mat functions

◆ isSubmatrix()

bool op::Matrix::isSubmatrix ( ) const

◆ rows()

int op::Matrix::rows ( ) const

Equivalent to cv::Mat::rows

◆ setTo()

void op::Matrix::setTo ( const double  value)

Similar to their analog cv::Mat functions

◆ size()

int op::Matrix::size ( const int  dimension) const

Equivalent to cv::Mat::size[dimension]

◆ splitCvMatIntoVectorMatrix()

static void op::Matrix::splitCvMatIntoVectorMatrix ( std::vector< Matrix > &  matrixesResized,
const void *const  cvMatPtr 
)
static
Parameters
matrixesResizedFor 3-D OpenPose, if >1, it will assume the image is composed of numberImagesStackedHorizontally horizontally stacked images. It must be already resized to avoid internally allocating/removing elements of std::vector (to avoid errors if using different std DLLs)
cvMatPtrshould be a cv::Mat element or it will provoke a core dumped. Done to avoid explicitly exposing 3rdparty libraries on the headers.

◆ step1()

size_t op::Matrix::step1 ( const int  i = 0) const

◆ total()

size_t op::Matrix::total ( ) const

◆ type()

int op::Matrix::type ( ) const

The documentation for this class was generated from the following file: