The data.h header provides definitions of OpenDR data types that can be used in the C API of OpenDR.
struct OpenDRImage {
void *data;
};
typedef struct OpenDRImage OpenDRImageT;
The OpenDRImageT structure provides a data structure for storing OpenDR images. Every function in the C API receiving images is expected to use this structure. Helper functions that directly convert images into this format are provided in opendr_utils.h.
The OpenDRImageT structure has the following field:
A pointer where image data are stored. OpenDRImageT is internally using OpenCV images (cv::Mat) for storing images. Therefore, only a pointer to the memory location of the corresponding cv::Mat is stored. Please note that the user is not expected to directly manipulate these data without first converting them into OpenCV data type or using the corresponding functions provided in OpenDR_utils.h.
struct OpenDRTensor {
int batchSize;
int frames;
int channels;
int width;
int height;
float *data;
};
typedef struct OpenDRTensor OpenDRTensorT;
The OpenDRTensorT structure provides a data structure for storing OpenDR tensors. Every function in the C API receiving and returning tensors is expected to use this structure. Helper functions that directly maps data into this format are provided in opendr_utils.h.
The OpenDRTensorT structure has the following field:
An integer that represents the number of the batch size in the tensor.
An integer that represents the number of frames in the tensor.
An integer that represents the number of channels in the tensor.
An integer that represents the width of the tensor.
An integer that represents the height of the tensor.
A pointer where data are stored. OpenDRTensorT is internally using a pointer and corresponding sizes to copy the data into the memory of float *data. Therefore, only a pointer to the memory location of the corresponding data is stored. Please note that the user is not expected to directly manipulate this data without first converting it into OpenCV cv::Mat or other form of data type or using the corresponding functions provided in opendr_utils.h.
struct OpenDRTensorVector {
int nTensors;
int *batchSizes;
int *frames;
int *channels;
int *widths;
int *heights;
float **memories;
};
typedef struct OpenDRTensorVector OpenDRTensorVectorT;
The OpenDRTensorVectorT structure provides a data structure for storing OpenDR vector of tensors structures. Every function in the C API receiving and returning multiple tensors is expected to use this structure. Helper functions that directly maps data into this format are provided in opendr_utils.h.
The OpenDRTensorVectorT structure has the following field:
An integer that represents the number of tensors in the vector of tensors.
A pointer of integers that represents the batch size of each tensor.
A pointer of integers that represents the number of frames in each tensor.
A pointer of integers that represents the number of channels in each tensor.
A pointer of integers that represents the width of each tensor.
A pointer of integers that represents the height of each tensor.
A pointer where stores the data of each OpenDRTensorVectorT.data stored in the vector. OpenDRTensorVectorT is internally using pointers and corresponding sizes to copy the data into the memory of datas for each tensor that is provided. Therefore, only a pointer to the memory location of the corresponding data is stored. Please note that the user is not expected to directly manipulate this data without first converting it into OpenCV cv::Mat or other form of data type or using the corresponding functions provided in opendr_utils.h.