N=M=30 What is an image? Image is a 2D rectilinear array of pixels (picture element) N=M=256 f(x,y):...
-
Upload
blaze-stewart -
Category
Documents
-
view
221 -
download
4
Transcript of N=M=30 What is an image? Image is a 2D rectilinear array of pixels (picture element) N=M=256 f(x,y):...
N=M=30
What is an image?
Image is a 2D rectilinear array of pixels (picture element)N=M=256
f(x,y):2
L=15(4 bits)L=255 (8 bits)
What is an image?No continuous values - Quantization
[ , ] :[1, ] [1, ] [0, ]f x y N M L
255
170
15
8
L=1 (1 bit) L=3 (2 bits)
An image is just 2D?No! – It can be in any dimensionExample 3D:
Voxel-Volume Element
An image is just 2D?No! – It can be in any dimensionAn image is a n-dimensional rectilinear array of elements
1 2[ ] :[1, ] [1, ] ...[1, ] [0, ]nf x N N N L
[ ] :[1, ] [0, ]nf x N L
f x: n
Does an image just map to scalars?
[ ] :[1, ] [1, ]n nf x N Lf x: n n
Roy van Pelt, PhD & Anna Vilanova, PhDTU/e Biomedical Image Analysis Group, 2012
Sampling and Quantization
• Sampling is digitizing the coordinate values of our function, e.g., f(x,y).
• Quantization is digitizing the amplitude values.
• In practice the sampling and quantization depend on the sensor arrangement that does the measurements.
A B
Digital vs Continuous Image
mm(11.25,11.25) [5,5]f f ( , ) [ , ]f i x j y f i j
Is the distance in mm between samples in x direction
is the distance in mm between samples in y direction
x
yy
xy
x
Spatial resolution defines the smallest spatial change that we will be able to distinguish, in spatial units!
Measures for that are dots per unit distance dpi, e.g., (dots per inch).
Contrast
• Dynamic range is lowest and highest intensity level that an image shows
• Contrast is the difference in intensity between the highest and the lowest level.
• High Dynamic range implies high contrast• Intensity resolution smallest discernible change in
intensity level. – Usually integer power of 2, measured by number of bits.– Whether you can distinguish all levels or not depends on
human perception.
False Contouring
Image Interpolation
• We use the data we know to estimate the values in unknown positions.
x
( )f x [ ] ( ) ( )f i f x f x
x?
Image Interpolation–Nearest Neighbour
• We use the data we know to estimate the values in unknown positions.
x
( )f x [ ] ( ) ( )f i f x f x
? x
0.5 [ ]( )
[ 1]
xi
x
xi f i
f x xf i
else
Example How does it work in 2D?
Image Interpolation – Linear Interpolation
• We use the data we know to estimate the values in unknown positions.
x
( )f x [ ] ( ) ( )f i f x f x
?
( ) (1 ) 1
x x i xi t
x x
f x f i t f i t
x
ExampleHow does it work in 2D?
Interpolation
• There are other methods for interpolation of higher order. Meaning more neighbors are involved and more complex curves are fitted.
Transformations
19
Motivation
How can we transform images?Apply transformation to all pixelsFirst do translation, then rotation, then scaling
tSRvv
20
Motivation
• Transformation in 2D
• Transformation using homogenous coordinatestSRvv
110012221
1211
y
x
taa
taa
y
x
y
x
21
Homogenous coordinates
• Allow to manipulate n-dim vectors in a n+1-dim space
• A point p can be written as vector • In homogenous coordinates we add a scaling factor
• To transform the homogenous coordinates in normal coordinate, divide by the n+1 coordinate.
y
xp
1
y
x
w
wy
wx
ph
22
Homogenous coordinates
• we note
• Proof:
11
:, y
x
by
x
aba
1/
/
/
1
y
x
aa
aay
aax
a
ay
ax
y
x
a
23
Translation
• Classic • Homogenous coordinates
y
x
tyy
txx
12
12
1
1
1
100
10
01
1
2
2
y
x
ty
tx
y
x
24
Rotation (clockwise)
• Classic • Homogenous coordinates
1)cos(1)sin(
1)sin(1)cos(
2
2
yaxay
yaxax
1
1
1
100
0)cos()sin(
0)sin()cos(
1
2
2
y
x
aa
aa
y
x
25
Translation and rotation
• Classic • Homogenous coordinates
tyyaxay
txyaxax
1)cos(1)sin(
1)sin(1)cos(
2
2
1
1
1
100
)cos()sin(
)sin()cos(
1
2
2
y
x
tyaa
txaa
y
x
26
Translation, rotation and scaling
• Classic • Homogenous coordinates
tyyasyxasxy
txyasyxasxx
1)cos(1)sin(
1)sin(1)cos(
2
2
1
1
1
100
)cos()sin(
)sin()cos(
1
2
2
y
x
tyasyasx
txasyasx
y
x
Affine Transformation
x2
y2
1
a11 a12 tx
a21 a22 ty
0 0 1
x1
y1
1
A transformation that preserves lines and parallelism (maps parallel lines to parallel lines) is an affine transformation.
• Demonstration
29
Rigid Transformations in 3d
• Around x-axis (counter-clockwise)
• Around y-axis• Around z-axis
• General
Rx (a)
1 0 0 0
0 cos(a) sin(a) 0
0 sin(a) cos(a) 0
0 0 0 1
Ry (b)
cos(b) 0 sin(b) 0
0 1 0 0
sin(b) 0 cos(b) 0
0 0 0 1
Rz(c)
cos(c) sin(c) 0 0
sin(c) cos(c) 0 0
0 0 1 0
0 0 0 1
T R
tx
ty
tz0 0 0 1
,R Rz(c)Ry (b)Rx (a)
30
Image transformation
For each position Pd in the destination image we searchthe pixel color I(Pd).
Source image Destination image
Tsd
31
Image transformation
First we compute a position Ps in the source image.
Source image Destination image
Tsd
1100
)cos()sin(
)sin()cos(
1d
d
yyx
xyx
s
s
y
x
tasas
tasas
y
x
32
Image transformation
• P is not integer.• How do we compute I(Pd)=I(Ps)?• Answer: by interpolation
Ps0 Ps1
Ps3Ps2
Ps
Pd
Tsd
• Demonstration