![Page 1: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/1.jpg)
Digital Image Representation and Color FundamentalsRODNEY DOCKTER
APRIL 2018
1
![Page 2: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/2.jpg)
Outline• Digital Image Representation• Sampling, Quantization
• Color Fundamentals• Color Transformation
2
![Page 3: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/3.jpg)
Digital Image Representation• Digital Image Pipeline
3
![Page 4: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/4.jpg)
Digital Image Representation• Digital Image Pipeline
4
![Page 5: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/5.jpg)
Digital Image Representation• Two major factors determine digital image quality:
• Spatial Resolution – Controlled by spatial sampling
• Color Depth – Controlled by the number of colors or grey levels allocated for each pixel
• Increasing either of these factors results in a higher quality image at the expense of larger image file size, larger storage requirements, longer display/processing time.
5
![Page 6: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/6.jpg)
Digital Image Representation• Image Digitization
• Sampling: Measure the value of an image at a finite number of points
• Quantization: Represent measured value (i.e. voltage) at the sampled point using an integer value
6
![Page 7: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/7.jpg)
Digital Image Representation• Image Digitization - Sampling
7
0
255
128
![Page 8: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/8.jpg)
Digital Image Representation• Image Digitization - Quantization
8
0
128
255
Greyscale Image:- 2D Matrix- 8 bits/pixel- 255 possible values
![Page 9: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/9.jpg)
Digital Image Representation• Digital images are a 2D rectilinear array of pixels (picture element)
• FIXED number of samples (pixels): NxM
9
N = M = 256 N = M = 30Sub Sample
![Page 10: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/10.jpg)
Digital Image Representation• No continuous variables in digital images
• Quantization is represented by the number of bits per pixel
10
L = 2 (1 bit/pixel) = Binary L = 256 (8 bits/pixel) = GreyscaleL = 4 (2 bits/pixel) L = 16 (4 bits/pixel)
[ 0 0 ] = 0[ 0 1 ] = 1[ 1 0 ] = 2[ 1 1 ] = 3
[ 0 0 0 0 ][ 0 0 0 1 ]. . . . . . .
[ 1 1 1 1 ]
![Page 11: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/11.jpg)
Digital Image Representation• Quantization of continuous values
11
Continuous Image Scan line from A to B(continuous)
Sampling and Quantization Digital Scan Line
![Page 12: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/12.jpg)
Digital Image Representation• Uniform Sampling: Digitized in spatial domain (𝐼𝑀𝑥𝑁)
• M and N are usually integer powers of two
• Nyquist theorem and Aliasing…
• Non-Uniform sampling• Spatial Communication
• Taking signal samples at instants of “importance”
12
![Page 13: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/13.jpg)
Digital Image RepresentationImage Sampling
13
Original ImageSampled byfactor of 2
Sampled byfactor of 4
Sampled byfactor of 8
![Page 14: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/14.jpg)
Digital Image Representation• Image Decimation and Interpolation
• Decimation is the reduction in dimension or resolution of the image (subsampling)• Decimation of 2, results in half the size of the original image
• Simplest method is skipping of every other pixel
• Interpolation is the increase in dimension or resolution of the image by averaging or other mathematical operations• Interpolation of 2, results in double the resolution of the original image
• Simplest method is the duplication of pixels
• More complicated method is to take the average of neighboring pixels and inserting
14
![Page 15: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/15.jpg)
Digital Image Representation• Image Pyramids
• Represent NxN images as a “Pyramid” of 1x1, 2x2, 4x4, … , NxN images (𝑁 = 2𝑘)
• Also known as a “Gaussian Pyramid” or a “Mip Map”
15
![Page 16: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/16.jpg)
Digital Image Representation• Effect of Sampling
• Simple example: a sine wave
16
![Page 17: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/17.jpg)
Digital Image Representation• Under-sampling
• What if we “missed” things between samples?
• Example: Under-sampling a sine wave• Result: Information is lost
17
![Page 18: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/18.jpg)
Digital Image Representation• Under-sampling
• What if we “missed” things between samples?
• Example: Under-sampling a sine wave• Result: Information is lost
• Bigger problem: Indistinguishable from lower frequencies:
18
![Page 19: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/19.jpg)
Digital Image Representation• Under-sampling
• What if we “missed” things between samples?
• Example: Under-sampling a sine wave• Result: Information is lost
• Bigger problem: Indistinguishable from lower frequencies
• Always indistinguishable from higher frequencies…
19
![Page 20: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/20.jpg)
Digital Image Representation
20
Input Signal: Plot as Image:
AliasNot Enough Samples!
![Page 21: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/21.jpg)
Digital Image Representation• What can we do about aliasing?
• Sample more often• Join the Mega-Pixel enhancement of the photo industry … (8K TVs, etc )
• But this can’t go on forever
• Make the signal less wiggly• Get rid of some high frequencies
• Will still lose information, but we can be selective
• Still better than aliasing
21
![Page 22: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/22.jpg)
Digital Image Representation• Aliasing (The Moire Effect)
22
ArtifactsOriginal
http://www.wfu.edu/~matthews/misc/DigPhotog/alias/
![Page 23: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/23.jpg)
Digital Image Representation• Uniform Quantization
• Digitized in amplitude (or pixel value)
• e.g. PGM format – 256 levels -> 4 levels
• Compute the uniform step that represent 1 level
23
Step = 64 (in this case)
![Page 24: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/24.jpg)
Digital Image Representation
24
256 gray levels (8 bits/pixel) 32 gray levels (5 bits/pixel) 16 gray levels (4 bits/pixel)
8 gray levels (3 bits/pixel) 4 gray levels (2 bits/pixel) 2 gray levels (1 bit/pixel)
![Page 25: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/25.jpg)
Digital Image Representation• The real world has High Dynamic Range (HDR)
• Uniform sampling is not optimal, especially with complex scenes
• Typical HDR methods combine multiple standard images with varying luminance
25
![Page 26: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/26.jpg)
Color Image Processing• Color Images• Simplified object extraction and identification
• Human vision: ~10 million of distinguishable colors
• Digital representation: 16 million possible colors
• Color spectrum• White light with a prism (1666, Newton)
26
![Page 27: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/27.jpg)
Color Image Processing• Greyscale Image:
27
![Page 28: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/28.jpg)
Color Image Processing• Color Image:
28
![Page 29: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/29.jpg)
Color Image Processing• Mini-physics review: What is light?
• The visible portion of the electromagnetic (EM) spectrum
• It occurs between wavelength of approximately 400 – 700 nanometers
29
![Page 30: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/30.jpg)
Color Image Processing• Color Spectrum
• The experiment of Sir Isaac Newton, 1666
30
![Page 31: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/31.jpg)
Color Image Processing• Color Spaces
• How can we represent color?
31
![Page 32: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/32.jpg)
Color Image Processing• Human Eye
• Three different types of cones. Each cone has a special pigment making it sensitive to specific ranges of wavelengths:• Short (S) corresponds to blue
• Medium (M) corresponds to green
• Long (L) corresponds to red
• Ratio of L to M to S cones:• Approximately 10:5:1
• Approximately 6 million cones
32
![Page 33: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/33.jpg)
Color Image Processing• Color representation is based on the theory of T. Young (1802) which states that any color can be produced by mixing three primary colors 𝐶1, 𝐶2, 𝐶3:
• It is therefore possible to characterize a psycho-visual color by specifying the amounts of three primary colors: red, green, and blue, mixed together
• This leads to the standard RGB space used in television, computer monitors, LED screens, etc
33
𝐶 = 𝑎𝐶1 + 𝑏𝐶2 + 𝑐𝐶3
![Page 34: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/34.jpg)
Color Image Processing• Color Fundamentals
• Standard wavelengths for the primary colors:
34
![Page 35: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/35.jpg)
Color Image Processing• Color Fundamentals
• Tri-Stimulus values: The amount of red, green, and blue needed to form any particular color
• Denoted by X, Y, Z
• Tri-chromatic coefficient
35
𝑥 =𝑋
𝑋 + 𝑌 + 𝑍𝑦 =
𝑌
𝑋 + 𝑌 + 𝑍𝑧 =
𝑍
𝑋 + 𝑌 + 𝑍
𝑥 + 𝑦 + 𝑧 = 1
![Page 36: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/36.jpg)
Color Image Processing• Color Fundamentals
• Any patch of light can be completely described physically by its spectrum: the number of photons (per time unit) at each wavelength (400-700 nm)
36
![Page 37: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/37.jpg)
Color Image Processing• Color Examples
• Some examples of the reflectance spectra of surfaces
37
![Page 38: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/38.jpg)
Color Image Processing• Tetrachromatism – 4 independent color channels
• Most birds and many other animals have cones for ultraviolet light
• Some humans, mostly female, also have slight tetrachromatism
38
Bird Cone Responses
![Page 39: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/39.jpg)
Color Image Processing• More spectra examples:
39
![Page 40: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/40.jpg)
Color Image Processing• RGB Model
40
![Page 41: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/41.jpg)
Color Image Processing• Usually we specify the levels of R, G, and B in the range [0, 255]
• 8 bits, per pixel, per channel.
41
(256)3= 16,777,216 𝐶𝑜𝑙𝑜𝑟𝑠
![Page 42: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/42.jpg)
Color Image Processing• Default Color Space (R,G,B)
• Some drawbacks:
• Strongly correlated channels
• Non-perceptual
42
1,0,0
0,1,0
0,0,1
![Page 43: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/43.jpg)
Color Image Processing
43
R(G=0,B=0)
G(R=0,B=0)
B(R=0,G=0)
![Page 44: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/44.jpg)
Color Image Processing
44
R(G=0,B=0)
G(R=0,B=0)
B(R=0,G=0)
![Page 45: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/45.jpg)
Color Image Processing
45
R G B
![Page 46: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/46.jpg)
Color Image Processing• Alternate color spaces
• Various color representations can be used other than RGB
• This can be done for:• De-correlating the color channels e.g. principal component
• Separating color information from lighting:• Hue, Saturation, Value
46
![Page 47: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/47.jpg)
Color Image Processing• The purpose of a color model (also called color space) is to facilitate the specification of colors in some standard, generally accepted fashion.
• RGB (red, green, blue) model: monitor, video camera
• HSI, HSV, YUV model, which corresponds closely with the way humans describe and interpret color
• CMY (Cyan, magenta, yellow), CMYK (CMY, black) model: for color printing
47
𝐵𝑙𝑎𝑐𝑘 𝐾 = min(𝐶,𝑀, 𝑌)
𝐶𝑦𝑎𝑛𝐶𝑀𝑌𝐾 = (𝐶 − 𝐾)/(1 − 𝐾)
𝑀𝑎𝑔𝑒𝑛𝑡𝑎𝐶𝑀𝑌𝐾 = (𝑀 − 𝐾)/(1 − 𝐾)
𝑌𝑒𝑙𝑙𝑜𝑤𝐶𝑀𝑌𝐾 = (𝑌 − 𝐾)/(1 − 𝐾)
![Page 48: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/48.jpg)
Color Image Processing
48
![Page 49: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/49.jpg)
Color Image Processing• The characteristics generally used to distinguish one color from another are Brightness, Hue, and Saturation• Hue: Represents dominant color as perceived by an observer
• Saturation: Relative purity or the amount of white light mixed with the hue
• Brightness: Amount of total light present
• Hue and Saturation taken together are called Chromaticity and therefore a color may characterized by its Brightness and Chromaticity
49
![Page 50: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/50.jpg)
Color Image Processing• HSI Model: Hue and Saturation
50
![Page 51: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/51.jpg)
Color Image Processing• HSI Model
• Hue corresponds to color, Saturation corresponds to the amount of white in color, and Intensity is related to brightness.
• For Example: a deep, bright orange color would have a large intensity (bright), a hue of “orange”, a high value of saturation (deep).
• In terms of RGB components, this “Orange” color would have the values as R=245, G=110, and B= 20
51
![Page 52: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/52.jpg)
Color Image Processing• HSV Model: Hue, Saturation, Value
52
RGB HSV
![Page 53: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/53.jpg)
Color Image Processing• rg Chromaticity Coordinates
• A two-dimensional color space in which there is no intensity information
• Normalizes RGB values to the sum of all three
• Chromaticity coordinates are:
53
𝑟 =𝑅
𝑅 + 𝐺 + 𝐵
𝑔 =𝐺
𝑅 + 𝐺 + 𝐵
𝑏 =𝐵
𝑅 + 𝐺 + 𝐵
![Page 54: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/54.jpg)
Color Image Processing• Color Transformation Examples:
54
𝐻 = atan23
2𝐺 − 𝐵 ,
1
2( 𝑅 − 𝐺 + 𝑅 − 𝐵 )
𝑆 =
34𝐺 − 𝐵 2 +
14
𝑅 − 𝐺 + 𝑅 − 𝐵2
𝑉
𝑉 = 𝑚𝑎𝑥 (𝑅, 𝐺, 𝐵)
𝑌 = 0.299𝑅 + 0.587𝐺 + 0.114𝐵
𝐶𝑟 = 𝑅 − 𝑌
𝐶𝑏 = 𝐵 − 𝑌
RGB -> HSV RGB -> YCbCr
![Page 55: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/55.jpg)
Color Image Processing• Color Transformation YCrCb
• Fast to compute, good for compression, used by TV
55
YCb=0.5Cr=0.5
CbY=0.5Cr=0.5
CrY=0.5Cb=0.5
![Page 56: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/56.jpg)
Color Image Processing• Other Color Spaces:
• RGB (CIE), RnGnBn (TV - National Television Standard Committee)
• XYZ (CIE)
• YUV, YIQ, YCbCr
• YDbDr
• DSH, HSV, HLS, HIS
• Munsel color space (cylindrical representation)
• CIELuv
• etc….
56
![Page 57: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/57.jpg)
Color Image Processing• Color Image: Full Description
57
Original Image
![Page 58: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/58.jpg)
Color Image Processing• Intensity Image: Most Information, Simplest Representation
58
Only intensity shown, constant color
![Page 59: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/59.jpg)
Color Image Processing• Scaled Color Image: Few Features
59
Only color shown, constant intensity
![Page 60: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/60.jpg)
Color Image Processing• Color Tracking Example: Skin Color
60
RGB
r
g
rg
𝑟 =𝑅
𝑅 + 𝐺 + 𝐵𝑔 =
𝐺
𝑅 + 𝐺 + 𝐵𝑏 =
𝐵
𝑅 + 𝐺 + 𝐵
![Page 61: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/61.jpg)
Color Image Processing• Color Tracking Example: Skin Color
61
M. Jones and J. Rehg, Statistical Color Models with Application to SkinDetection, International Journal of Computer Vision, 2002.
![Page 62: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/62.jpg)
Image File Formats• GIF (Graphics Interchange Format)
• PNG (Portable Network Graphics)
• JPEG (Joint Photographic Experts Group)
• TIFF (Tagged Image File Format)
• PGM (Portable Gray Map)
• FITS (Flexible Image Transport System)
62
![Page 63: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/63.jpg)
Image File Formats• PBM/PGM/PPM Format
• A very basic image format for greyscale images (Not really used anymore)
• Closely-related formats:• PBM (Portable Bitmap) for binary images (1 bit/pixel)
• PPM (Portable Pixelmap) for color images (24 bits/pixel)
63
![Page 64: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/64.jpg)
Image File Formats• Images in Matlab
• Images represented as a matrix
• Suppose we have a NxM RGB images called “im”• im(1,1,1)=top-left pixel value in R-channel
• im (y, x, b) = y pixels down, x pixels to right in the bth channel
• im (N, M, 3) = bottom-right pixel in B-channel
• imread(filename) returns a uint8 image (values 0 to 255)• Convert to double format (values 0 to 1 if you need to scale)
64
![Page 65: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/65.jpg)
Image File Formats• Images in Matlab
65
![Page 66: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/66.jpg)
Image Representation• Mathematically, an image can be represented by a 2-D matrix
• Each entry (i,j) represents the value at the corresponding location, which is called a pixel
• The value of a pixel can be different types, depending on the image types• Unsigned char (8 bits per pixel or 256 levels)
• Int
• Float
• A vector (Color image, for example)
66
![Page 67: Digital Image Representation and Color Fundamentalsdept.me.umn.edu/courses/me5286/vision/VisionNotes/2018/... · 2018-04-06 · Color Image Processing •Color representation is based](https://reader034.vdocuments.net/reader034/viewer/2022042315/5f036d747e708231d4092778/html5/thumbnails/67.jpg)
Image File Formats• Image file headers: A set of parameters found at the start of the file image and contains information regarding:• Number of rows (height)
• Number of columns (width)
• Number of bands
• Number of bits per pixel (bpp)
• File type
67