CS4495/6495 Introduction to Computer Vision 2A-L1 Images as - - PowerPoint PPT Presentation

β–Ά
cs4495 6495
SMART_READER_LITE
LIVE PREVIEW

CS4495/6495 Introduction to Computer Vision 2A-L1 Images as - - PowerPoint PPT Presentation

CS4495/6495 Introduction to Computer Vision 2A-L1 Images as functions Images as functions Images as functions Images as functions Images as functions Quiz An image can be thought of as: a) A 2-dimensional array of numbers ranging from some


slide-1
SLIDE 1

2A-L1 Images as functions

CS4495/6495 Introduction to Computer Vision

slide-2
SLIDE 2

Images as functions

slide-3
SLIDE 3

Images as functions

slide-4
SLIDE 4

Images as functions

slide-5
SLIDE 5

Images as functions

slide-6
SLIDE 6

Quiz

An image can be thought of as:

a) A 2-dimensional array of numbers ranging from

some minimum to some maximum

b) A function I of x and y: 𝐽(𝑦, 𝑧) c)

Something generated by a camera.

d) All of the above.

slide-7
SLIDE 7

Images as functions

We think of an image as a function, 𝑔 or 𝐽, from 𝑆2 to 𝑆:

𝑔(𝑦, 𝑧) gives the intensity or value at position (𝑦, 𝑧)

slide-8
SLIDE 8

Images as functions

We think of an image as a function, 𝑔 or 𝐽, from 𝑆2 to 𝑆:

𝑔(𝑦, 𝑧) gives the intensity or value at position 𝑦, 𝑧

Practically define the image over a rectangle, with a finite range:

𝑔: [𝑏, 𝑐] 𝑦 [𝑑, 𝑒] οƒ  [π‘›π‘—π‘œ, 𝑛𝑏𝑦]

slide-9
SLIDE 9

Color images as functions

A color image is just three functions β€œstacked”

  • together. We can write this as a β€œvector-valued”

function:

Source: S. Seitz

( , ) ( , ) ( , ) ( , ) r x y f x y g x y b x y

 οƒΉ οƒͺ οƒΊ οƒͺ οƒΊ οƒͺ οƒΊ  

ο€½

slide-10
SLIDE 10

The real Phyllis

slide-11
SLIDE 11

Digital images

In computer vision we typically operate on digital (discrete) images:

Sample the 2D space on a regular grid Quantize each sample (round to β€œnearest integer”)

Adapted from S. Seitz

slide-12
SLIDE 12

Digital images

Image thus represented as a matrix of integer values.

Adapted from S. Seitz

slide-13
SLIDE 13

Adapted from S. Seitz

2D 1D

i j

slide-14
SLIDE 14

Matlab – images are matrices

slide-15
SLIDE 15

Matlab – images are matrices

>> im = imread('peppers.png'); % semicolon or many numbers >> imgreen = im(:,:,2);

slide-16
SLIDE 16

100 200 300 400 500 100 200 300 400 500

Matlab – images are matrices

>> im = imread('peppers.png'); % semicolon or many numbers >> imgreen = im(:,:,2); >> imshow(imgreen) >> line([1 512], [256 256],'color','r') >> plot(imgreen(256,:));

slide-17
SLIDE 17

Noise in images

  • Noise is just another function that is combined

with the original function to get a new – guess what – function

Β’ I (x, y) = I (x, y)+h(x, y)

slide-18
SLIDE 18

Common Types of Noise

Salt and pepper noise: random occurrences of black and white pixels

slide-19
SLIDE 19

Common Types of Noise

Impulse noise: random occurrences of white pixels

slide-20
SLIDE 20

Common Types of Noise

Gaussian noise: variations in intensity drawn from a Gaussian normal distribution

slide-21
SLIDE 21

Gaussian noise

Fig: M. Hebert

>> noise = randn(size(im)).*sigma; >> output = im + noise;

slide-22
SLIDE 22

Noise images: Images showing noise values generated with different sigma 𝜏 = 2, 8, 32, 64 Guess sigma for each noise image sigma = sigma = sigma = sigma =

noise = randn(size(im)).*sigma

Quiz: Effect of Οƒ on Gaussian noise

slide-23
SLIDE 23

Noise images: Images showing noise values generated with different sigma 𝜏 = 2, 8, 32, 64 Guess sigma for each noise image

noise = randn(size(im)).*sigma

Quiz: Effect of Οƒ on Gaussian noise

sigma = 2 sigma = 8 sigma = 32 sigma = 64

slide-24
SLIDE 24

Values of Οƒ to use

  • A 𝜏 of 1.0 would be tiny if the range is [0 255]

but huge if pixels went from [0.0 1.0].

  • Matlab can do either and you need to be very

careful - if in doubt convert to doubles.

slide-25
SLIDE 25

Displaying images in Matlab

Look at the Matlab function imshow()

imshow(im,[LOW HIGH])

will display the image im with value LOW as black and HIGH as white.

slide-26
SLIDE 26

Displaying images in Matlab

Look at the Matlab function imshow()

imshow(im,[])

will display the image im with the based on the range of pixel values in im.

slide-27
SLIDE 27

Quiz

When adding noise to images as arithmetic operators we have to worry about:

a)

The speed of the addition operation

b)

The magnitude of noise compared to the range of the image

c)

Whether we add the noise to the image or the image to the noise (the order of operation)

d)

None of the above