Spherical K-Means Color Image Compression Tim Pavlik

Similar documents
IMAGE PROCESSING >COLOR SPACES UTRECHT UNIVERSITY RONALD POPPE

Lecture 8. Color Image Processing

Prof. Feng Liu. Fall /02/2018

Computer Graphics. Si Lu. Fall er_graphics.htm 10/02/2015

Fig Color spectrum seen by passing white light through a prism.

Color: Readings: Ch 6: color spaces color histograms color segmentation

Introduction to Color Theory

Color. Used heavily in human vision. Color is a pixel property, making some recognition problems easy

Digital Image Processing. Lecture # 8 Color Processing

Digital Image Processing. Lecture # 6 Corner Detection & Color Processing

IMAGES AND COLOR. N. C. State University. CSC557 Multimedia Computing and Networking. Fall Lecture # 10

Computers and Imaging

RGB COLORS. Connecting with Computer Science cs.ubc.ca/~hoos/cpsc101

Hello, welcome to the video lecture series on Digital image processing. (Refer Slide Time: 00:30)

Color. Used heavily in human vision. Color is a pixel property, making some recognition problems easy

How to define the colour ranges for an automatic detection of coloured objects

Image and video processing (EBU723U) Colour Images. Dr. Yi-Zhe Song

Templates and Image Pyramids

Image Enhancement (from Chapter 13) (V6)

Imaging Process (review)

Images with (a) coding redundancy; (b) spatial redundancy; (c) irrelevant information

Colors in Images & Video

Reading instructions: Chapter 6

Image Processing for Mechatronics Engineering For senior undergraduate students Academic Year 2017/2018, Winter Semester

For a long time I limited myself to one color as a form of discipline. Pablo Picasso. Color Image Processing

Color Image Processing. Gonzales & Woods: Chapter 6

LECTURE 07 COLORS IN IMAGES & VIDEO

Digital Image Processing Color Models &Processing

Color Image Processing

CS 565 Computer Vision. Nazar Khan PUCIT Lecture 4: Colour

Figure 1: Energy Distributions for light

Sampling Rate = Resolution Quantization Level = Color Depth = Bit Depth = Number of Colors

Lecture 3: Grey and Color Image Processing

Color images C1 C2 C3

EECS490: Digital Image Processing. Lecture #12

Central Place Indexing: Optimal Location Representation for Digital Earth. Kevin M. Sahr Department of Computer Science Southern Oregon University

Module 6 STILL IMAGE COMPRESSION STANDARDS

Templates and Image Pyramids

A simple MATLAB interface to FireWire cameras. How to define the colour ranges used for the detection of coloured objects

Color is the factory default setting. The printer driver is capable of overriding this setting. Adjust the color output on the printed page.

Session 1. by Shahid Farid

ENEE408G Multimedia Signal Processing

Color Image Processing

Color image processing

Dr. Shahanawaj Ahamad. Dr. S.Ahamad, SWE-423, Unit-06

Testing, Tuning, and Applications of Fast Physics-based Fog Removal

2. REVIEW OF LITERATURE

Practical Content-Adaptive Subsampling for Image and Video Compression

Digital Imaging - Photoshop

Unit 8: Color Image Processing

3. Image Formats. Figure1:Example of bitmap and Vector representation images

Color Reproduction. Chapter 6

Lecture 9: Digital Images

Introduction to Multimedia Computing

MOTION GRAPHICS BITE 3623

Chapter 9 Image Compression Standards

Interactive Computer Graphics

Chapter 3 Part 2 Color image processing

k-means Clustering David S. Rosenberg December 15, 2017 Bloomberg ML EDU David S. Rosenberg (Bloomberg ML EDU) ML 101 December 15, / 18

Outline. Image formation: the pinhole camera model Images as functions Digital images Color, light and shading. Reading: textbook: 2.1, 2.2, 2.

CHAPTER 6 COLOR IMAGE PROCESSING

Digital Media. Lecture 4: Bitmapped images: Compression & Convolution Georgia Gwinnett College School of Science and Technology Dr.

Ranked Dither for Robust Color Printing

Color & Compression. Robin Strand Centre for Image analysis Swedish University of Agricultural Sciences Uppsala University

4/9/2015. Simple Graphics and Image Processing. Simple Graphics. Overview of Turtle Graphics (continued) Overview of Turtle Graphics

USE OF COLOR IN REMOTE SENSING

IMAGE INTENSIFICATION TECHNIQUE USING HORIZONTAL SITUATION INDICATOR

Color. Chapter 6. (colour) Digital Multimedia, 2nd edition

To discuss. Color Science Color Models in image. Computer Graphics 2

The worlds we live in. The worlds we live in

TOPAZ SIMPLIFY SLIDEROLOGY

Crowd-steering behaviors Using the Fame Crowd Simulation API to manage crowds Exploring ANT-Op to create more goal-directed crowds

Digital Image Processing (DIP)

Histograms and Color Balancing

the eye Light is electromagnetic radiation. The different wavelengths of the (to humans) visible part of the spectra make up the colors.

SDC. AutoCAD LT 2007 Tutorial. Randy H. Shih. Schroff Development Corporation Oregon Institute of Technology

Introduction. Related Work

Table of Contents. Lesson 1 Getting Started

The Use of Non-Local Means to Reduce Image Noise

Assignment: Light, Cameras, and Image Formation

DIGITAL IMAGE PROCESSING Quiz exercises preparation for the midterm exam

Image Perception & 2D Images

from: Point Operations (Single Operands)

ImageJ, A Useful Tool for Image Processing and Analysis Joel B. Sheffield

The Color Wheel is a visual representation of color theory. It is the color spectrum wrapped onto a circle.

Multimedia Systems Color Space Mahdi Amiri March 2012 Sharif University of Technology

Human Vision, Color and Basic Image Processing

Segmentation using Saturation Thresholding and its Application in Content-Based Retrieval of Images

1. Open the Feature Modeling demo part file on the EEIC website. Ask student about which constraints needed to Fully Define.

EEE 309 Communication Theory

Deep Green. System for real-time tracking and playing the board game Reversi. Final Project Submitted by: Nadav Erell

Fast, Robust Colour Vision for the Monash Humanoid Andrew Price Geoff Taylor Lindsay Kleeman

COLOR and the human response to light

2. Pixels and Colors. Introduction to Pixels. Chapter 2. Investigation Pixels and Digital Images

2. Color spaces Introduction The RGB color space

Compression and Image Formats

Introduction to computer vision. Image Color Conversion. CIE Chromaticity Diagram and Color Gamut. Color Models

Chapter 4. Incorporating Color Techniques

TODAY STANDARD COLORS RGB COLOR CS 115: COMPUTING FOR SOCIO-TECHNO WEB REPRESENTATION OF TEXT, NUMBERS AND CODE

A new quad-tree segmented image compression scheme using histogram analysis and pattern matching

Transcription:

Spherical K-Means Color Image Compression Tim Pavlik Features/Functionality This project takes an input image in RGB colorspace and performs K-means clustering, where the number of clusters (N) is specified by the user. The RGB offsets from the selected cluster center center are then converted into spherical coordinate offsets for each pixel. These offsets are then quantized according to the number of partitions specified by the user to create a new image representation using fewer bits than the original 24 bit RGB image. The image is then decompressed/reconstructed to RGB and displayed to show the user how well the compression has performed. The user is also shown RG, RB and GB planar representations of the original/reconstructed pixels as well as the cluster centers. Algorithm Details First, RGB values taken from the input image are input to the Matlab K-means clustering algorithm. The K-means clustering iteratively places each pixel (with an R, G and B value) into one of N clusters (specified by the user) and outputs the final cluster centers as well as which cluster center each pixel was closest to. Fig 1: Exemplary pixels values (black dots) and clusters (red X s and circles) shown in RGB space Next, the pixel offsets are calculated by subtracting their RGB values from the RGB values of their assigned cluster center. The cartesian RGB offsets are then converted to spherical coordinate space with a Radius, Theta, and Phi offset from the assigned cluster center for each pixel. The angles (Theta and Phi) are then quantized according the the number of partitions (Theta Part. and Phi Part.) specified by the user uniformly over their respective ranges: Theta ranges from -π to π while Phi ranges from -π/ 2 to π/2. The radius is then quantized into one of Radius Part. partitions specified by the user, but the radius is quantized according to the range MaxR^(1/ Radius Part. ):MaxR where MaxR is the maximum (3D) distance out of all the pixel distances in the cluster from the cluster center. MaxR is different for each cluster, based on the distance of the greatest outlier in each cluster. The radius offset is then quantized based on exponentially increasing intervals as opposed to uniformly/

linear increasing values such as those used for angle offsets Phi/Theta. For example, the radii may be assigned to one of 2, 4, 8, 16, 32, etc as opposed to 1, 2, 3, 4, 5, etc (details below). So now the image is represented using fixed header information corresponding to the cluster centers in RGB space and the MaxR for each cluster. Each pixel in the image is now represented by a Cluster number, Radius offset, Theta Offset, and Phi Offset. Finally, the RGB values are recomputed and shown to the user to see how well the compressed images corresponds to the original. This is achieved by converting the quantized R, Theta, and Phi offsets into RGB offsets and adding those offsets to the cluster center for the given pixel. The user is also given the number of bits per pixel used in the compressed image as opposed to the original images which requires 24 bits per pixel with 8 bit RGB space. The RG, RB and GB planes are also displayed with the original RGB pixel values (black dots), new quantized RGB pixel values (green dots) and each RGB cluster center (red X s). Design Choices The K-means aspect was chosen because images tend to naturally fall into shades of a given palette of dominant colors, the clustering algorithm iteratively tries to find those dominant colors and exploit that to compress the colorspace. The parameters for the K-means algorithm were set to a maximum of 50 iterations (to shorten the time that the algorithm takes which can be quite time consuming even for medium sized images) and the emptyaction parameter was set to singleton which instructs the algorithm to take the farthest outlier of the other clusters to start a new cluster if an empty cluster forms during any iterations (this reduces the number of far outliers which leads to smaller MaxR values for each cluster and less error in the Radius Offset for each pixel in the cluster). The choice to represent the radii as exponentially increasing from MaxR^(1/ Radius Part. ) to MaxR was made in order to 1) Retain even the greatest outliers in each cluster at MaxR while 2) Realizing that most pixels are probably within a small distance of the cluster center and thus having a number of smaller Radius offsets to work with. Instructions Step 1: Select an input image. These images were chosen to show how well the compression works with different types of images. You can see by comparing the performance of the relatively monochromatic sunset.jpg (with mostly shades of red) with the more difficult rainbow.jpg. The seattle.jpg is slightly more typical with a more balanced blend of colors.

Step 2: Select compression parameters. At first, try using the default parameters (16 Cluster, 8 Radius partitions, 4 Theta Partitions, and 8 Phi partitions). For better quality, try increasing the values (especially the number of clusters for the rainbow.jpg image). For better compression, use smaller values.

Step 3: Press the Compress Colors button to perform the Spherical K-Means Clustering compression using the selected parameters. The script takes a few seconds, so a Loading... message is displayed showing that the script is still working.

Step 4: Observe the outputs. The reconstructed image is shown at the bottom right (Yellow arrow below). The RG, RB, and GB planes are also shown (Blue arrow below) with the original RGB pixel values as black dots, the new reconstructed RGB pixel values as green dots and the computed RGB cluster centers as red X s. Finally, the number of bits needed to represent the image using the compressed scheme is shown (Red oval below) compared to the original 24 bits.

Final Comments The results are impressive, using half the number of bits with the default values (12 bits/pixel as opposed to 24 bits/pixel) the sunset.jpg and seattle.jpg images were very close to their originals. Understandably, the compressed rainbow.jpg image had some more visible artifacts since there are so many subtle changes in colors. When the number of clusters used is increased, these artifacts become less visible. Moving forward, some changes could be attempted to try and improve the results even further: Align Phi/Theta with major/minor axes. Instead of using a uniform distribution of quantized angles Phi and Theta, the covariance/ellipsoid containing the given cluster could be calculated so that the Phi and Theta values can be aligned with the major and minor axes of the calculated ellipsoid. This could beter represent the RGB clusters that tend to form in narrow ellipsoids rather than perfect spheres. Use smaller range of radius offsets. The performance could be improved by instead of using the max radius of each cluster as the upper bound using a smaller value (say two standard deviations from the mean distance) to shrink the range of radii while still representing 95-97% of the values and leaving out the extreme outliers.

Compress each parameter in DCT. This would be the next logical step to compare the performance of this compression with the JPEG compression in RGB. Explore different colorspaces. K-means clustering is often performed in normalized RGB space in computer vision techniques. Perhaps this compression scheme would peform better in this space or any of the other common colorspaces such as CMY, HSV, YUV, YUL, etc.