OpenCV  3.2.0-dev
Open Source Computer Vision

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

#include "types_c.h"

Collaboration diagram for CvMat:

Public Member Functions

 CvMat ()
 
 CvMat (const CvMat &m)
 
 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.

Constructor & Destructor Documentation

CvMat::CvMat ( )
inline
CvMat::CvMat ( const CvMat m)
inline

Member Data Documentation

union { ... }
union { ... }
int CvMat::cols

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

union { ... } CvMat::data

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

double* CvMat::db
float* CvMat::fl
int CvMat::hdr_refcount

Referenced by cvMat().

int CvMat::height
int* CvMat::i
uchar* CvMat::ptr

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

int* CvMat::refcount

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

int CvMat::rows

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

short* CvMat::s
int CvMat::step

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

int CvMat::type

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

int CvMat::width

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