0% found this document useful (0 votes)
13 views59 pages

DIP - Lecture 3

The document discusses different distance measures between pixels in digital images including Euclidean, city block, chessboard, and M-distance. It also covers common image file formats, the differences between raster and vector graphics, and mathematical tools used in digital image processing such as arrays, matrices, linear and nonlinear operations.

Uploaded by

nassehbwaya
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)
13 views59 pages

DIP - Lecture 3

The document discusses different distance measures between pixels in digital images including Euclidean, city block, chessboard, and M-distance. It also covers common image file formats, the differences between raster and vector graphics, and mathematical tools used in digital image processing such as arrays, matrices, linear and nonlinear operations.

Uploaded by

nassehbwaya
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/ 59

Digital Image Processing

ITU 08207 & CSU 08202


Lecture Outline
▪ Distance Measures between pixels
• Euclidean distance
• The City block distance
• Chessboard distance
• M-distance
▪ Image File Formats
• Raster Graphics Images
• Vector Graphics Images
▪ Mathematics Tools used in Digital Image Processing
• Array vs Matrix operations
• Linear vs Non-Linear operations
• Logic Operations
• Arithmetic Operations
• Set Operations
• Spatial operations

2
Department of Computing & Communication Technology
Distance Measures between Pixels
Distance Measure

Euclidean Distance

3
Department of Computing & Communication Technology
Distance Measures between Pixels
Distance Measure
Euclidean Distance

4
Department of Computing & Communication Technology
Distance Measures between Pixels
Distance Measure
The City Block Distance

5
Department of Computing & Communication Technology
Distance Measures between Pixels
Distance Measure
The City Block Distance

6
Department of Computing & Communication Technology
Distance Measures between Pixels
Distance Measure
The Chessboard Distance

7
Department of Computing & Communication Technology
Distance Measures between Pixels
Distance Measure
The Chessboard Distance

8
Department of Computing & Communication Technology
Distance Measures between Pixels
Examples

9
Department of Computing & Communication Technology
Distance Measures between Pixels
Examples

10
Department of Computing & Communication Technology
Distance Measures between Pixels
Examples

11
Department of Computing & Communication Technology
Distance Measures between Pixels
Examples

12
Department of Computing & Communication Technology
Distance Measures between Pixels
M-Distance Measure (𝑫𝒎 )

13
Department of Computing & Communication Technology
Distance Measures between Pixels
M-Distance Measure (𝑫𝒎 )

14
Department of Computing & Communication Technology
Distance Measures between Pixels
M-Distance Measure (𝑫𝒎 )

15
Department of Computing & Communication Technology
Distance Measures between Pixels
M-Distance Measure (𝑫𝒎 )

16
Department of Computing & Communication Technology
Distance Measures between Pixels

17
Department of Computing & Communication Technology
Distance Measures between Pixels

18
Department of Computing & Communication Technology
Distance Measures between Pixels

19
Department of Computing & Communication Technology
Distance Measures between Pixels

Digital Path between Pixels

20
Department of Computing & Communication Technology
Distance Measures between Pixels

21
Department of Computing & Communication Technology
Distance Measures between Pixels

22
Department of Computing & Communication Technology
Image File Formats

23
Department of Computing & Communication Technology
Image File Formats
Why Image File Format is Important

24
Department of Computing & Communication Technology
Image File Formats
Image Compressions

25
Department of Computing & Communication Technology
Image File Formats
Two Categories of Images

26
Department of Computing & Communication Technology
Image File Formats
Two Categories of Images

27
Department of Computing & Communication Technology
Image File Formats
Two Categories of Images

28
Department of Computing & Communication Technology
Image File Formats
Two Categories of Images

29
Department of Computing & Communication Technology
Image File Formats
Two Categories of Images

30
Department of Computing & Communication Technology
Image File Formats
Two Categories of Images

31
Department of Computing & Communication Technology
Image File Formats
Two Categories of Images

32
Department of Computing & Communication Technology
Image File Formats
Two Categories of Images

33
Department of Computing & Communication Technology
Image File Formats
Two Categories of Images

34
Department of Computing & Communication Technology
Mathematical Tools used in DIP
Array vs Matrix Operations

35
Department of Computing & Communication Technology
Mathematical Tools used in DIP
Array vs Matrix Operations

Linear vs Non-Linear operations

36
Department of Computing & Communication Technology
Mathematical Tools used in DIP
Arithmetic Operations

37
Department of Computing & Communication Technology
Mathematical Tools used in DIP
Arithmetic Operations

38
Department of Computing & Communication Technology
Mathematical Tools used in DIP
Arithmetic Operations

If the result of the


operation is below the
pixel range (0 -255),
then the minimum
value is selected

If the result of the


operation is above the
pixel range (0 - 255)
then select the
maximum range value,
i.e., if the value is
above 255, then 255 is
selected

39
Department of Computing & Communication Technology
Mathematical Tools used in DIP
Arithmetic Operations
If the result is
infinity/undefined then zero
is selected

If the result of the operation


is a floating point, then
round off the value

Logical Operations

40
Department of Computing & Communication Technology
Mathematical Tools used in DIP
Logical Operations

41
Department of Computing & Communication Technology
Mathematical Tools used in DIP
Logical Operations

42
Department of Computing & Communication Technology
Mathematical Tools used in DIP
Set Operations
• Set operations in image involve performing logical operations on
pixel values of two or more images to create a new resulting
image
• These operations are based on set theory principles and are
commonly used for tasks such as image blending, image
segmentation, and image masking
• The most commonly used set operations in image processing are
union, intersection, and complement

43
Department of Computing & Communication Technology
Mathematical Tools used in DIP
Set Operations

44
Department of Computing & Communication Technology
Mathematical Tools used in DIP
Set Operations
• If every element of a set A is also an element of a set B, then A is
said to be a subset of B, and is written as

• The Union of two sets A and B, which is the set of elements


belonging to either A, B, or both is written as

• The Intersection of two sets A and B is the set of elements


belonging to both A and B, is written as

45
Department of Computing & Communication Technology
Mathematical Tools used in DIP
Set Operations
• Two sets A and B are said to be disjoint or mutually exclusive if
they have no common elements, in which case

• The complement of a set A is the set of elements that are not in A

• The difference of two sets A and B, written as A – B is defined as


the set of elements that belong to A, but not to B

46
Department of Computing & Communication Technology
Spatial Operations
• Spatial operations involve performing operations on the spatial
domain of an image, which refers to the pixel-level representation of
the image
• These operations involve manipulating pixel values within a
neighborhood of each pixel, allowing for local analysis and
modification of the image
• Common spatial operations in image processing include

▪ Single-pixel operation
▪ Neighborhood operation and
▪ Geometric Spatial Transformation
47
Department of Computing & Communication Technology
Spatial Operations
Single-pixel/point Operation
▪ A single-pixel spatial operation refers to an operation that is applied to a
single (individual) pixel in an image, without considering any neighboring
pixels
▪ In a single-pixel spatial operation, the operation is applied independently
to each pixel in the image, without considering the context of the
surrounding pixels
▪ This type of operation is used for simple and local modifications of
individual pixel values
▪ Examples of single-pixel spatial operations are:
• Intensity scaling: Intensity scaling involves adjusting the intensity
values of individual pixels by multiplying them by a constant factor or
adding a constant value. This operation can be used to enhance or
normalize the overall brightness of an image
48
Department of Computing & Communication Technology
Spatial Operations
Single-pixel/point Operation
▪ Examples of single-pixel spatial operations are:
• Color manipulation: Single-pixel spatial operations can be used to modify
specific colors of pixels in an image. For example, one can modify the red,
green, or blue component of a pixel independently to change the color
balance or achieve color effects
• Pixel inversion: Pixel inversion, also known as negation, involves inverting
the intensity value of a pixel. For example, if the original pixel value is 150
(on a scale of 0 to 255), the inverted value would be (255 – 150 = 105).
This operation can be used for image enhancement or for creating
negative images

49
Department of Computing & Communication Technology
Spatial Operations
Single-pixel/point Operation
▪ The simplest operation that can be performed on a digital image is to
alter the values of its pixels based on their intensity, this process may be
expressed as a transformation function, T, of the form

Where z is the intensity of a pixel in the original image and


s is the (mapped) intensity of the corresponding pixel in the
processed image

50
Department of Computing & Communication Technology
Spatial Operations
Single-pixel/point Operation

51
Department of Computing & Communication Technology
Spatial Operations
Neighborhood Spatial Operation
▪ A neighborhood spatial operation, also known as a local spatial
operation, refers to an operation that is applied to a group of pixels
within a defined neighborhood or window in an image
▪ Unlike single-pixel spatial operations, neighborhood operations consider
the values of neighboring pixels to compute the output value for each
pixel
▪ Neighborhood spatial operations are particularly useful for tasks that
involve analyzing or modifying the local characteristics or relationships
of pixels
▪ By considering the values of neighboring pixels, the operations can
capture spatial information and exploit the context within a local region
of the image

52
Department of Computing & Communication Technology
Spatial Operations
Neighborhood Spatial Operation
▪ Examples of neighborhood spatial operations include
• Filtering: Filtering operations involve applying a filter to a neighborhood of
pixels and computing a new value for the central pixel based on the values
of the surrounding pixels
✓ Common filters include averaging filters (such as the mean filter) for
smoothing or blurring an image, and edge detection filters (such as the
Sobel) for highlighting edges
• Adaptive Filtering: Adaptive filtering techniques adjust the filter
coefficients based on the characteristics of the neighborhood
✓ These operations allow for adaptive noise reduction or image enhancement

53
Department of Computing & Communication Technology
Spatial Operations
Neighborhood Spatial Operation
▪ Let 𝑆𝑥𝑦 be a set of coordinates of neighborhood centered at a point (x,y)
in an image “f”
▪ Neighborhood processing generates a corresponding pixel at the same
coordinates in an output (processed) image “g”, such that the value of
that pixel is determined by a specified operation involving the pixels in
the input image with the coordinates in 𝑆𝑥𝑦
▪ For example, suppose the operation is to compute the average value of
the pixels in a rectangular neighborhood of the size m x n centered on
(x,y), the location of pixels in this region constitutes the set 𝑆𝑥𝑦 is given
by

54
Department of Computing & Communication Technology
Spatial Operations
Neighborhood Spatial Operation
▪ From the function

▪ r and c are the row and column coordinates of the pixels whose
coordinates are members of the set 𝑆𝑥𝑦
▪ The image “g” is created by varying the coordinates (x, y) so that the
center of the neighborhood moves from pixel to pixel in an image “f”, and
repeating the neighborhood operation at each new location

55
Department of Computing & Communication Technology
Spatial Operations
Neighborhood Spatial Operation

▪ Padding: is the process of adding one row to the top, one row to the bottom, one
column to the left, and one column to the right and initializing the values to zero to
help solve the boundary problem
▪ Padding helps to solve the boundary problem but the output of the image size does
not change
56
Department of Computing & Communication Technology
Spatial Operations
Neighborhood Spatial Operation

Central pixel Neighboring pixel

57
Department of Computing & Communication Technology
Spatial Operations
Neighborhood Spatial Operation
Padded image

Central pixel Neighbor pixels


Padding process Central pixel

▪ If the central pixel (target pixel) is at a position where there are no neighbors, the
process of padding is applied

58
Department of Computing & Communication Technology
End

59
Department of Computing & Communication Technology

You might also like