The Gray conversion formula from RGB to YUV space is: Only Y component can represent a gray-scale image. Y component contains all the information of gray-scale image. In this representation method, the physical meaning of Y component is brightness. In TV signal, we use a kind of color representation similar to YUV. In the method of representing color, in addition to RGB, there is also a method called YUV, which has many applications. It is usually divided into 256 levels from 0 to 255, of which 0 is the darkest (all black) and 255 is the brightest (all white). Therefore, in order to represent the gray-scale image, it is necessary to quantify the brightness value. Gray scale image refers to an image with only brightness information and no color information, just like the black-and-white photos we usually see: the brightness changes continuously from dark to light. Then the image data is followed (24 bitmaps are real image data, others are index data of palette). An array of RGBQUAD type, whose length is determined by BITMAPINFOHEADER.biClrUsed. If it is an 8-bit (256 colors), 4-bit (16 colors) and 1-bit (monochrome) graph, the palette data is immediately followed.If it is a 24 bit true color image, each point is represented by three bytes R/G/B respectively, so the color information of the image is directly followed here.We know that the color bitmap is composed of three components of R/G/B, and its file storage format isīITMAPFILEHEADER+BITMAPINFOHEADER, followed by: The principle of color image conversion to gray image is as follows: In image processing, most of the processing methods need to convert color image into gray image in advance to carry out relevant calculation and recognition. C language removes the background of bmp picture
0 Comments
Leave a Reply. |