Lecture W2abc 2
Lecture W2abc 2
Muhammad Shahzad
Department Of Computing (DOC), SEECS, NUST
http://seecs.nust.edu.pk/faculty/muhammadshahzad.html
[email protected]
Spring 2019, MSCS-8
▪ Binary images:
▪ ▪ f(x,y) ∈ {0,1}
▪ Gray scale images
▪ ▪ f(x,y) ∈ C : C = {0,….,255}
▪ Color images
▪ Described as three gray scale images
▪ Red, green, blue channels
▪ fR(x,y) ∈ C, fG(x,y) ∈ C , fB(x,y) ∈ C
▪ C = {0,….,255}
4
▪ Spatial resolution
▪ The column (C) by row (R) dimensions of the image define the number
of pixels used to cover the visual space captured by the image
▪ Relates to the sampling of the image information
▪ Temporal resolution
▪ For a continuous capture system such as video, this is the number of
images captured in a given time period.
▪ Measures in frames per second (fps); 30 fps normal video
6
Spatial and Gray-Level
256 128 64 32
7
16 8 4 2
▪ Zooming: Increasing the number of pixels in an image so that the
image appears larger
▪ Zooming may be viewed as oversampling
▪ Shrinking may be viewed as undersampling/subsampling
8
9
10
▪ Pixel decimation
11
Three commonly used interpolation methods:
▪ Nearest Neighbour Interpolation
▪ Bicubic Interpolation
▪ Contribution from 16 neighbours
12
Pixel replication
13
Original image for which we want to enlarge by a factor of 2
14
In this geometric visualisation, the
value at the black spot is the sum of
the value at each coloured spot
multiplied by the area of the rectangle
of the same colour, divided by the total
area of all four rectangles.
15
16
17
18
19
20
21
▪ Process of estimating, beyond the original observation range, the
value of a variable on the basis of its relationship with another
variable
▪ Example:
Hays & Efros, Scene Completion Using Millions of Photographs,
Computer Graphics Proceedings, Annual Conference Series, 2007
22
23
▪ Digital Image Acquisition
▪ Sampling and Quantization
▪ Image Representation
▪ Spatial, Temporal and Gray-Level Resolution
▪ Interpolation
▪ Pixel Neighbourhood
▪ Some Basic Relationships Between Pixels
▪ Neighborhood Adjacency and connectivity
25
▪ Pixel Neighbourhood
▪ N4(p) 4-neighbors: the set of horizontal and vertical neighbors
▪ ND(p) diagonal neighbors: the set of 4 diagonal neighbors
▪ N8(p) 8-neighbors: union of 4-neighbors and diagonal neighbors
O O O O O O
O X O X O X O
O O O O O O
N4(p) N8(p)
ND(p)
4-CONNECTIVITY
If gray level
28
▪ V - Set of gray levels used to define the criterion of similarity
▪ Set of gray levels V = {1}
8-CONNECTIVITY
If gray level
29
▪ V - Set of gray levels used to define the criterion of similarity
▪ Set of gray levels V = {1}
M-CONNECTIVITY (MIXED)
If gray level
30
▪ Adjacency:
▪ Two pixels that are neighbors are adjacent if they have
▪ same grey-level or
▪ some other specified similarity criterion
▪ Pixels can be
▪ 4-adjacent, diagonally adjacent, 8-adjacent, or m-adjacent.
32
▪ Connectivity in a subset S of an image
▪ Two pixels are connected if there is a path between them that lies
completely within S
▪ Connected component of S:
▪ The set of all pixels in S that are connected to a given pixel in S
▪ Region of an image
▪ Boundary, border or contour of a region
▪ Edge
▪ A path of one or more pixels that separate two regions of
significantly different gray levels
33
▪ In Matlab :bwconncomp(BW)
▪ Demo
34
36
p has coordinates (x,y)
q has coordinates (s,t)
z has coordinates (u,v)
▪ Distance function: A function of two points, p and q, in space that
satisfies three criteria
(a) D( p, q) 0 (where 0 when p = q only)
(b) D( p, q) = D(q, p), and
(c) D( p, z) D( p, q) + D(q, z)
D4 ( p, q) =| x − s | + | y − t |
▪ The chessboard distance D8(p, q)
D8 ( p, q) = max(| x − s |,| y − t |)
37
▪ Distance of each grey pixel from the closest white pixel
▪ Which distance measures are used in the figure below?
38
▪ Arithmetic and logic operations are often applied as preprocessing
steps in image analysis in order to combine images in various way
▪ Arithmetic Operations
▪ Addition,
▪ Subtraction,
▪ Division
▪ Multiplication
▪ Logic Operations
▪ AND
▪ OR,
▪ NOT
40