You are on page 1of 14

Application Oriented Image Analysis

Lecture 2 - Digitization

Maria Axelsson, maria@cb.uu.se

Reading instructions

„ Chapters for this lecture


… 2.2 – 2.6 in Gonzalez-Woods

2007-10-17 Maria Axelsson, maria@cb.uu.se

1
Questions

„ What is a digital image?


„ How are resolution, sampling and quantization
related?
„ What is connectivity in a digital image?
„ How can we measure distances in a digital
image?
„ ...

2007-10-17 Maria Axelsson, maria@cb.uu.se

2007-10-17 Maria Axelsson, maria@cb.uu.se

2
Signals for digital imaging
„ Visible light
… Digital camera
… Light microscope
… Confocal microscope
„ IR and UV light
„ X-ray
… Tomography
„ Radio waves
… Magnetic Resonance Imaging
„ Gamma rays
„ Microwaves Not based on
… Radar EM waves
„ Electrons
… Scanning electron microscopy
„ Ultrasound
„ ...

2007-10-17 Maria Axelsson, maria@cb.uu.se

Digital image - f(x,y)

pixel - picture element


x

⎛ f ( 0,0) f ( 0,1) f ( 0,2 ) f ( 0,3) ⎞


⎜ ⎟
⎜ f (1,0) f (1,1) f (1,2 ) f (1,3) ⎟
y
⎜ f ( 2 ,0) f ( 2 ,1) f ( 2 ,2 ) f ( 2 ,3)⎟
⎜ ⎟
⎝ f ( 3,0) f ( 3,1) f ( 3,2 ) f ( 3,3) ⎠ 2 3 1 1
0 1 2 2
0 3 1 1
2 3 2 2

2007-10-17 Maria Axelsson, maria@cb.uu.se

3
Sensors for digital imaging

„ To image something we need sensors that can


capture the energy of the signal.
„ There are specific types of sensors for all
different signals that can be imaged
„ Some important categories are

Single sensor Sensor strips Sensor arrays

2007-10-17 Maria Axelsson, maria@cb.uu.se

Sensors for digital imaging (cont)

„ The output from each sensor is a positive finite


value proportional to the recieved energy
„ The continious value needs to be possible to
represent in a computer, it needs to be digitized.

„ Digitizing the coordinate values is called sampling

„ Digitizing the amplitude values is called quantization

2007-10-17 Maria Axelsson, maria@cb.uu.se

4
Resolution

„ Spatial resolution - sampling

„ Grey level resolution – quantization

2007-10-17 Maria Axelsson, maria@cb.uu.se

Sampling

„ Uniform sampling
… Square grid, Rectangular grid, Hexagonal grid

„ Non-uniform sampling
… Closer where it is necessary, eye.

„ Image size
… 128 x 128, 256 x 256, 512 x 512, 1024 x 1024

„ The sampling is normally determined by the


sensor arrangement
2007-10-17 Maria Axelsson, maria@cb.uu.se

5
Spatial grids

Square Rectangular Hexagonal


(Common) (z-direction in medical) (Theory)

2007-10-17 Maria Axelsson, maria@cb.uu.se

Sampling example

512 128 32

256 64
2007-10-17 Maria Axelsson, maria@cb.uu.se

6
Grey level resolution

„ Min = 0
„ Max = 2n – 1
„ Levels = 2n

n Levels Comments
1 2 Binary
5 32 Eye
8 256 Common
16 65536 Medical

2007-10-17 Maria Axelsson, maria@cb.uu.se

256 128 64
32 16 8
4 2

2007-10-17 Maria Axelsson, maria@cb.uu.se

7
Dimensions

„ Image, 5-dimensions, f(x,y,z,t,b)

„ x, y, z – spatial

„ t – time

„ b – spectral

2007-10-17 Maria Axelsson, maria@cb.uu.se

Volume – f(x,y,z)

HIV volume

Slice 40 Slice 50 Slice 60


2007-10-17 Maria Axelsson, maria@cb.uu.se

8
Spectral image – f(x,y,b)

Color image

Red Green Blue


2007-10-17 Maria Axelsson, maria@cb.uu.se

Neighbours

Pixel p with coordinate (x,y)

N4(p): N8(p):
4-neighbour 8-neighbour
( x , y − 1) ( x − 1, y − 1) ( x , y − 1) ( x + 1, y − 1)
( x − 1, y ) ( x + 1, y ) ( x − 1, y ) ( x + 1, y )
( x , y + 1) ( x − 1, y + 1) ( x , y + 1) ( x + 1, y + 1)

2007-10-17 Maria Axelsson, maria@cb.uu.se

9
Connectivity, adjacency

„ Connection between pixels.


„ 4- or 8-connectivity.
… p and q 4-connected if
q is in N4(p) with similar grey level.
… p and q 8-connected if
q is in N8(p) with similar grey level

2007-10-17 Maria Axelsson, maria@cb.uu.se

Connectivity, examples

4-connectivity 8-connectivity

2007-10-17 Maria Axelsson, maria@cb.uu.se

10
Path

„ Sequence of adjacent pixels between A and B.


„ A path can be 4- or 8-connected.

2007-10-17 Maria Axelsson, maria@cb.uu.se

Connected components

„ Object

„ Path between every pixel pair.

„ 4- or 8-connectivity.

2007-10-17 Maria Axelsson, maria@cb.uu.se

11
Labeling

„ Giving each object a label.


„ 4- or 8-connectivity.

Binary image Labeled image

2007-10-17 Maria Axelsson, maria@cb.uu.se

Algorithm

A – pixel of interest
Pass 1 Pass 2
If A = 1 Give equivalent labels
If B=0 AND C=0 one label.
new label
If B=1 (or C=1),
let A=label of the B (C)
If B=1 AND C=1 with same label
let A= label of B
If B=1 AND C=1 with different label
let A=label of B, update equivalence table

2007-10-17 Maria Axelsson, maria@cb.uu.se

12
Exampel

Pass 1 Pass 2

2007-10-17 Maria Axelsson, maria@cb.uu.se

Measuring distance

„ Euclidean, square root of two

„ City-block, infinity (2 steps req. gives dist. 2)

„ Chessboard, one

2007-10-17 Maria Axelsson, maria@cb.uu.se

13
Reading instructions

„ Chapters for next lecture


Point processes
… 3.1 – 3.4 in Gonzalez-Woods

2007-10-17 Maria Axelsson, maria@cb.uu.se

14

You might also like