1 image basics hao jiang computer science department sept. 4, 2014

28
1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

Upload: barry-bridges

Post on 16-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

1

Image Basics

Hao Jiang

Computer Science Department

Sept. 4, 2014

Page 2: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

Image Formulation

The most common way to obtain an image is from a camera

2

Page 3: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

A “Simple” Camera

3

Let’s hold a sensor (a film) in front of the object.Hopefully we will have an image…

Page 4: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

A “Simple” Camera

4

Unfortunately, at the same image point, light may comefrom different source points on an object.

Page 5: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

The Pinhole Camera

5

Page 6: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

Camera with Lens

6

Page 7: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

The Imaging Model

7

lighting

Surface property: material, geometry.

Camera pose,Optical properties

Page 8: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

Images as Surfaces

Image can be treated as a 2D function z = f(x, y).

Page 9: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

Image Profile

9

Page 10: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

Sampling

To “digitize” the continuous image, we need to sample the image first.

Sampling on a grid Sampling problem

Page 11: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

The image of Barbara

Page 12: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

Aliasing due to sampling

Page 13: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

fs = 2.5f

fs = 1.67f

0 10 20 30 40 50 60 70 80 90 100-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

t

Am

plit

ud

e

Original signal

A new component is added

This is denotedas aliasing.

0 10 20 30 40 50 60 70 80 90 100-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

t

Am

plitu

de

Page 14: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

Image Resolution

Sensor: size of the real world scene into a single image pixel.

Image: number of Pixels.

14

Page 15: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

Digitization

The samples are continuous and have infinite number of possible values.

The digitization process approximates these values with a fixed number of numbers.

To represent N numbers, we need log2N bits.

So, what determines the number of bits we need for an image?

Page 16: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

Image as Matrices

16

174 167 184207 213 227

Page 17: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

Types of Digital Images

Grayscale image Usually we use 256 levels for each pixel. Thus we need

8bits to represent a pixel (2^8 == 256) Some images use more bits per pixel, for example MRI

images could use 16bits / pixel.

A 8bit grayscaleImage.

Page 18: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

Binary Image

A binary image has only two values (0 or 1).

Binary image is quite important in image analysis and objectdetection applications.

Page 19: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

Gay Scale Image as a Stack of Binary Images

[ b7 b6 b5 b4 b3 b2 b1 b0]

MSB LSB

Each bit plane is a binary image.

Page 20: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

Dithering

A technique to represent a grayscale image with a binary one.

0 1

2 3

Convert image to4 levels: I’ = floor(I/64)

Page 21: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

Color Image

r

g

b

24 bit image

Page 22: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

Color Table

Image with 256 colors

r

g

b

Clusters of colors

It is possible touse much less colorsto represent a color imagewithout much degradation.

Page 23: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

Gamma Correction

Display device’s brightness is not linearly related to the input.

I’ = I

To compensate for the nonlinear distortion we need to raise it to a power again

(I’)1/ = I

for CRT is about 2.2.

Page 24: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

Gamma Correction

Linearly increasing intensitywithout gamma correction

Linearly increasing intensitywith gamma correction

Page 25: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

Image File Formats

An image in “ppm” format:

P6: (this is a ppm image)Resolution: 512x512Depth: 0-255 (8bits per pixel in each channel)

Page 26: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

An image containsa header anda bunch of (integer) numbers.

Page 27: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

Image Compression and Encoding

Raw image takes a lot of space. Compute the file sizes of a raw image that has resolution 512x512 in true color. BMP, PPM, TXT

Images can be “compressed” losslessly or lossly Lossy image format: JPEG

Losslessly compressed image format: PNG

Compression ratio and bit rate

27

Page 28: 1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014

Digital Video

Frame N-1

Frame 0

time

Digital video is digitizedversion of a 3D functionf(x,y,t)