25

infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

Embed Size (px)

Citation preview

Page 1: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images
Page 2: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

2infinity-project.org

Engineering education

for today’s classroom

Outline

• How Can We Use Digital Images?

• A Digital Image is a Matrix

• Manipulating Images

• Improving Images for Robot Eyes

Page 3: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

3infinity-project.org

Engineering education

for today’s classroom

4.1 How Can We Use Digital Images?

Page 4: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

4infinity-project.org

Engineering education

for today’s classroom

The Power of Digital Images

• It is easier and easier to acquire or make digital imagesDigital cameras and scanners

• Chief advantage over analog (e.g. film) images: Easy to change

• How might we change images?

Page 5: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

5infinity-project.org

Engineering education

for today’s classroom

Image Softening and Blurring

Page 6: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

6infinity-project.org

Engineering education

for today’s classroom

Image Sharpening

Page 7: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

7infinity-project.org

Engineering education

for today’s classroom

Finding Edges in Images

• Edges in images usually define solid objects in our 3D world

• Finding edges is a first step to navigation and manipulation

Page 8: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

8infinity-project.org

Engineering education

for today’s classroom

Subtracting Images

•Image subtraction is a simple way to find differences between two images

•Useful for security, recognition, and navigation applications

Page 9: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

9infinity-project.org

Engineering education

for today’s classroom

Image Segmentation

• Segmentation: Dividing images into regions

• Applications Identifying

foreground vs. background

Finding objects using only one image

Page 10: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

10infinity-project.org

Engineering education

for today’s classroom

4.2 A Digital Image Is a Matrix

Page 11: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

11infinity-project.org

Engineering education

for today’s classroom

Digital Images are Matrices

• Matrix: An array of numbers

A =

101134

5610

751214 3 rows and 4 columns

• Elements: A(i,j) , i and j are integers

Examples: A(2,3) = 6,A(1,4) = 7, A(3,4) = 10

Page 12: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

12infinity-project.org

Engineering education

for today’s classroom

Classes of Image Manipulation

1. Mapping: Pixel-by-pixel operations2. Arithmetic Combination of Two Images:

e.g. addition, multiplication3. Filtering: Operations on groups of pixels

in an image (neighborhood operation)Fact: Almost all applications are made up of

simple combinations of these manipulations

Page 13: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

13infinity-project.org

Engineering education

for today’s classroom

Image Mapping

• All of the form B(i,j) = {function of

A(i,j)}

where B(i,j) is the output image

• Many familiar effects:Brightness, Contrast, Negative,

Thresholding, Gamma Correction

Page 14: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

14infinity-project.org

Engineering education

for today’s classroom

k = -50

k = 50

Brightness Mapping

B(i,j) = A(i,j) + kk = constant

(expressed as a table)

Page 15: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

15infinity-project.org

Engineering education

for today’s classroom

Example: Brightness Mapping

Original 24-bit image

Each color increased

by 60

Each color decreased

by 60

Green and blue +60, red -60

Page 16: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

16infinity-project.org

Engineering education

for today’s classroom

Contrast Mapping

• Formula: B(i,j) = s • A(i,j) If s > 1, contrast is increased If s < 1, contrast is decreased

• Need to quantize after multiplying, as s • A(i,j) may not be an integer

• Aside: This setting is found on most TV sets

Page 17: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

17infinity-project.org

Engineering education

for today’s classroom

Contrast Mapping (cont.)

s > 1

s < 1

s > 1 and k < 0

s < 1 and k > 0

Page 18: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

18infinity-project.org

Engineering education

for today’s classroom

Example: Contrast and Brightness

• Formula: B(i,j) = s • A(i,j) + k

• This is easy to do!

Higher contrast

Higher contrast

with lower

brightness

Page 19: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

19infinity-project.org

Engineering education

for today’s classroom

Example: Contrast and Brightness

• Given the 4-bit grayscale image

A =

101134

5610

751214

• Compute the image with a contrast of 1.5 and a

brightness of 2

Page 20: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

20infinity-project.org

Engineering education

for today’s classroom

Solution: Contrast and Brightness

• Answer: B(i,j) = 1.5•A(i,j) + 2

B = 151578

101142

13101515 Quantization causes values such as 9.5 and 3.5 to be rounded up

Image is clipped at 15

(Why?)

Page 21: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

21infinity-project.org

Engineering education

for today’s classroom

Infinity Project Experiment – 4.1

Page 22: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

22infinity-project.org

Engineering education

for today’s classroom

Brightness and Contrast Grayscale

Page 23: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

23infinity-project.org

Engineering education

for today’s classroom

Brightness and Contrast Color Image

Page 24: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

24infinity-project.org

Engineering education

for today’s classroom

Brightness and Contrast Color Camera

Page 25: infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images

25infinity-project.org

Engineering education

for today’s classroom

Brightness and Contrast Cascade