color image processing - university of california, san diego · full-color image processing cse...

27
Color Image Processing Image Processing CSE 166 Lecture 9

Upload: others

Post on 21-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

Color Image Processing

Image Processing

CSE 166

Lecture 9

Page 2: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

Announcements

• Assignment 3 is due today, 11:59 PM

• Midterm exam is on May 6

• Reading

– Sections 7.1-7.6: Color Image Processing

CSE 166, Spring 2019 4

Page 3: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

Electromagnetic spectrum

CSE 166, Spring 2019 5

Page 4: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

Separating visible light

CSE 166, Spring 2019 6

Page 5: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

Human eye cones

CSE 166, Spring 2019 7

Page 6: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

Mixing light

CSE 166, Spring 2019

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.

8

BLUE

GREEN

RED

CYAN

MAGENTA

YELLOW

Page 7: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

RGB color model

CSE 166, Spring 2019

RGB coordinates

9

RGB color cube

Page 8: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

XYZ color model andchromaticity coordinates

CSE 166, Spring 2019

Not actual colors

locations; just gives an idea

10

Page 9: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

Color gamuts

CSE 166, Spring 2019

Averageperson

Computermonitor

Printer

11

Page 10: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

HSI color model:Relationship to RGB color model

CSE 166, Spring 2019

All colors with cyan

hue

RGB color cube rotated such that line joining black and white

(intensity axis) is vertical

12

Page 11: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

HSI color model

CSE 166, Spring 2019

RGB color cube rotated such that

observer is on intensity axis, beyond white looking towards

black

Shape does not matter, only angle from red13

RGB color cube

HSI intensity axis

Page 12: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

HSI color model

CSE 166, Spring 2019

HS-plane is orthogonal to intensity axis

14

Page 13: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

CSE 166, Spring 2019

HSI

RGB

CMYK

15

Color models

CMY

Page 14: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

Intensity slicing

CSE 166, Spring 2019 16

Grayscale to 2 colors

Page 15: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

Intensity slicing

CSE 166, Spring 2019

Grayscale to 2 colors

17

Page 16: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

Intensity slicing

CSE 166, Spring 2019

Grayscale to 8 colors

18

Page 17: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

Intensity slicing

CSE 166, Spring 2019

Grayscale to 256 colors

Colorbar

19

Page 18: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

Intensity to color transformations

CSE 166, Spring 2019

Grayscale input image

RGBoutput image

20

Page 19: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

Intensity to color transformations

CSE 166, Spring 2019

X-ray grayscale input image

Misses explosive

RGB output images

Without explosive

With explosive

21

Page 20: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

Intensity to color transformations

CSE 166, Spring 2019

Multiple grayscale

input images

SingleRGB

output image

22

Page 21: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

Intensity to color transformations

Near infrared (NIR)

Red (R)

NIR,G,B as RGB R,NIR,B as RGB23

Green (G) Blue (B)

Multiple satellite

grayscale input

images

Output RGB imagesCSE 166, Spring 2019

Page 22: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

Intensity to color transformations

CSE 166, Spring 2019

SingleRGB

output image

Multiple grayscale input images,

some outside of visible spectrum

Close up

Physical and chemical

processes likely to affect sensor

response

24

Page 23: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

Full-color image processing

CSE 166, Spring 2019

Spatial filtering: process each channel independently

25

Page 24: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

Full-color image processing

CSE 166, Spring 2019

All RGB channels

HSI intensity channel only

Spatial filtering: image smoothing

26

Difference

Page 25: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

Full-color image processing

CSE 166, Spring 2019

All RGB channels

HSI intensity channel only

Spatial filtering: image sharpening

27

Difference

Page 26: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

Full-color image processing

CSE 166, Spring 2019

Histogram equalization: do not process each channel independently

1. RGB to HSI2. Histogram

equalize HSI intensity

3. HSI to RGB

28

4. HSI saturation adjustment

Page 27: Color Image Processing - University of California, San Diego · Full-color image processing CSE 166, Spring 2019 All RGB channels HSI intensity channel only Spatial filtering: image

Next Lecture

• Midterm exam review

CSE 166, Spring 2019 29