Learning Opencv_1: Interpretation of channels and grayscale

Source: Internet
Author: User
On the interpretation of the channel:

1, the more understandable explanation is: gray-scale channel number of 1, color map of the channel is 3. Basically, the description of a pixel, if it is grayscale, then only need a number to describe it, is a single channel. If a pixel, there are RGB three colors to describe it, is three channels.

2, 4 channels are usually rgba and may be used in some processing. 2-channel images are uncommon, usually used in program processing, such as Fourier transform, may be used, a channel is real, a channel for imaginary numbers, mainly programming convenience. There is also a situation is 16-bit image, is 3 channels, but in order to reduce the amount of data, compressed to 16 bits, just two channels, common format has RGB555 or RGB565, that is, R accounted for 5, G accounted for 5 or 6, B accounted for 5, there are RGBA5551 format. Old format, no need to worry about.

3, mainly some cameras often use some more "odd" format, there is no way. Add a situation, the current common some of the cameras like the use of YUV2 format, the format below Yuyv, in the process can be used 4 channels or 2 channels to deal with. If the original format is: Y1UY2V, the interpolation becomes y1uv,y2uv into two colored dots. YCRCB also has similar compression.

Interpretation of Grayscale:

Description of a pixel, if it is grayscale, then only need a number to describe it, is a single channel. If a pixel, there are RGB three colors to describe it, is the three channels
Windows BMP is sometimes a four-channel image, R, G, B plus a channel, representing transparency (vblittleboy)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.