Mat (Matrix) is an n-dimensional array that can be used to store various type of data, such as RGB, HSV or grayscale images, vectors with real or complex values, other matrices etc.
A Mat contains the following information: width, height, type, channels, data, flags, datastart, dataend and so on.
...