![]() ![]() The actual pixel values are denoted by the centers of the x's.įigure 13-2: Uniform Quantization on a Slice of the RGB Color CubeĪfter the color cube has been divided, all empty boxes are thrown out. For clarity, the figure shows a two-dimensional slice (or color plane) from the color cube where Red=0, and Green and Blue range from 0 to 255. The commands below perform uniform quantization with a tolerance of 0.1.įigure 13-2 illustrates uniform quantization of a uint8 image. For example, if you specify a tolerance of 0.1, the edges of the boxes are one-tenth the length of the RGB color cube and the maximum total number of boxes is The allowable range for a tolerance setting is. The tolerance determines the size of the cube-shaped boxes into which the RGB color cube is divided. To perform uniform quantization, call rgb2ind and specify a tolerance. With minimum variance quantization, the color cube is cut up into boxes (not necessarily cubes) of different sizes the sizes of the boxes depend on how the colors are distributed in the image. With uniform quantization, the color cube is cut up into equal-sized boxes (smaller cubes). Uniform quantization and minimum variance quantization differ in the approach used to divide up the RGB color cube. ![]() Quantization involves dividing the RGB color cube into a number of smaller boxes, and then mapping all colors that fall within each box to the color value at the center of that box. Figure 13-1, below, shows an RGB color cube for a uint8 image.įigure 13-1: RGB Color Cube for uint8 Images The difference is that the double RGB color cube has many more shades of red (and many more shades of all colors). In other words, the brightest red in an uint8 RGB image displays the same as the brightest red in a double RGB image. The uint8, uint16, and double color cubes all have the same range of colors. This color cube is the same for all uint8 RGB images, regardless of which colors they actually use. For example, if an RGB image is of class uint8, 256 values are defined for each color plane (red, blue, and green), and, in total, there will be 2 24 (or 16,777,216) colors defined by the color cube. Since RGB images in MATLAB can be of type uint8, uint16, or double, three possible color cube definitions exist. The RGB color cube is a three-dimensional array of all of the colors that are defined for a particular data type. rgb2ind supports two quantization methods: uniform quantization and minimum variance quantization.Īn important term in discussions of image quantization is RGB color cube, which is used frequently throughout this section. The function rgb2ind uses quantization as part of its color reduction algorithm. Reducing the number of colors in an image involves quantization. See Dithering for a description of dithering and how to enable or disable it. Note that different methods work better for different images. The quality of the resulting image depends on the approximation method you use, the range of colors in the input image, and whether or not you use dithering. This function provides the following methods for approximating the colors in the original image: Rgb2ind converts an RGB image to an indexed image, reducing the number of colors in the process. ![]() Color (Image Processing Toolbox) Image Processing Toolbox ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |