We have such an example from openCV documentation:
Mat img(height, width, CV_8UC3, pixels, step); GaussianBlur(img, img, Size(7,7), 1.5, 1.5);
What does it mean?
Lets say I have an image img:
typedef unsigned char BYTE; BYTE * img = new BYTE[ w * h ];
Lets assume the image is scanned line by line. So
img[ 10 * w + 3 ] is a 3-rd pixel in 10-line of image.
Then I import it in openCV is such a way:
Mat img(h, w, CV_8UC1, dmDst, w);last argument is a pitch or stride.