Ask Your Question

Revision history [back]

Why would you go by all this trouble if Mat already has a field contain its data in the form of an unsigned char?

cv::Mat test;

test = imread("somepath");

unsigned char* dataMat = test.data;

Now, dataMat is pointing to the first element of test's pixel data.

Why would you go by all this trouble if Mat already has a field contain its data in the form of an unsigned char?char*?

cv::Mat test;

test = imread("somepath");

unsigned char* dataMat = test.data;

Now, dataMat is pointing to the first element of test's pixel data.