Unit 1 - Merged - Lecture Slides
Unit 1 - Merged - Lecture Slides
HLP
Input image World model
Compare
Low level Image with Perceived If Differences
processing features / reality appear
Image Model
Feedback to update
image model
Image representation - example
Algorithmic
components
Lecture 2
Image representation, digitization and properties
Image representation – some basics
• Mathematical models are used to describe signals - eg. Images
• Signal – ’function’ of one or more variables with physical meaning
• Signals can be 1D, 2D, 3D or higher dimensional
• Functions can be continuous, discrete or digital
• Continuous – domain and range are both continuous
• Discrete – domain is discrete, range is continuous
• Digital - domain and range are both discrete
Image representation – some basics (contd.)
• Monochromatic and color images – usually in the visible spectrum
• Images acquired outside the visible spectrum (but within EM
spectrum)
• Infra-red images
• Microwave imaging
p r
Distance - definitions
• Euclidean distance DE between two points (𝑖, 𝑗)and (ℎ, 𝑘)
𝐷! [ 𝑖, 𝑗 , ℎ, 𝑘 ] = 𝑖 − ℎ " + 𝑗 − 𝑘 "
• DE is intuitive but involves costly calculation due to square root
• Manhattan (or city block) distance D4 à only horizontal and vertical
moves are allowed
𝐷# 𝑖, 𝑗 , ℎ, 𝑘 = 𝑖 − ℎ + 𝑗 − 𝑘
• Chessboard distance D8 à diagonal moves are allowed (minimal no.
of King moves on a chessboard to go from one part to another
𝐷$ 𝑖, 𝑗 , ℎ, 𝑘 = 𝑚𝑎𝑥 | 𝑖 − ℎ |, | 𝑗 − 𝑘 |
Distance definitions
Pixel adjacency
• Two pixels are adjacent if the distance between them is 1
• 4-Neighbors
• Two pixels (p, q) are 4-neighbors if they have D4(p,q) = 1
• 8-Neighbors
• Two pixels (p, q) are 8-neighbors if they have D8(p,q) = 1
Distance transform
• Distance transform computes distance of pixels from some image
subset (such as object in an image)
• Used in several fast transforms in image processing
• Compute distance between object pixels (1’s) and background pixels
(0’s)
Object pixels have zero
distance from themselves
Distinct borders in
continuous case
Convex and non-convex regions
VIDEO
• Letters are the OBJECTS
• White space surrounded by letters eg. Inside D and O are HOLES
• The remainder of the white space in the image is the BACKGROUND
Topological properties - Convex Hull
• Convex Hull – smallest convex region containing the given input region
• Deficit of convexity – region inside convex hull that does not belong to
the object
• LAKES are akin to HOLES – lakes can be thought of as holes within a
convex hull
• BAYS are contiguous with the border
Topological properties
• Topological properties are invariant to “rubber sheet transforms”
• For eg. If the balloon is stretched
• Contiguity of regions is not changed
• Number of holes in the regions is also not changed
• Topological properties are qualitative properties
Brightness Histogram hf(z)
• hf(z) provides the frequency of brightness level ‘z’ in the image
• hf(z) gives an indication of the probability that a pixel (x,y) has
brightness level ‘z’
𝑝(𝑧; 𝑥, 𝑦)
• hf(z) is an estimate of 𝑝(𝑧)
• Position of pixel is not relevant for histogram
• One histogram may correspond to multiple images
• If position of ‘object’ is changed on a constant background, histogram will
remain unchanged
Brightness Histogram hf(z)
Cr will be a 5 x 5 matrix
Image matrix
Co-occurrence matrix (Cr)
• 4 pixel levels in image
– 0,1,2,3
• Offset = (∆𝑥, ∆𝑦) = (1,
0) à1 right, 0 down
• Pixel levels 1 and 0
occur in the defined
offset 2 times in the
image
• How many times pixel
levels 0 and 1 occur in
the defined offset ?
Image matrix Co-occurrence matrix (4x4) • Observe the diagonal
elements of Cr and
verify in the image
Integral image
• Matrix representation containing global image information
• Integral image values at a location (𝑖, 𝑗) is denoted 𝑖𝑖(𝑖, 𝑗)
• 𝑖𝑖(𝑖, 𝑗) represents the sum of all the original image pixel values left
and above (𝑖, 𝑗)
𝑖𝑖 𝑖, 𝑗 = * 𝑓(𝑘, 𝑙)
!"#,%"&
• The chain code from the reference pixel starting the chain (marked by
arrow) is
0 0 0 7
7
• 00077665555556600000006444444442221111112234445652211
Run length coding
• To record only areas belonging to objects in an image
• Selected area is represented as a ‘list of lists’
• Each row of image is described by a sublist
• First element is row number
• Subsequent numbers are in pairs – first element of pair is beginning of a run
and second element is the end of a run (beginning and end are described by
column coordinates)
• There can be multiple sequences in a row
Run length coding
Row number Start of run End of run
(11144) (1 1 1 4 4)
(214)
(2 1 4)
Run length code for this binary image is ((11144) (214) (52355))
Chain code and run length code are types of chain data structures
Topological data structures - Graphs
• Image described as a set of elements and their relations
• A graph G is defined as G = (V,E) where
• V = (v1, v2, v3, …,vn) are a set of nodes and E = (e1, e2, e3, …,em) are a set of arcs
• Each arc ek is incident to a pair of nodes (vi, vj)
• Degree of a node is number of arcs incident on the node.
v2 e2 e4 v5
e1
e5
v3 v4
v1
e3 v6
Topological data structures – Weighted
Graphs
w1
v2 e2 e4 v5
e1
w1 e5
v4 w4
v3
v1 w3
e3 v6
…………
Original image: Level 0 (root level) Level 1: 4 child nodes Level 2: each level 1 child node has
4 child nodes of its own
T-pyramids
• Every node of a T-pyramid has 4 child nodes
• Nodes at the last level (Level L) are called ‘leaf nodes’
• Leaf nodes represent individual pixels and have no child nodes
• Every node has a parent except the root node (Level 0 node)
Quad trees
• Modification of T-pyramids
• Like T-pyramids, image is divided into 4 quadrants
• Subsequent divisions in the hierarchy are applied only to those
quadrants that have non-homogenous regions (regions with varying
brightness levels)