comp 319 lecture 02 introduction to multimedia comppguting

37
COMP 319 Lecture 02 Introduction to Multimedia Computing Fiona Yan Liu Department of Computing The Hong Kong Polytechnic University

Upload: others

Post on 01-Jun-2022

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

COMP 319 Lecture 02

Introduction to Multimedia Computingp g

Fiona Yan LiuDepartment of Computing

The Hong Kong Polytechnic University

Page 2: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

Learning Outputs of Lecture 01Learning Outputs of Lecture 01

I d i l i di h l Introduction to multimedia technology What is multimedia  History of multimedia technology History of multimedia technology Reference reading: Chapter 1

Introduction to html Introduction to html What is html Html document with web generation Reference reading: Chapter 1

Introduction to COMP319 http://www.comp.polyu.edu.hk/~csyliu/course/comp319/main.html

Lecture 02: Color Model and Human VisionSept. 11, 2014  2

Page 3: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

Outline of Lecture 02Outline of Lecture 02

F d t l f i d t t ti Fundamentals of image data representation Standard image

Gray‐level image Gray level image Bitmap and bitplane

Color image Light and human vision Different color models 24‐bit color image and 8‐bit color image 24‐bit color image and 8‐bit color image Histogram and color lookup tables

Some popular image file formatsp p g Reference reading

Chapter 3 & Chapter 4

Lecture 02: Color Model and Human VisionSept. 11, 2014  3

Page 4: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

Outline of Lecture 02Outline of Lecture 02

F d t l   f i  d t   t ti Fundamentals of image data representation Standard image

Gray‐level image Gray level image Bitmap and bitplane

Color image Light and human vision Different color models 24‐bit color image and 8‐bit color image 24‐bit color image and 8‐bit color image Histogram and color lookup tables

Some popular image file formatsp p g Reference reading

Chapter 3 & Chapter 4

Lecture 02: Color Model and Human VisionSept. 11, 2014  4

Page 5: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

Fundamentals of Image Data Representation

f l Images consist of pixels The smallest discrete component of an image on the screen

Image resolution The number of pixels in a digital image

Standard imagesg Illustrate algorithms and compare the performance Lena: for gray‐level image generallyg y g g y Baboon: for color image generally

Lecture 02: Color Model and Human VisionSept. 11, 2014  5

Page 6: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

Standard ImagesStandard Images

Lena: Image Resolution is 256 * 256

Baboon: Image Resolution is 512* 512

Lecture 02: Color Model and Human VisionSept. 11, 2014  6

Page 7: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

Outline of Lecture 02Outline of Lecture 02

F d t l f i d t t ti Fundamentals of image data representation Standard image

Gray­level image Gray level image Bitmap and bitplane

Color image Light and human vision Different color models 24‐bit color image and 8‐bit color image 24‐bit color image and 8‐bit color image Histogram and color lookup tables

Some popular image file formatsp p g Reference reading

Chapter 3 & Chapter 4

Lecture 02: Color Model and Human VisionSept. 11, 2014  7

Page 8: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

Gray Level ImageGray‐Level Image

Image is represented using luminance information only 8‐bit gray‐level image

Each pixel has a gray value between 0 and 25524-bit color Image Gray Image

Lecture 02: Color Model and Human VisionSept. 11, 2014  8

Page 9: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

Binary ImageBinary Image

Each pixel is stored as a single bit 0/1 Each pixel is stored as a single bit 0/1. Also referred as 1‐bit image Use for the pictures containing simple graphics or textp g p g p

Lecture 02: Color Model and Human VisionSept. 11, 2014  9

Page 10: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

Bitmap of Gray level ImageBitmap of Gray‐level Image

The two‐dimensional array of pixel values that represent the images/graphicsp g /g p

Lecture 02: Color Model and Human VisionSept. 11, 2014  10

Page 11: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

Bitplane of 8 bit imageBitplane of 8‐bit image

Bi l Bitplanes Consider the 8‐bit image as a set of 1‐bit bitplanesE h l i t f 1 bit t ti f th Each plane consists of a 1‐bit representation of the image 

Lecture 02: Color Model and Human VisionSept. 11, 2014  11

Page 12: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

Outline of Lecture 02Outline of Lecture 02

F d t l f i d t t ti Fundamentals of image data representation Standard image

Gray‐level image Gray level image Bitmap and bitplane

Color image Light and human vision Different color models 24‐bit color image and 8‐bit color image 24‐bit color image and 8‐bit color image Histogram and color lookup tables

Some popular image file formatsp p g Reference reading

Chapter 3 & Chapter 4

Lecture 02: Color Model and Human VisionSept. 11, 2014  12

Page 13: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

Light and PrismLight and Prism

h l Light is an electromagnetic wave White light contains all the colors of a rainbow

Sir Isaac Newton's experiment

Lecture 02: Color Model and Human VisionSept. 11, 2014  13

Page 14: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

Light and Spectral Power Distribution

Most light sources produce contributions over many wavelengths Most light sources produce contributions over many wavelengths SPD shows the relative amount of light energy

Spectral power distribution of daylight

Lecture 02: Color Model and Human VisionSept. 11, 2014  14

Page 15: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

The Color of the LightThe Color of the Light

Th l f th li ht i h t i d b th l th The color of the light is characterized by the wavelength of the light

Short wavelengths produce a blue sensation, long g p , gwavelengths produce a red one

Spectral power distribution of daylight

Lecture 02: Color Model and Human VisionSept. 11, 2014  15

Page 16: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

Human VisionHuman Vision

Humans cannot detect all light Visible light is an electromagnetic wave in the range g g g400 nm to 700 nm

Human vision is formedHuman vision is formed  Sensor: Eye Most sensitive to red(R) green(G) and blue(B) Most sensitive to red(R), green(G), and blue(B).

Processor: Brain R G B R,G,B

R‐G, G‐B, and B‐R

Lecture 02: Color Model and Human VisionSept. 11, 2014  16

Page 17: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

Human RetinaHuman Retina

f f d d Human retina consists of an array of rods and three kinds of cones

Rod Detect gray‐level information

Cones Three kinds of cones are used to detect R,G,B, , The proportions of R,G,B cones are 40:20:1

The eye is most sensitive to light in the middle The eye is most sensitive to light in the  middle of the visible spectrum

Lecture 02: Color Model and Human VisionSept. 11, 2014  17

Page 18: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

RGB Color ModelRGB Color Model

Th Three primaries Red, green and blue

Additive color model  When two light beams impinge on a target, their colors addadd

Lecture 02: Color Model and Human VisionSept. 11, 2014  18

Page 19: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

24 bit Color Image of RGB Model24‐bit Color Image of RGB Model24-bit color Image Red Channel

R 8‐bit

G 8 bit 8‐bit

B Blue Channel Green Channel

8bit

Lecture 02: Color Model and Human VisionSept. 11, 2014  19

Page 20: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

24 bit Color Image24‐bit Color Image

Each pixel is represented by three bytes, usually RGB. Supports 256*256*256, totally 16.8‐million possible combined color.

Storage: for image resolution of 640*480, needs 921.6KB

Some 24‐bit color images are stored as 32‐bit imageimage Extra byte of data for special‐effect information

Lecture 02: Color Model and Human VisionSept. 11, 2014  20

Page 21: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

Color Lookup Tables (CLTs)Color Lookup Tables (CLTs)

U i d d l i t d f 24 bit Use index or code value instead of 24‐bit color information for each pixelC l l k h bl k ll f ll Color lookup the table works well for small combinations

Lecture 02: Color Model and Human VisionSept. 11, 2014  21

Page 22: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

Image HistogramImage Histogram

R f t th b bilit f ti f th i Refers to the probability mass function of the image intensities

5

6Original data: 4.2 3.4 0 4.5 4.2 1.7 6 3.8 3

The number of containers is equal to six

2

3

4

1

2

1 2 3 4 5 6 7 80

1

0 1 2 3 4 5 60

4The number of containers is equal to three

3

4

1

2

Lecture 02: Color Model and Human VisionSept. 11, 2014  22

1 2 30

Page 23: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

8 bit Color Image8‐bit Color Image

Di id h RGB b i l lid i h Divide the RGB cube into equal slides in each dimension R: 3 bit; G: 3 bit; B: 2 bit; R: 3‐bit; G: 3‐bit; B: 2‐bit; Edge artifacts

24-bit color image 8-bit color image

Lecture 02: Color Model and Human VisionSept. 11, 2014  23

Page 24: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

L*a*b* Color ModelL*a*b* Color Model

P l if Perceptual uniform Color differences a human 

perceives as equal correspond to Euclidean distances

RGB color model is not perceptual uniformperceptual uniform

L*a*b* color model is perceptual uniform  

L* l i L*: luminance a*: red/green balance b*: green/blue balanceg /

Lecture 02: Color Model and Human VisionSept. 11, 2014  24

Page 25: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

RGB and CIE L*a*bRGB and CIE L*a*b

Lecture 02: Color Model and Human VisionSept. 11, 2014  25

Page 26: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

HSV Color ModelHSV Color Model

A f l f Approximation of perceptual uniform  Hue:  position in the color spectrum Saturation:  the vividness of a color Value: the brightness of the color Value:  the brightness of the color

Lecture 02: Color Model and Human VisionSept. 11, 2014  26

Page 27: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

YUV Color ModelYUV Color Model

B d i JPEG Be used in JPEG  Y: luminance value

Luma Y’: (gamma‐corrected)(g ) U and V: chrominance

The difference between a color and a reference white at the same luminanceluminance

U = B’ – Y’ V = R’ –Y’

Lecture 02: Color Model and Human VisionSept. 11, 2014  27

Page 28: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

Gamma CorrectionGamma Correction

’ l h d Human’s response is not linear to the driving voltage of display device

Lecture 02: Color Model and Human VisionSept. 11, 2014  28

Page 29: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

YUV Color ModelYUV Color Model

Lecture 02: Color Model and Human VisionSept. 11, 2014  29

Page 30: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

YC C color modelYCbCr color model

YC C color model is closely related to the YUV YCbCr color model is closely related to the YUV transformation Be used in MPEG Be used in MPEG

Lecture 02: Color Model and Human VisionSept. 11, 2014  30

Page 31: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

YIQ Color ModelYIQ Color Model

YIQ is used in NTSC color TV broadcasting Y’ in YIQ is the same as in YUV I and Q are a rotated version of U and V

U and V are rotated by 330

Lecture 02: Color Model and Human VisionSept. 11, 2014  31

Page 32: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

YIQ color modelYIQ color model

I and Q in YIQ model

U and V in YUV d lYUV model

Lecture 02: Color Model and Human VisionSept. 11, 2014  32

Page 33: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

Subtractive Color ModelSubtractive Color Model

Addi i l d l Additive color model  When two light beams impinge on a target, their colors addS bt ti l d l Subtractive color model For ink deposited on paper, opposite situation holds

RGB color model CMY color model

Lecture 02: Color Model and Human VisionSept. 11, 2014  33

Page 34: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

CMY Color Model and CMYK Color Model

CMY color model consist of CMY color model consist of Cyan(C), Magenta(M) and Yellow(Y) Subtractive color primaries

Transformation from RGB to CMY The transformation is invertible

CMYK color model Add one color: real black Using black ink is cheaper and better than using the mixing colored 

ink

Lecture 02: Color Model and Human VisionSept. 11, 2014  34

Page 35: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

Outline of Lecture 02Outline of Lecture 02

F d t l f i d t t ti Fundamentals of image data representation Standard image

Gray‐level image Gray level image Bitmap and bitplane

Color image Light and human vision Different color models 24‐bit color image and 8‐bit color image 24‐bit color image and 8‐bit color image Histogram and color lookup tables

Some popular image file formatsp p g Reference reading

Chapter 3 & Chapter 4

Lecture 02: Color Model and Human VisionSept. 11, 2014  35

Page 36: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

Some Popular Image File FormatsSome Popular Image File Formats

BMP BMP BitMap Mainly use RGB color modely

Gif Graphics Interchange Format

I t t f t b f it hi t i l ti t th WWW Important formats because of its historical connection to the WWW and HTML 

PDF Portable Document Format Include compression

JPEG JPEG Joint Photographic Experts Group Currently the most important common file format

Lecture 02: Color Model and Human VisionSept. 11, 2014  36

Page 37: COMP 319 Lecture 02 Introduction to Multimedia Comppguting

Announcement of Further Arrangement

Lab Lab Thur. 16:30 – 17:20 PQ604B Tue.  9:30 – 10:20 PQ606

Quiz Quiz The first quiz will be next Thur. Sept. 18 8:30 – 9:00  Cover Lecture 1 ‐ 2

Form of the questions Form of the questions True or False Answer the questions Calculation

Lecture 02: Color Model and Human VisionSept. 11, 2014 

Calculation

37