OpenCV  4.0.0-pre
Open Source Computer Vision
Looking for a C++ dev who knows OpenCV?
I'm looking for work. Hire me!

Matrix elements are stored row by row. More...

#include "types_c.h"

Collaboration diagram for CvMat:

Public Member Functions

 CvMat ()
 
 CvMat (const cv::Mat &m)
 

Public Attributes

union {
   int   height
 
   int   rows
 
}; 
 
union {
   int   cols
 
   int   width
 
}; 
 
union {
   double *   db
 
   float *   fl
 
   int *   i
 
   uchar *   ptr
 
   short *   s
 
data
 
int hdr_refcount
 
int * refcount
 
int step
 
int type
 

Detailed Description

Matrix elements are stored row by row.

Element (i, j) (i - 0-based row index, j - 0-based column index) of a matrix can be retrieved or modified using CV_MAT_ELEM macro:

uchar pixval = CV_MAT_ELEM(grayimg, uchar, i, j)
CV_MAT_ELEM(cameraMatrix, float, 0, 2) = image.width*0.5f;

To access multiple-channel matrices, you can use CV_MAT_ELEM(matrix, type, i, j*nchannels + channel_idx).

Deprecated:
CvMat is now obsolete; consider using Mat instead.
Examples:
samples/cpp/polar_transforms.cpp.

Constructor & Destructor Documentation

◆ CvMat() [1/2]

CvMat::CvMat ( )
inline

◆ CvMat() [2/2]

CvMat::CvMat ( const cv::Mat m)
inline

References cvMat().

Here is the call graph for this function:

Member Data Documentation

◆ @83

union { ... }

◆ @85

union { ... }

◆ cols

int CvMat::cols

Referenced by cvMat(), cvmGet(), and cvmSet().

◆ data

union { ... } CvMat::data

Referenced by cvDecRefData(), cvMat(), cvmGet(), and cvmSet().

◆ db

double* CvMat::db

◆ fl

float* CvMat::fl

◆ hdr_refcount

int CvMat::hdr_refcount

Referenced by cvMat().

◆ height

int CvMat::height

◆ i

int* CvMat::i

◆ ptr

uchar* CvMat::ptr

Referenced by cvDecRefData(), cvMat(), cvmGet(), and cvmSet().

◆ refcount

int* CvMat::refcount

Referenced by cvDecRefData(), cvIncRefData(), and cvMat().

◆ rows

int CvMat::rows

Referenced by cvMat(), cvmGet(), and cvmSet().

◆ s

short* CvMat::s

◆ step

int CvMat::step

Referenced by cvMat(), cvmGet(), and cvmSet().

◆ type

int CvMat::type

Referenced by cvMat(), cvmGet(), and cvmSet().

◆ width

int CvMat::width

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