Computer Vision Chapter 6 Color.

Slides:



Advertisements
Similar presentations
ECE 472/572 - Digital Image Processing Lecture 10 - Color Image Processing 10/25/11.
Advertisements

Color spaces CIE - RGB space. HSV - space. CIE - XYZ space.
COLORCOLOR A SET OF CODES GENERATED BY THE BRAİN How do you quantify? How do you use?
Color Image Processing
Light Light is fundamental for color vision Unless there is a source of light, there is nothing to see! What do we see? We do not see objects, but the.
Aalborg University Copenhagen
School of Computing Science Simon Fraser University
Lecture 6 Color and Texture
© 2002 by Yu Hen Hu 1 ECE533 Digital Image Processing Color Imaging.
1 Color Used heavily in human vision Color is a pixel property, making some recognition problems easy Visible spectrum for humans is 400nm (blue) to 700.
1 Color Color Used heavily in human vision Used heavily in human vision Color is a pixel property, making some recognition problems easy Color is a pixel.
Color.
Color: Readings: Ch 6: color spaces color histograms color segmentation.
Graphics File Formats. 2 Graphics Data n Vector data –Lines –Polygons –Curves n Bitmap data –Array of pixels –Numerical values corresponding to gray-
What is color for?.
CSE 803 Stockman Fall Color Used heavily in human vision Color is a pixel property, making some recognition problems easy Visible spectrum for humans.
Images and colour Colour - colours - colour spaces - colour models Raster data - image representations - single and multi-band (multi-channel) images -
Fundamentals of Multimedia Chapter 4 Color in Image and Video Ze-Nian Li and Mark S. Drew 건국대학교 인터넷미디어공학부 임 창 훈.
CSc 461/561 CSc 461/561 Multimedia Systems Part A: 2. Image.
1 Perception. 2 “The consciousness or awareness of objects or other data through the medium of the senses.”
1 CSCE441: Computer Graphics: Color Models Jinxiang Chai.
Color Models AM Radio FM Radio + TV Microwave Infrared Ultraviolet Visible.
Digital Images ColorColor. Color  The human eye combines 3 primary colors using the 3 different types of cones to discern all visible colors. This suggests.
09/12/02 (C) 2002, University of Wisconsin, CS 559 Last Time Color and Color Spaces –Recall RGB and XYZ Programming assignment 2.
CS 376 Introduction to Computer Graphics 01 / 26 / 2007 Instructor: Michael Eckmann.
2001 by Jim X. Chen: 1 The purpose of a color model is to allow convenient specification of colors within some color gamut.
Chapter 6: Color Image Processing Digital Image Processing.
Color Image Processing A spectrum of possibilities…
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS Light and Color Graphics Systems / Computer.
Color. Contents Light and color The visible light spectrum Primary and secondary colors Color spaces –RGB, CMY, YIQ, HLS, CIE –CIE XYZ, CIE xyY and CIE.
6. COLOR IMAGE PROCESSING
Color 2011, Fall. Colorimetry : Definition (1/2) Colorimetry  Light is perceived in the visible band from 380 to 780 nm  distribution of wavelengths.
Color Theory ‣ What is color? ‣ How do we perceive it? ‣ How do we describe and match colors? ‣ Color spaces.
Chapter 1. Introduction. Goals of Image Processing “One picture is worth more than a thousand words” 1.Improvement of pictorial information for human.
September 17, 2013Computer Vision Lecture 5: Image Filtering 1ColorRGB HSI.
Image Representation. Digital Cameras Scanned Film & Photographs Digitized TV Signals Computer Graphics Radar & Sonar Medical Imaging Devices (X-Ray,
CSC361/ Digital Media Burg/Wong
CS6825: Color 2 Light and Color Light is electromagnetic radiation Light is electromagnetic radiation Visible light: nm. range Visible light:
Graphics Lecture 4: Slide 1 Interactive Computer Graphics Lecture 4: Colour.
A color model is a specification of a 3D color co-ordinate system and a visible subset in the co-ordinate System within all colors in a particular color.
Ch 6 Color Image processing CS446 Instructor: Nada ALZaben.
DIGITAL IMAGE. Basic Image Concepts An image is a spatial representation of an object An image can be thought of as a function with resulting values of.
Digital Image Processing In The Name Of God Digital Image Processing Lecture6: Color Image Processing M. Ghelich Oghli By: M. Ghelich Oghli
1 CSCE441: Computer Graphics: Color Models Jinxiang Chai.
Introduction to Computer Graphics
1 CSCE441: Computer Graphics: Color Models Jinxiang Chai.
Image credit: Wikipedia (Fovea) Human Eye Some interesting facts – Rod cells: requires only low light b/w vision blur, all over retina EXCEPT fovea – Cone.
Computer Graphics: Achromatic and Coloured Light.
1 of 32 Computer Graphics Color. 2 of 32 Basics Of Color elements of color:
Sensing Colors. B G Color Digital Image R Red sensor Green sensor Blue sensor.
Multimedia systems Lecture 5: Color in Image and Video.
Color Models Light property Color models.
Half Toning Dithering RGB CMYK Models
Design Concepts: Module A: The Science of Color
Color Image Processing
Color Image Processing
Color Image Processing
Color 2017, Fall.
Chapter 6: Color Image Processing
Color Image Processing
Color 2015, Fall.
Color: Readings: Ch 6: color spaces color histograms
Color: Readings: Ch 6: color spaces color histograms
Color Image Processing
Slides taken from Scott Schaefer
Color Image Processing
Color Model By : Mustafa Salam.
Digital Image Processing
CSSE463: Image Recognition Day 2
CSSE463: Image Recognition Day 2
Presentation transcript:

Computer Vision Chapter 6 Color

Visible light Color Wavelength violet 380–450 nm blue 450–495 nm green 495–570 nm yellow 570–590 nm orange 590–620 nm red 620–750 nm (high frequency/shorter wavelength)

White light So what is “white” light? White light is composed of approx. equal energy in all wavelengths of the visible spectrum.

Perception of color A blue surface appears blue when illuminated by white light. The same surface appears violet when illuminated by red light.

Perception of color Dependent on: Spectrum of light source Characteristics of illuminated object Spectral sensitivity of the sensor

Perception of color Additional factors: Surface is specular or matte (lambertian) Distance of surface from light Orientation of surface and light

Surface normals Say we have 3 points, p1, p2, and p3 on our surface element. Form two vectors, U=p2-p1 V=p3-p1. Then N=UxV is the surface normal (cross product). Nx = UyVz – UzVy Ny = UzVx – UxVz Nz = UxVy – UyVx Analog in 2D is UxVy – UyVx Note regarding length of N; note regarding direction of N.

Sensitivity of receptors

Types of images Binary image = range of I is in {0,1} Gray-scale image = range of I is in {0,1,…,max} Multispectral image = vector-valued Ex. Color image = range is in {<r,g,b> | (r,g,b) in {0,1,…,max} }, for 8 bits, max=255 (28-1) <0,0,255> = ? <255,0,0> = ? <100,100,100> = ?

Representing color RGB (red green blue) CMY (cyan magenta yellow) Additive (to black: <0,0,0>) CMY (cyan magenta yellow) Subtractive (from white: <0,0,0>); based on printing inks on white paper Often CMYK (K=key=black) because black from CMY is poor. HSI (hue saturation intensity) aka HSV (hue saturation value)

Additive (left) vs. subtractive (right)

Color cube (note RGB values in [0.0..1.0])

color cube vs. color wheel

Interactive: http://www.had2know.com/technology/hsi-rgb-color-converter-equations.html Hue angle in [0..2Pi]. Saturation in [0..1]. Intensity in [0..255].

Other systems Luminance + 2 chromaticity values YIQ luminance red-cyan Y = 0.3 R + 0.59 G + 0.11 B red-cyan I = 0.6 R – 0.28 G – 0.32 B magenta-green Q = 0.21 R – 0.52 G + 0.31 B Used by color and black & white broadcast TV (before digital).

Other systems Luminance + 2 chromaticity values YUV Y = 0.3 R + 0.59 G + 0.11 B U = 0.493 (B – Y) V = 0.877 (R – Y) Used by JPEG and MPEG (compresses better than RGB)

Color histograms

Color histograms How can one construct a color histogram?

Color histograms How can one construct a color histogram? as 3D color clouds

Color histograms How can one construct a color histogram? as histograms of each individual component

Color histograms Another method for constructing a color histogram: Given an RGB value, construct an integer i = R2G2B2 where R2 = the 2 high order bits of the R component (and similarly for G and B) 222222 = 26 = 64 bins in histogram Maps 3D RGB values into 1D.

64 bin color histogram example

64 bin color histogram example

Color histograms Another method of constructing a color histogram: Quantize RGB into 16 levels (4 bits for each component, 24 = 16) Create a histogram of red values Create a histogram of green values Create a histogram of blue values Concatenate these 3 histograms into one single 16x3 = 48 bin histogram Also maps 3D RGB values into 1D.

Comparing histograms

Comparing color histograms Say we have a database of images and their color histograms. Given an image that is not in our database, we can calculate its histogram. And see what histogram it best matches. But how can we compare histograms?

Method 1: Comparing two (1D) histograms hI and hM Note: match is not symmetric. I.e., match(a,b) <> match(b,a) for all a and b.

Method 2: Comparing two (1D) histograms hI and hM Normalize (divide) each hI and hM by total number of pixels (to approximate probabilities). Calculate distance d( hI, hM ) as 2 64- (or 48-) dimensional points. How do we calculate the distance between 2 64- or 48-) dimensional points?

Method 2: Comparing two (1D) histograms hI and hM cont’d. Normalize (divide) each hI and hM by total number of pixels (to approximate probabilities). Calculate distance d( hI, hM ) as 2 64- (or 48-) dimensional points. How do we calculate the distance between 2 64- or 48-) dimensional points?

Method 3: Relative entropy (or the Kullback Leibler distance) from “Elements of Information Theory,” 2nd ed., (Wiley Series in Telecommunications and Signal Processing) by Thomas M. Cover and Joy A. Thomas (Hardcover - Jul 18, 2006), p. 18. (all logs are base 2)

Method 4: Mutual information from “Elements of Information Theory,” 2nd ed., (Wiley Series in Telecommunications and Signal Processing) by Thomas M. Cover and Joy A. Thomas (Hardcover - Jul 18, 2006) (all logs are base 2)

Method 4: Mutual information cont’d. How to calculate the joint distribution or joint p.m.f., p(x,y):

Color segmentation example

Color segmentation example Problem: Find (segment) face in workstation camera image. Approach: Training phase: Determine clusters from pixels from known faces using red-green values. Classification phase: Given a pixel that we need to classify (as either face or not), produce a labeled image which is then filtered according to region size.

non face pixel colors cluster of face pixel colors

End color segmentation example

Color histograms Yet another method is to map 3D RGB values into a 3D histogram. Note that K-means can also be easily applied to any of these 3 color histogram methods.

Homework Exercises 6.6, 6.8, and 6.9.

Homework Exercise 6.6. Using Algorithm 6.1 (procedure RGB_to_HSI), convert the RGB value (100,150,200) into an HSI value and, convert the RGB value (0.0, 1.0, 0.0) to HSI.

Homework Exercise 6.8. Suppose a color camera encodes a given pixel in RGB as (200, 50, 100), where 255 is the highest (most energy) value. What should be the equivalent triple in the HSI system? What should be the equivalent triple in the YIQ system?

Homework Exercise 6.9. Is the transformation from RGB to YIQ invertible? Is so, compute the inverse.

Color is a key feature in identifying the real tiger.

original increased saturation decreased saturation HSI is a natural representation for increased or decreasing the amount of color in an image. Hue angle in [0..2Pi]. Saturation in [0..1]. Intensity in [0..255].

image after segmentation and labeling (coloring)

Storing images in file

{ P2 = ASCII gray PGM header ASCII max data value data comments height (rows) width (cols)

P3 = ASCII color PPM Each pixel’s color is represented as <red,green,blue>. P3 w h maxval v1r v1g v1b v2r v2g v2b . . . . . . . . . vw*hr vw*hg vw*hb

2D Images Stored as 1D Arrays Say our 2D color (RGB) image is stored as a 1D array, I. How do we calculate the offset to a particular element given a particular row and column? First, do you recall how it’s done for a 2D gray image?