Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi, from IplImage and Mat documentations :

char* IplImage::imageData Pointer to aligned image data.

class CV_EXPORTS Mat { public: ... //! pointer to the data uchar* data; .... };

If you what pixel access to Mat u can use pointer : Mat image; uchar* ptr = image.data(); ( use uchar type of pointer for type of Mat like CV_8UC1 ) IplImage.imagedata[0] equivalent to ptr[0] Note that if its a color Mat with 3 channels pixels are saved in data sequentially ( BGRBGR...). or at method : Mat::at(int i, int j) where i – Index along the dimension 0, j – Index along the dimension 1

Hi, from IplImage and Mat documentations :

char* IplImage::**imageData**

char* IplImage::imageData Pointer to aligned image data.

class CV_EXPORTS Mat
{
public:
    ...
    //! pointer to the data
    uchar* data; **uchar* data;**
    ....
};

};

If you what pixel access to Mat u can use pointer : :

Mat image;
uchar* ptr = image.data(); image.data();

( use uchar type of pointer for type of Mat like CV_8UC1 ) IplImage.imagedata[0] )

IplImage.imagedata[0] equivalent to ptr[0] ptr[0]

Note that if its a color Mat with 3 channels pixels are saved in data sequentially ( BGRBGR...).

or at method : : Mat::at(int i, int j) j) where i – Index along the dimension 0, j – Index along the dimension 1

Hi, from IplImage and Mat documentations :

char* IplImage::**imageData**

Pointer IplImage::**imageData //Pointer to aligned image data.

class CV_EXPORTS Mat
{
public:
    ...
    //! pointer to the data
    **uchar* data;**
    ....
};

If you what pixel access to Mat u can use pointer :

Mat image;
uchar* ptr = image.data();

( use uchar type of pointer for type of Mat like CV_8UC1 )

IplImage.imagedata[0] equivalent to ptr[0]

Note that if its a color Mat with 3 channels pixels are saved in data sequentially ( BGRBGR...).

or at method : Mat::at(int i, int j) where i – Index along the dimension 0, j – Index along the dimension 1