0% found this document useful (0 votes)
15 views

Lecture W2abc 2

The document provides an overview of digital image processing concepts, including types of images (binary, grayscale, color), image acquisition, sampling, quantization, and resolution. It discusses pixel neighborhoods, connected component analysis, distance measures, and arithmetic and logic operations on images. Additionally, it covers interpolation methods and their applications in image resizing and geometric corrections.

Uploaded by

hassiedward977
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Lecture W2abc 2

The document provides an overview of digital image processing concepts, including types of images (binary, grayscale, color), image acquisition, sampling, quantization, and resolution. It discusses pixel neighborhoods, connected component analysis, distance measures, and arithmetic and logic operations on images. Additionally, it covers interpolation methods and their applications in image resizing and geometric corrections.

Uploaded by

hassiedward977
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Dr.

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}

▪ For digital images


▪ The minimum gray level value is usually 0
▪ The maximum depends on number of quantization levels used to digitize an
image.
▪ The most common is 256 levels, so that the maximum gray level value is 255
2
▪ 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

▪ Connected Component Analysis


▪ Connected Component Labeling

▪ Distance Measures and Metrics


▪ Arithmetic and Logic Operations on Images
3
▪ An M x N image representation as a
matrix
▪ Space required to store each
intensity value
▪ Number of discrete intensity levels, L
▪ Number of bits used, k
L=2k
▪ Intensity levels are equally spaced
[0,L-1]
▪ Space required to store a digital
image (in bits): M x N x k

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

▪ Bit resolution (Gray Level Resolution)


▪ This defines the number of possible intensity/colour values that a pixel
may have
▪ Relates to the quantization of the image information
▪ Dynamic Range of Image
▪ Binary ? ; Grayscale ?? ; Colored ??
5
and Gray-Level

A 1024 x 1024, 8 bit image


subsampled down to size 32 x 32
pixels while the number of allowable
gray levels was kept at 256

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

▪ Interpolation is basic tool used extensively in tasks such as


zooming, shrinking, rotation and geometric corrections
▪ Process of using known data to estimate values at unknown
locations
▪ A method of constructing new data points within the range of a
discrete set of known data points

8
9
10
▪ Pixel decimation

11
Three commonly used interpolation methods:
▪ Nearest Neighbour Interpolation

▪ Simple but produces undesired artefacts


▪ Bilinear Interpolation
▪ Contribution from 4 neighbours

▪ Bicubic Interpolation
▪ Contribution from 16 neighbours

12
Pixel replication

13
Original image for which we want to enlarge by a factor of 2

Row wise zooming

Column wise zooming

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

▪ Connected Component Analysis


▪ Connected Component Labeling

▪ Distance Measures and Metrics


▪ Arithmetic and Logic Operations on Images
24
▪ Neighbors of pixel are the pixels that are adjacent pixels of an
identified pixel

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)

Pixel Neighbourhood coordinates explained


26
▪ Establishing boundaries of objects and
components in an image Boundaries like u can outline the shapes
▪ Group the same region by assumption
that the pixels being the same color or
equal intensity
▪ Two pixels p & q are connected if
▪ they are adjacent in some sense
▪ if their gray levels satisfy a specified
criterion of similarity
▪ Adjacency
▪ Pixels can be
▪ 4-adjacent, diagonally adjacent, 8-
adjacent, or m-adjacent
▪ Or with some similarity measure
27
▪ V - Set of gray levels used to define the criterion of similarity
▪ Set of gray levels V = {1}

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)

Note: Mixed connectivity can eliminate


the multiple path connections that
often occurs in 8-connectivity

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.

▪ m-adjacency (mixed adjacency):


▪ Two pixels p and q of the same value (or specified similarity)
are m-adjacent if either
i. q and p are 4-adjacent, or
ii. p and q are diagonally adjacent and do not have any
common 4-adjacent neighbors.
iii. They cannot be both (i) and (ii).
31
▪ Path: Let coordinates of pixel p: (x, y) and of pixel q: (s, t)
▪ A path from p to q is a sequence of distinct pixels with
coordinates: (x0, y0), (x1, y1), ..., (xn, yn)
▪ where (x0, y0) = (x, y) & (xn, yn) = (s, t) and (xi, yi) is adjacent to
(xi-1, yi-1) 1 ≤ i ≤ n

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)

▪ The Euclidean distance De(p, q)


D ( p, q) = (x − s)2 + ( y − t) 2
▪ The city-block (Manhattan) distance D4(p, q)

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

▪ These operations are performed on two images,


▪ except the NOT logic operation which require only one image,
and are done on a pixel by pixel basis
39
Various contents in this presentation have been taken from
different books, lecture notes, and the web. These solely belong
to their owners, and are here used only for clarifying various
educational concepts. Any copyright infringement is not
intended.

40

You might also like