color image processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf ·...

29
Color Image Processing Image Processing CSE 166 Lecture 9

Upload: others

Post on 21-Jul-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

Color Image Processing

Image Processing

CSE 166

Lecture 9

Page 2: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

Announcements

• Assignment 3 is due today, 11:59 PM

• Midterm exam is on May 4

• Reading

– Sections 7.1-7.6: Color Image Processing

CSE 166, Spring 2020 5

Page 3: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

Electromagnetic spectrum

CSE 166, Spring 2020 6

Page 4: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

Separating visible light

CSE 166, Spring 2020 7

Page 5: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

Human eye cones

CSE 166, Spring 2020 8

Page 6: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

Mixing light

CSE 166, Spring 2020

Light

Pigment

Primary and secondary colors are swapped

Note that green, cyan, and blue are not accurate colors in the book. More

accurate colors below.

9

BLUE

GREEN

RED

CYAN

MAGENTA

YELLOW

Page 7: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

RGB color model

CSE 166, Spring 2020

RGB coordinates

10

RGB color cube

Page 8: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

XYZ color model andchromaticity coordinates

CSE 166, Spring 2020

Not actual colors

locations; just gives an idea

11

Page 9: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

Color gamuts

CSE 166, Spring 2020

Averageperson

Computermonitor

Printer

12

Page 10: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

HSI color model:Relationship to RGB color model

CSE 166, Spring 2020

All colors with cyan

hue

RGB color cube rotated such that line joining black and white

(intensity axis) is vertical

13

Page 11: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

HSI color model

CSE 166, Spring 2020

RGB color cube rotated such that

observer is on intensity axis, beyond white looking towards

black

Shape does not matter, only angle from red14

RGB color cube

HSI intensity axis

Page 12: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

HSI color model

CSE 166, Spring 2020

HS-plane is orthogonal to intensity axis

15

Page 13: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

CSE 166, Spring 2020

HSI

RGB

CMYK

16

Color models

CMY

Page 14: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

Pseudocolor image processing

• Intensity slicing

• Intensity to color transformations

CSE 166, Spring 2020 17

Page 15: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

Intensity slicing

CSE 166, Spring 2020 18

Grayscale to 2 colors

Page 16: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

Intensity slicing

CSE 166, Spring 2020

Grayscale to 2 colors

19

Page 17: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

Intensity slicing

CSE 166, Spring 2020

Grayscale to 8 colors

20

Page 18: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

Intensity slicing

CSE 166, Spring 2020

Grayscale to 256 colors

Colorbar

21

Page 19: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

Intensity to color transformations

CSE 166, Spring 2020

Grayscale input image

RGBoutput image

22

Page 20: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

Intensity to color transformations

CSE 166, Spring 2020

X-ray grayscale input image

Misses explosive

RGB output images

Without explosive

With explosive

23

Page 21: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

Intensity to color transformations

CSE 166, Spring 2020

Multiple grayscale

input images

SingleRGB

output image

24

Page 22: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

CSE 166, Spring 2020

Intensity to color transformations

Near infrared (NIR)

Red (R)

NIR,G,B as RGB R,NIR,B as RGB25

Green (G) Blue (B)

Multiple satellite

grayscale input

images

Output RGB images

Page 23: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

Intensity to color transformations

CSE 166, Spring 2020

SingleRGB

output image

Multiple grayscale input images,

some outside of visible spectrum

Close up

Physical and chemical

processes likely to affect sensor

response

26

Page 24: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

Full-color image processing

• Two approaches

– Process each channel independently

– Process color vector space

CSE 166, Spring 2020 27

Page 25: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

Full-color image processing

CSE 166, Spring 2020

Spatial filtering: process each channel independently

28

Page 26: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

Full-color image processing

CSE 166, Spring 2020

All RGB channels

HSI intensity channel only

Spatial filtering: image smoothing

29

Difference

Page 27: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

Full-color image processing

CSE 166, Spring 2020

All RGB channels

HSI intensity channel only

Spatial filtering: image sharpening

30

Difference

Page 28: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

Full-color image processing

CSE 166, Spring 2020

Histogram equalization: do not process each channel independently

1. RGB to HSI2. Histogram

equalize HSI intensity channel

3. HSI to RGB31

4. HSI saturation adjustment

Page 29: Color Image Processing - cseweb.ucsd.educseweb.ucsd.edu/classes/sp20/cse166-a/lec9.pdf · Full-color image processing CSE 166, Spring 2020 All RGB channels HSI intensity channel only

Next Lecture

• Midterm exam review

CSE 166, Spring 2020 32