Uniform Color Quantization

download Uniform Color Quantization

of 5

Transcript of Uniform Color Quantization

  • 7/29/2019 Uniform Color Quantization

    1/5

    Uniform ColorQuantization

    Pi19404

    February 12, 2013

  • 7/29/2019 Uniform Color Quantization

    2/5

    Contents

    Contents

    0.1 Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .0.2 Uniform Color Quantization . . . . . . . . . . . . . . . . . . . .0.3 Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

  • 7/29/2019 Uniform Color Quantization

    3/5

    Uniform Color Quantization

    Uniform Color Quantization

    0.1 AbstractIn Image processing Color Quantization refers to the process ofreducing the number of distinct colors used in the image withoutdistorting the original image . Color Quantization can be usedfor purposes of image compression or is the first step in image

    segmentation applications.

    0.2 Uniform Color QuantizationWe will work with 8 bit images.Each pixel is represented by a valuebetween 0 and 256.Uniform Color quantizations reduces the numberof colors such the interval is divided into equal segments. Each segment defines a color region and pixels than fall withinthe interval are assigned to the color region. For example if we

    are required to reduce the number of levels to 4 the followingintervals are obtained . This any pixelin the input image with value between 0-63 is assigned to region1 any pixel in input image with value between 64-127 is assignedto region 2 and so on. A simple way to perform this mapping isto divide the pixel values by 256/4. and floor the floating pointvalues. all the pixels in range 0-63 will produce value 0 ,all thepixels in the range 64-127 will produce value 1 ,128-191 will producevalue 2 and 192-255 will produce a value 3.If we again mutiply these

    labeled values by 64 we get an image with pixel values 0,64,128,192.If Number of Distinct Colors Requires are N(Interval Length) div=(Transformation) Output

    The disadvantage of uniform quantization is that some pixels nearsome color levels may be largely represented in image than otherpixels. For example if image contains only pixel values in the range0-64. The interval levels will be still configured as 0,64,128,192.

    Another option is to choose the largest integral multiple of number

  • 7/29/2019 Uniform Color Quantization

    4/5

    Uniform Color Quantization

    (a) Image (b) Quantized

    (c) Image (d) Quantized

    Figure 1: Uniform Color Quantized 1

    of division greater than of equal to the largest pixel value presentin the image.

    If Number of Distinct Colors Requires are N(Interval Length) div=(Transformation) Output

    (a) Image (b) Quantized

    (c) Image (d) Quantized

    Figure 2: Uniform Color Quantized 2

  • 7/29/2019 Uniform Color Quantization

    5/5

    Uniform Color Quantization

    0.3 CodeOpenCV libraries are used for image processing . Code is avail-able in repository

    https://code.google.com/p/m19404/source/browse/ColorQuantization/https://code.google.com/p/m19404/source/browse/ColorQuantization/