DIP-Week 1 Introduction and Image Fundamentals
DIP-Week 1 Introduction and Image Fundamentals
Spring 2025
• Name
• Major
• Research interest
• Why do you take this course
This course
• It will involve a fair amount of math
– calculus, linear algebra, geometry
– probability
– analog/digital signal processing
– graph theory etc.
– Programming skills with matlab, Python, or C++
Required:
Digital Image Processing, Rafael C.
Gonzalez and Richard E. Woods, 4th
Edition, Global Edition
FIGURE 2.10 The electromagnetic spectrum. The visible spectrum is shown zoomed to facilitate explanations,
but note that it encompasses a very narrow range of the total EM spectrum.
Image acquisition
Network
Specialized
Hardcopy image processing Image processing
hardware software
FIGURE 1.24
Components of a general-
purpose image processing
system. Image sensors
Problem
domain
Histogram
equalization
Watermarking
Generate
watermark
Hidden message
Secret key
Biometrics
Digital camera
Photoshop
Human computer interaction
Medical imaging for diagnosis and treatment
Surveillance
Automatic driving
…
Fast-growing market!
5. IR image
1 and 3. http://en.wikipedia.org
2. http://radiology.rsna.org
4. http://emap-int.com
5. http://www.imaging1.com
4. Satellite image
Dr. Odai Al Soad DIP-Lect1-Intro & Imag. Fundamentals 22
Image Pipeline
180,000
Blind spot
Cones
Rods
No. of rods or cones per mm2
135,000
FIGURE 2.2
Distribution of rods and
cones in the retina. 90,000
45,000
Scotopic:
• Vision under low illumination
• rod cells are dominant
Photopic:
• Vision under good illumination
Weber Ratio/Fraction
Additional
∆I c light source
I
I + ∆ Short-duration flash
Small ratio: good brightness
discrimination
FIGURE 2.5
An opaque glass
Large ratio: poor brightness Basic experimental
discrimination setup used to
characterize
brightness
discrimination.
rod
cone
Dr. Odai Al Soad DIP-Lect1-Intro & Imag. Fundamentals 30
Intensity
a b
c d
FIGURE 2.9 Some well-known
optical illusions.
http://www.123opticalillusions.com/ http://brainden.com/optical-illusions.htm
f
P
d F
FOV
O
p
S1 S2
Thin lens theory: • Increasing the distance from the object to the lens
will reduce the size of image
•Large focus length will give a small FOV
FOV • d is the dimensions of the Lens
• f is the focal length
Dr. Odai Al Soad DIP-Lect1-Intro & Imag. Fundamentals 36
Airy disk
http://www.azuswebworks.com/photography/dof.html
Image plane
P1 P P2
F
O p1
p
p2
Dr. Odai Al Soad DIP-Lect1-Intro & Imag. Fundamentals 38
What Do We Do With All Of This Visual
Information??
“Bottom up processing”
Scenes
• Data-driven
Top-down
• Sensation reaches brain,
and then brain makes
sense of it Objects
35 45 20
43 64 52
10 29 39
30 frames/second
x[n1 , n2 , n3 ]
n1 = vertical position
n2 = horizontal position
n3 = frame number
Representing Digital Images
a f(x, y)
b c
FIGURE 2.18
(a) Image plotted
as a surface.
(b) Image displayed
as a visual intensity
array. (c) Image
shown as a 2-D nu-
merical array. (The
numbers 0, .5, and
1 represent black, y
gray, and white, x
respectively.)
Origin
y 0 0 0 0 0 0 0
0 0 0 0 0 0
0 0
0 0 .5 .5 .5
0 0 .5 .5
0 .5 1 1 1
1
1 .5
b = M ×N ×k 80 6
* 106 )
70
5
60
8
b
Megabytes (
4
50
When M = N, this equation becomes 40 3
30 2
20
→ b = N² k 10
1
0
0 1 2 3 4 5 6 7 8 9 10 * 103
FIGURE 2.21 N
Number of megabytes required to store images
for various values of N and k.
• The coordinate indices for a given linear index value α are given by
Image
Image f(x, y)
(M - 1, 0) α = M - 1 (M - 1, N - 1) α = MN - 1
(M - 1, 1) α = 2M - 1
Dr. Odai Al Soad x DIP-Lect1-Intro & Imag. Fundamentals 51
Spatial Resolution
1280*960
http://www.shimanodealer.com/fishing_reports.htm
Dr. Odai Al Soad DIP-Lect1-Intro & Imag. Fundamentals 52
Intensity Resolution
256 128 64 32
16 8 4 2
• Smallest discernible change in intensity levels
• Using the number of levels of intensities
• False contouring (banding) when k is small - undersampling
Dr. Odai Al Soad DIP-Lect1-Intro & Imag. Fundamentals 53
Isopreference Curves
http://www.brockmann-consult.de/beam/doc/help/general/ResamplingMethods.html
Assign each pixel in the output image with the nearest neighbor in the input image.
(It assigns to each new location the intensity of its nearest neighbor in the original
Image)
Bilinear Interpolation
v(x, y) = ax + by + cxy + d
Bicubic Interpolation
p X
and
Dr. Odai Al Soad DIP-Lect1-Intro & Imag. Fundamentals 58
Neighborhood Operations
Neighbors of a pixel
(x-1,y) (x-1,y-1) (x-1,y+1)
• Closed path: if the starting point is the same as the ending point
• p and q are connected: if there is a path from p to q in S
• Connected component: all the pixels in S connected to p
• Connected set: S has only one connected component
Are they connected sets? q
Euclidean distance
De ( p, q) = (x − u)2 + ( y − v)2
D4 distance p
M
6
D8 distance
q
Euclidean distance
𝟏𝟏 + 𝟓𝟓𝟐𝟐
Array/Matrix operations
Linear/nonlinear operations
Linearity:
Arithmetic Operations – single pixel operations
• Image averaging, image subtraction, image multiplication
Set and logic operations
Spatial operations
• Single pixel operations and neighborhood operations
Image transformation
Probabilistic methods
(Ω)
= A∩Bꟲ
Foreground/background
• Binary image: 0/1
• Fuzzy set: [0,1]
fm = f − min( f )
fs = K[ fm / max( fm )]
• Determined by
• Transformation function T
• Input intensity value
• Not depend on other pixels and position
IN BETWEEN THE THE INTENSITY LEVEL
Image smoothing
g( x, y) =
1
∑ f (r, c)
mn ( r,c )∈Sxy
FIGURE 2.43
Forming a vector
from
corresponding
pixel values in
three RGB
z1
component z = z2
images. z3 Component image 3 (Blue)
Component image 2 (Green)
D(z,a) = z − a = (z − a )2 + (z − a )2 +... + (z − a )2
1 1 2 2 n n
u = 0,1,..., M − 1
Inverse transformation kernel
v = 0,1,..., N − 1
x = 0,1,..., M − 1
y = 0,1,..., N − 1
86
Dr. Odai Al Soad DIP-Lect1-Intro & Imag. Fundamentals
Linear Systems
87
Dr. Odai Al Soad DIP-Lect1-Intro & Imag. Fundamentals
Linear Systems
∞ ∞
f [n=
1 , n2 ]**h[ n1 , n2 ] ∑ ∑
m1 = −∞ m2 = −∞
f [m1 , m2 ]h[n1 − m1 , n2 − m2 ]
88
Dr. Odai Al Soad DIP-Lect1-Intro & Imag. Fundamentals
Convolution Example
h
1 -1 -1
f
1 2 -1
2 2 2 3
1 1 1
2 1 3 3
Rotate
2 2 1 2
1 1 1 1 3 2 2
-1 2 1
-1 -1 1
From C. Rasmussen, U. of Delaware
Step 1 -1 2 1 2 1 3 3
-1 -1 1 2 2 1 2
h
1 3 2 2
1 1 1
-1 2
4 2 2 3 5
-1 2
-2 1 3 3
2 2 1 2
1 3 2 2
f f*h
From C. Rasmussen, U. of Delaware
Step 2 -1 2 1 2 1 3 3
-1 -1 1 2 2 1 2
h
1 3 2 2
1 1 1
2
-2 2
4 2 3 5 4
2
-2 1
-1 3 3
2 2 1 2
1 3 2 2
f f*h
From C. Rasmussen, U. of Delaware
Step 3 -1 2 1 2 1 3 3
-1 -1 1 2 2 1 2
h
1 3 2 2
1 1 1
2 2
-2 2
4 3 5 4 4
2 1
-1 3
-3 3
2 2 1 2
1 3 2 2
f f*h
From C. Rasmussen, U. of Delaware
Step 4 -1 2 1 2 1 3 3
-1 -1 1 2 2 1 2
h
1 3 2 2
1 1 1
2 2 2
-2 3
6 1 5 4 4 -2
2 1 3
-3 3
-3 1
2 2 1 2
1 3 2 2
f f*h
From C. Rasmussen, U. of Delaware
Step 5 -1 2 1 2 1 3 3
-1 -1 1 2 2 1 2
h
1 3 2 2
1 2 2 2 3 5 4 4 -2
-1 4
2 1 3 3 9
-1 -2
2 2 1 2
1 3 2 2
f f*h
From C. Rasmussen, U. of Delaware
Step 6 -1 2 1 2 1 3 3
-1 -1 1 2 2 1 2
h
1 3 2 2
2 2 2 3 5 4 4 -2
-2
2 2
1 3 3 9 6
2
-2 2
-2 1 2
1 3 2 2
f f*h
From C. Rasmussen, U. of Delaware
and so on…
1 1 1
1
* 9
1 1 1
=
1 1 1
97
Dr. Odai Al Soad DIP-Lect1-Intro & Imag. Fundamentals
Example
1 1 1
*
1 −8 1
1 1 1
=
98
Dr. Odai Al Soad DIP-Lect1-Intro & Imag. Fundamentals
Review Image Analysis
2D Fourier Transform
∞ ∞
F (u , v) = ∑∑
m = −∞ n = −∞
f [m, n]e − j 2π (um + vn )
Inverse DCT
N −1
(2n + 1)kπ
f [n] = ∑ F [k ]α (k ) cos
k =0 2N
Inverse DCT
M −1 N −1
(2m + 1)kπ (2n + 1)lπ
f [m, n] = ∑ ∑ F [k , l ]α (k )α (l ) cos cos
=k 0=l 0 2M 2N
(2n + 1)kπ
N −1
DCT of x[ n] : X C [k ] = α (k )∑ x[n]cos
n =0 2 N
πk
α (k ) −j
X C [k ] = e 2N
X F [k ]
2
D−1
f = D−1F
DD
=T
D=
T
D I
T
=
Β D A D
a = imread(‘cameraman.tif’);
DCTa = dct2(a);
DFTa = fft2(a); DFTa = fftshift(DFTa);
DCT DFT
figure; plot(abs(DCTa(1,:)));
figure; plot(abs(DFTa(128,:)));
DCT
f=[1 2 3];
Df1 = dct(f)
D=dctmtx(3);
Df2=D*f;
f2=D’*f;
g=[1 2 3; 4 5 6; 7 8 9];
Dg1=dct2(g);
Dg2=D*g*D’;
a = zeros(3,2)
b = ones(2,4)
c = rand(3,3) %Uniform distribution
help rand
help randn %Normal distribution
d1 = inv(c)
d2 = inv(rand(3,3))
d3 = d1+d2
d4 = d1-d2
d5 = d1*d2
d6 = d1.*d3
e = d6(:)
Convolution Integral
f=imread(‘saturn.tif’);
figure; imshow(f);
[height,width]=size(f);
f2=f(1:height/2,1:width/2);
figure; imshow(f2);
[height2,width2=size(f2);
f3=double(f2)+30*rand(height2,width2);
figure;imshow(uint8(f3));
h=[1 1 1 1; 1 1 1 1; 1 1 1 1; 1 1 1 1]/16;
g=conv2(f3,h);
figure;imshow(uint8(g));
118
Dr. Odai Al Soad DIP-Lect1-Intro & Imag. Fundamentals