Skip to content

Lookup table of OpenCV Mat type

The form of OpenCV Mat data type is generally CV_<bit_depth>(S|U|F)C<number_of_channels>, and their respective meanings are as follows:

  • bit_depth: Number of bits, representing the number of pixels in the image, that is, pixel depth, such as 8bite, 16bites, 32bites, 64bites.
  • S|U|F: S represents signed int signed integer. U stands for unsigned int unsigned integer. F stands for float single precision floating point type.
  • C<number_of_channels>: represents the number of channels of an image, such as:
  • channels = 1: grayscale image. is a single channel image.
  • channels=3: RGB color image. is a 3 channel image.
  • channels = 4: RGB image with alpha channel, representing transparency. is a 4-channel image.

For example: CV_8U represents 8 pixels, unsigned data, single channel format.

The following is a lookup table of OpenCV Mat type value:

C1C2C3C4C5C6C7C8
CV_8U08162432404856
CV_8S19172533414957
CV_16U210182634425058
CV_16S311192735435159
CV_32S412202836445260
CV_32F513212937455361
CV_64F614223038465462
CV_16F715233139475563
Leave a Reply