image analysis digital image fundamentalsraul/imageanalysis/fundamentals.pdfimage sensing and...

46
Image Analysis Digital Image Fundamentals Raul Queiroz Feitosa Gilson A. O. P. Costa

Upload: others

Post on 10-Jul-2020

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

Image Analysis

Digital Image Fundamentals

Raul Queiroz Feitosa

Gilson A. O. P. Costa

Page 2: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 2

Digital Image Fundamentals

Objective

“The purpose of this chapter is to introduce some

basic concepts related to digital images…”

Page 3: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 3

Digital Image Fundamentals

Contents: Elements of Visual Perception

Image Sensing and Acquisition

Image Sampling and Quantization

Image Interpolation

Color

Relationships Between Pixels

Page 4: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 4

Elements of Visual Perception

Structure of the Human Eye

Eye diameter ~ 20mm Fovea diameter ~ 1.5mm

Page 5: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 5

Elements of Visual Perception

Structure of the Human Eye

Light receptors in the retina: Rods and Cones

Page 6: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 6

Elements of Visual Perception

Structure of the Human Eye

Cones

• Highly sensitive to color

• Photopic (bright light) vision

• 3 types: S(blue); M(green); L(red)

• 6 to 7 mio, located primarily

in the fovea

100

80

60

40

20

400 450 500 550 600 650 700

ab

sorp

tion

wavelength

Page 7: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 7

Elements of Visual Perception

Structure of the Human Eye

Cones

• Highly sensitive to color

• Photopic (bright light) vision

• 3 types: S(blue); M(green); L(red)

• 6 to 7 mio, located primarily in the fovea

Rods

• Sensitive to low levels of illumination

• Scotopic (dim-light) vision

• 75 to 150 mio, distributed over the retina

Page 8: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 8

Elements of Visual Perception

Structure of the Human Eye

Page 9: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 9

Elements of Visual Perception

Cone density in fovea area: 150000/mm2 (comparable to artificial sensors)

Page 10: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 10

Elements of Visual Perception

Image Formation in the Eye

Page 11: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 11

Image Sensing and Acquisition

Sensing

sensor array

single sensor

line sensor

Page 12: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 12

Image Sensing and Acquisition

Single Sensor

Page 13: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 13

Image Sensing and Acquisition

Line Sensor

Page 14: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 14

Image Sensing and Acquisition

Sensor Array

Page 15: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 15

Image Sensing and Acquisition

Image Formation Model

In this part of the course images will be denoted by a

function of the form

f(x,y):R2→(0,∞)

with two components: illumination and reflectance

f(x,y) = i(x,y) r(x,y)

where

0< i(x,y) <∞ and 0< r(x,y) <1

Page 16: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 16

Image Sensing and Acquisition

Image Formation Model

The intensity i of a monochrome image at any coordinate (x ,y) is called the gray level of the image at that point. That is

i(x,y):R2→(0,∞)

Intensity lies in a range

0< Lmin≤ i(x,y) ≤ Lmax <∞

The interval [Lmin, Lmax ] is called gray scale

Common practice is to shift the interval to [0, L-1] where f(x,y)=0 is considered black and f(x,y)=L-1 is considered white.

Page 17: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 17

Image Sampling and Quantization

Sampling: digitizing in space

M colums

N r

ow

s

f(N,M)f(N,2)f(N,1)

f(2,M)f(2,2)f(2,1)

f(1,M)f(1,2)f(1,1)

yxf

),(

Matrix N M

pixel

Page 18: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 18

Image Sampling and Quantization

Quantization: digitizing the amplitude - 2m-1

- 0 - 1

Page 19: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 19

Image Sampling and Quantization

Sampling and quantization

Page 20: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 20

Image Sampling and Quantization

Result of sampling and quantization

Page 21: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 21

Image Sampling and Quantization

400x304 200x152 100x76 50x38

16 gray levels 8 gray levels 4 gray levels 2 gray levels

Page 22: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 22

Image Sampling and Quantization

Spatial resolution

pixels per unit distance

dots per inch (dpi)

pixels per inch (ppi)

Remote Sensing

ground sampling distance (GSD)

pixel resolution, e.g., pixel = 1x1m

Intensity resolution

number of bits used to quantize intensity (= gray levels)

pixel depth, e.g., 8 bits, 11bits, 16bits, etc.

Page 23: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 23

Image Interpolation

What is the intensity at a non-integer pixel coordinate?

(x1 ,y1) (x2 ,y1)

(x1 ,y2) (x2 ,y2)

(x ,y)

I(x ,y) = ax + by + cxy + d

I(x1,y1) = ax1 + by1 + cx1y1 + d

I(x2,y1) = ax2 + by1 + cx2y1 + d

I(x1,y2) = ax1 + by2 + cx1y2 + d

I(x2,y2) = ax2 + by2 + cx2y2 + d

4 unknowns

4

equations

Bilinear interpolation Bicubic interpolation

3

0

3

0

,

i j

ji

ijyxayxI

16 coefficients

16 equations

on 16 nearest neighbors

Page 24: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

Image Interpolation

What is the intensity at a non-integer pixel coordinate?

(x2 ,y1) Bilinear interpolation Bicubic interpolation

Page 25: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 25

Image Interpolation

1250 dpi (3692×2812)

↓↑

72 dpi (213×162)

1250 dpi (3692×2812)

↓↑

150 dpi (443×337)

nearest neighbor bilinear bicubic

Page 26: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 26

Image Interpolation

Geometric Transformations (T)

y

x x´

+

+

(xi´,yi´)=T(xi,yi)

(xj,yj)=T-1 (xj´,yj´) +

+

original image transformed image

pixels of the output image

are visited and their values

are estimated upon their

corresponding locations in

the input image

Page 27: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

Image Interpolation

Application: image co-registration Fitting of the coordinate system of an image to that of a second image

reference image (orthophoto) unregistered image

Page 28: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

Image Interpolation

Application: image co-registration Fitting of the coordinate system of an image to that of a second image

reference image (orthophoto) coregistered image

Page 29: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 29

Color

Multispectral Images are acquired by sensors sensitive to a

limited range of the electromagnetic spectrum

c =

where c = ~3x108m/s

Page 30: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 30

Color

Multispectral Images are acquired by sensors sensitive to a

limited range of the electromagnetic spectrum

cosmic rays gamma

rays

X

rays UV visibel

light

infra

red

termal

radiation

10-5nm 10-3nm 1 nm 0,3 m 0,4 m 0,75 m 3 m 15 m wavelength

Visible range

BLUE GREEN RED

Spectrum in bands

Remote Sensing

Page 31: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 31

Color

RGB and CYM Models

Primary colors

• red

• green

• blue

Secondary colors

• cyan

• yellow

• magenta

A secondary color subtracts or

absorbs a primary color and reflects

or transmits the others.

Any color can be expressed as

additive combinations of the

primary colors.

B

G

R

Y

M

C

1

1

1

Convertion operation

cyan

yellow

magenta

red green

blue

Page 32: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 32

Color

HSV Model Any color is defined by three values: • Hue (H): associated with the dominant

wavelength.

• Saturation (S): refers to the purity, or the

amount of white light mixed with a hue.

• Value (V): associated to brightness.

Advantages: • Brightness is expressed by intensity,

while chromaticity by hue and

saturation.

• Intimately related to the human

perception of colors.

Conversion Operation See text book

Page 33: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 33

Color

CIE Lab Model Any color is defined by three values: • L: associated with the brightness.

• a : - green / + magenta .

• b : - blue / + yellow.

Advantages: • Perceptually uniform: equal

distances on the CIELab space

correspond to equal perceived color

differences.

• Larger gamut (the number of

colors that can be accurately

represented).

Conversion Operation See text books

Page 34: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 34

Relationships Between Pixels

Neighbors of a Pixel

Neighborhood N4 Neighborhood ND Neighborhood N8

N8 = N4 ND

(x,y-1)

(x,y +1)

(x+1,y) (x-1,y) (x,y)

pixel p (x-1,y-1) (x+1,y-1)

(x+1,y+1) (x-1,y+1)

(x,y)

(x+1,y-1)

(x+1,y+1)

(x+1,y)

(x-1,y-1)

(x-1,y+1)

(x,y -1)

(x-1,y)

(x,y+1)

(x,y)

pixel p

Page 35: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 35

Relationships Between Pixels

Adjacency

Let V be the set of gray-levels used to define adjacency.

Two pixels p and q with values in V are adjacent if:

4-adjacency : q N4 (p),

8-adjacency : q N8 (p),

m-adjacency : (i) q N4 (p), OR

(ii) q ND (p) AND N4 (p) N4 (q) = .

q

p q p

q

p

q

p

q

p

adjacent adjacent adjacent non adjacent non adjacent

Page 36: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 36

Relationships Between Pixels

Why is this important?

How many objects are there in this picture?

Page 37: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 37

Relationships Between Pixels

Why is this important?

Are the object borders connected?

No if 4-adjacency is considered Yes for all adjacency types

Page 38: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 38

Relationships Between Pixels

Adjacency

Two image subsets S1 and S2 are adjacent if some pixel in S1 is adjacent to some pixel in S2.

Path

A (digital) path (or curve) from pixel p with coordinates (x,y) to pixel q with coordinates (s,t) is a sequence of distinct pixels with coordinates

(x0,y0), (x1,y1) , ... , (xn,yn)

where (x0,y0) = (x,y) , (xn,yn) = (s,t),

and (xi,yi) and (xi-1,yi-1) are adjacent for 1≤ i ≤ n.

Page 39: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 39

Relationships Between Pixels

Connectivity between pixel sets

Two pixels p and q are said to be connected in a subset S

of pixels in an image, if there exists a path between them

consisting entirely of pixels in S.

pixels in S

p q

p and q are connected in S ?

Page 40: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 40

Relationships Between Pixels

Connected components

For any pixel p in S, the set of pixels that are connected

to it in S is called a connected component of S.

Pixels in S are colored white

How many connected components in S ?

Page 41: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 41

Relationships Between Pixels

Connected components

If it only has one connected component, then the set S is

called a connected set.

Pixels in S are colored white

Is S a connected set?

Page 42: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 42

Relationships Between Pixels

Region

A subset of pixels R in an image is called a region if it

is a connected set.

How many regions (objects) in this image?

Page 43: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 43

Relationships Between Pixels

Boundary (border or contour)

The boundary of a region R is the set of pixels in the

region that have one or more neighbors that are not in

R.

Page 44: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 44

Relationships Between Pixels

Distance Measures

For pixels p, q and z with coordinates (x,y), (s,t),

and (u,v), respectively, D is a distance function or

metric if:

(a) D(p,q) 0 (D(p,q ) = 0, iff , p = q)

(b) D(p,q) = D(q,p ), and

(c) D(p,z) D(p,q ) + D(q,z ).

Page 45: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 45

Relationships Between Pixels

Commonly used distance functions:

Euclidean distance:

De(p,q) = [( x - s )2 + ( y - t )2]1/2

City-block (Manhatan) distance:

D4(p,q) = |( x - s )| + |( y - t )|

Chessboard distance:

D8(p,q) = max( |( x - s )| ,|( y - t )| )

D4

De D8

p

q

4 3 2 3 4

3 2 1 2 3

2 1 0 1 2

3 2 1 2 3

4 3 2 3 4

2 2 2 2 2

2 1 1 1 2

2 1 0 1 2

2 1 1 1 2

2 2 2 2 2

Page 46: Image Analysis Digital Image Fundamentalsraul/ImageAnalysis/Fundamentals.pdfImage Sensing and Acquisition Image Formation Model The intensity i of a monochrome image at any coordinate

8/14/2019 Digital Image Fundamentals 46

Next Topic

Image

Enhancement in the

Spatial Domain