![]() The pseudo color image has 8 bits per pixel, ranging from 0-255. It has color palette, and the pixel value is the entry of table item. The value of each pixel is not 0 or 1.Įach pixel of gray image is 8 bit, ranging from 0 to 255. 8-bit grayscale file information header + picture information header + palette + bitmap data (that is, the image with the effect found by the black-and-white camera)īinary image (also known as single value image) has one bit per pixel, i.e.24 bit true color picture file header + picture header + bitmap data (the kind of picture you usually see).What? I don't understand after saying so much? Images with more than 16 bits do not have color palette, only need to convert image data into the same gray value according to the number of bits of each pointįor images below 16 bits, you need to modify the value of the palette, and modify the gray value index according to the number of bits occupied by each point. Therefore, we need to convert it into gray-scale image and store it into a visible image as follows: When the color is converted to grayscale, the corresponding value is calculated according to the formula, which is actually the brightness level the brightness is from 0 to 255 because different bits have different brightness levels, the specific value of Y is as follows: y = Y / (1 < (8-converted digits)) When converted to 1 bit, two colors in the palette, 0 and 255, represent black and white. When it is converted to 2 bits, there are 4 colors in the palette, with equal interval of 255 colors, and the three components are equal. When it is converted to 4 bits, 16 colors in the palette are equally divided into 255 color values at equal intervals, and all three components are equal. When converted to 8 bits, there are 256 colors in the palette, each from exactly 0 to 255, with three equal components. As we mentioned earlier, the three components of a grayscale image are equal. First, we need to determine the specific color value of the palette. There is a palette in the gray-scale image. So how to convert color image to gray image? 16 bit or more images use pixels to represent colors directly. In WINDOWS, the graph that represents more than 16 bits is a little different from the graph that represents less than 16 bits the graph that represents less than 16 bits uses a palette to select a specific color, each unit of the palette is 4 bytes, one of which is transparent the specific pixel value stores an index, which is 1, 2, 4, 8 bits respectively. 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. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |