DIGITAL IMAGE PROCESSING
LECTURE # 1
INTRODUCTION
10th Jan, 2024 Dr. Ali Javed
10 Image
“A picture is worth a thousand words”
Anonymous
Dr. Ali Javed
What is an Image?
11
q Image is a source of information according to information theory
q An image may be defined as a two dimensional function f(x,y) where x and
y are spatial coordinates and amplitude of f at any pair of coordinates(x,y)
is called the intensity or Gray level of the image at that point.
Dr. Ali Javed
Digital Image
12
q When x,y and the amplitude values of f are all finite, discrete quantities, we call
the image a Digital Image.
q A digital Image is composed of a finite number of elements each of which has a
particular location and value
q These elements are referred to as Picture Elements, Image Elements, Pels or Pixels.
q In digital imaging, a pixel is the smallest piece of information in an image.
Dr. Ali Javed
Pixel
13
q Pixels are normally arranged in a regular 2-dimensional grid, and are often
represented using dots or squares
q The intensity of each pixel is variable; in grayscale images we have one color value
while in color systems, each pixel has typically three or four components such as red,
green, and blue, or cyan, magenta, yellow, and black
Dr. Ali Javed
Digital Image Processing
14
q Image Processing deals with algorithms that transform an input image into a
new image (processed image)
q DIP is the field of processing digital images by means of a digital computer
q Digital image processing focuses on two major tasks
ü Improvement of pictorial information for human interpretation
ü Processing of image data for storage, transmission and representation for
autonomous machine perception
Dr. Ali Javed
Image Types
15
q Binary Image
ü 1 Sample per point
q Gray scale Image
ü 1 Sample per point
q Color Image
ü 3 or 4 Samples per point
Dr. Ali Javed
Digital Image Representation
16
q A digital image f(x,y) is discretized both in spatial coordinates and brightness
q It can be considered as a matrix whose row column indices specify a point in the
image and the element value identifies the gray level value at that point
q Spatial discretization by Sampling
q Intensity discretization by quantization
Dr. Ali Javed
Digital Image Representation
17
Dr. Ali Javed
Video [8]
18
q A digital video consists of frames that are presented to the viewer's eye in rapid succession to
create the impression of movement.
q Each frame within a digital video can be uniquely identified by its frame index, a serial
number.
q A shot is a sequence of frames shot uninterruptedly by one camera. In the context of shot
transition detection they are usually group into two types:
ü Abrupt Transitions
ü Gradual Transitions
Dr. Ali Javed
Video Transitions [8]
19
q Abrupt Transitions (Cuts) - This is a sudden transition from one shot to another, i. e.
one frame belongs to the first shot, the next frame belongs to the second shot. They
are also known as hard cuts or simply cuts.
q Gradual Transitions - In this kind of transitions the two shots are combined using
chromatic, spatial or spatial-chromatic effects which gradually replace one shot by
another. These are also often known as soft transitions and can be of various types,
e.g., wipes, dissolves, fades...
Dr. Ali Javed
Gradual Transitions [9-10]
20
q Dissolve: A dissolve is a gradual
transition from one image to another.
q The terms fade-out (also called fade
to black) and fade-in are used to
describe a transition to and from a
blank image.
q Wipe: A wipe is a type of film
transition where one shot replaces
another by travelling from one side of
the frame to another or with a special
shape.
Dr. Ali Javed
Why Image/Video?
21
q The magic of Tele-Vision (Greek word, Tele means far away, vision is for sight)
ü Our vision capability is extended in space. You don’t need to travel to liberty
island NY to watch statue of liberty
Dr. Ali Javed
A Historical Overview of DIP
22
q Bartlane cable picture transmission system was a technique
invented in 1920 to transmit images over cable lines between London
and New York in 1920s. It was named after its inventors Harry G.
Bartholomew and Maynard D. McFarlane and was first used to transmit
a picture across the Atlantic in 1920. Using the Bartlane system, images
could be transmitted across the Atlantic in less than three hours. [2]
Dr. Ali Javed
A Historical Overview of DIP
23
qThe number of distinct gray levels coded by Bartlane system
was improved from 5 to 15 by the end of 1920s.[2]
Dr. Ali Javed
The Boom of Digital Images in the Last 25 Years
24
q Acquisition
ü Digital cameras, scanners
ü Infrared and microwave imaging etc
q Transmission
ü Internet, satellite and wireless communication
q Storage
ü CD/DVD, Blu-ray
ü Flash memory
q Display
ü CRT monitors, LCD monitor, LED Monitors
ü PDAs, smart phones, smart watches
Dr. Ali Javed
25 Key Stages in DIP
q Image Acquisition
q Image Enhancement
q Image Restoration
q Image Compression
q Color Image Processing
q Morphological Image Processing
q Image Segmentation
q Representation and Description
q Image Recognition
Dr. Ali Javed
Key Stages in Digital Image Processing
26
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Representation
Image
&
Acquisition Description
Object
Problem Domain Recognition
Color Image Image
Processing Compression
Dr. Ali Javed
Key Stages in Digital Image Processing
27
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Representation
Image
&
Acquisition Description
Problem Domain Object
Recognition
Color Image Image
Processing Compression
Dr. Ali Javed
Image Acquisition
28
q The first stage of any vision system is the image acquisition stage.
¨ An image is captured by a sensor (such as a monochrome or color TV
camera) & digitized
¨ If the output of the camera or sensor is not already in digital form, an ADC
converter digitizes it
q Images are processed after acquisition.
q However, if the image has not been acquired satisfactorily then the intended
tasks may not be achievable
Dr. Ali Javed
Key Stages in Digital Image Processing
29
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Representation
&
Acquisition
Description
Problem Domain Object
Recognition
Color Image Image
Processing Compression
Dr. Ali Javed
Image Enhancement
30
q The aim of image enhancement is to improve the perception of information in images for
human viewers, or to provide better input for other automated image processing
techniques.
q Image enhancement techniques can be divided into two broad categories:
ü Spatial domain methods, which operate directly on pixels, and
ü Frequency domain methods, which operate on the Fourier transform of an image.
Dr. Ali Javed
Image Enhancement
31
Dr. Ali Javed
Key Stages in Digital Image Processing
32
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Representation
Image
&
Acquisition Description
Problem Domain Object
Recognition
Color Image Image
Processing Compression
Dr. Ali Javed
Image Restoration
33
q Image restoration refers to the recovery of an original signal from degraded
observations.
q The purpose of image restoration is to "compensate for" or "undo" defects which
degrade an image. Degradation comes in many forms such as motion blur, noise, and
camera misfocus.
Dr. Ali Javed
Image Enhancement vs Image Restoration
34
q Image enhancement : process image to emphasize features of the image that make the image
more pleasing to the observer or to process image so that the result is more suitable for a
specific application, is largely a subjective process.
q Image restoration : recover image from distortions to its original image, is largely an objective
process.
q Image enhancement is the improvement of digital image quality without knowledge about the
source of degradation. If the source of degradation is known, one calls the process image
restoration
Dr. Ali Javed
Key Stages in Digital Image Processing
35
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Object
Acquisition Recognition
Representation
Problem Domain &
Description
Color
ColorImage
Image Image
Processing
Processing Compression
Dr. Ali Javed
Morphological Image Processing
36
q Deals with Tools for extracting image components that are useful in the
representation & description of shape
Dr. Ali Javed
Key Stages in Digital Image Processing
37
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Representation
Image
&
Acquisition Description
Object
Problem Domain
Recognition
Color Image Image
Processing Compression
Dr. Ali Javed
Image Segmentation
38
q Segmentation refers to the process of partitioning a digital image into
multiple segments (sets of pixels, also known as super pixels). The goal of
segmentation is to simplify and/or change the representation of an image
into something that is more meaningful and easier to analyze
q Image segmentation is typically used to locate objects and boundaries (lines,
curves, etc.) in images
Dr. Ali Javed
Image Segmentation
39
q Object detection builds a bounding box corresponding to each class in the
image. But it tells us nothing about the shape of the object. We only get the
set of bounding box coordinates. We want to get more information – this is
too vague for our purposes.
q Image segmentation creates a pixel-wise mask for each object in the image.
This technique gives us a far more granular understanding of the object(s) in
the image.
Dr. Ali Javed
Image Segmentation
40
q Image Segmentation algorithms generally are based on one of two basic properties
of intensity values:: Discontinuity and Similarity
q Through Discontinuity the approach is to partition an image based on abrupt changes
in intensity, such as edges in an image
q Through Similarity, the approach is based on partitioning an image into regions that
are similar according to a set of predefined criteria. Thresholding, region growing,
region splitting and merging are examples of methods in this category
Dr. Ali Javed
Image Segmentation
41
q Region growing
q Selection of seed point, lets select 6
q Select the threshold, lets select t<3
5 6 6 7 7 7 6 6
6 7 6 7 5 5 4 7
6 6 4 4 3 2 5 6
5 4 5 4 2 3 4 6
0 3 2 3 3 2 4 7
0 0 0 0 2 2 5 6
1 1 0 1 0 3 4 4
1 0 1 0 2 3 5 4
Dr. Ali Javed
Image Segmentation
42
q Region splitting and merging
q Split the image, e.g. in four quadrants
q Select any region, and take a difference between the maximum and minimum value in the region
q Compare the difference against the selected threshold, e.g. t<=3
q If the difference is within the threshold, then don’t split the region further else split the region again
into four quadrants
q Once further split is not possible then we start merging. Here we consider adjacent regions.
q Take the maximum of one region and minimum of second region and compare the difference
against the threshold. Repeat this by picking the minimum of first and maximum of second region.
If both meets the threshold criteria, then we can merge the two selected regions.
5 6 6 7 7 7 6 6
6 7 6 7 5 5 4 7
6 6 4 4 3 2 5 6
5 4 5 4 2 3 4 6
0 3 2 3 3 2 4 7
0 0 0 0 2 2 5 6
1 1 0 1 0 3 4 4
Dr. Ali Javed 1 0 1 0 2 3 5 4
Image Segmentation
43
q Can you identify the difference between these two? Both the images are using image
segmentation to identify and locate the people present.
q In image 1, every pixel belongs to a particular class (either background or person).
Also, all the pixels belonging to a particular class are represented by the same color
(background as black and person as pink). This is an example of semantic
segmentation
q Image 2 has also assigned a particular class to each pixel of the image. However,
different objects of the same class have different colors (Person 1 as red, Person 2
as green, background as black, etc.). This is an example of instance segmentation.
Dr. Ali Javed
Key Stages in Digital Image Processing
44
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain
Recognition
Color Image Image
Processing Compression
Dr. Ali Javed
Representation and Description
45
q A segmented region can be represented by boundary pixels
or by internal pixels
q Representing region in 2 ways
ü in terms of its external characteristics (its boundary) [ focus on shape
characteristics
ü in terms of its internal characteristics (its region) [ focus on regional properties,
e.g., color, texture
q sometimes, we may need to use both ways
q The description of a region is based on its representation,
ü for example, a boundary can be described by its length
Dr. Ali Javed
Representation and Description
46
q Chain Codes are used to represent the boundary by a connected sequence
of straight-line segments of specified length and direction
q Typically, this representation is based on 4 or 8 connectivity of the segments
Dr. Ali Javed
Key Stages in Digital Image Processing
47
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Representation
Image
&
Acquisition Description
Problem Domain Object
Recognition
Color Image Image
Processing Compression
Dr. Ali Javed
Object Recognition
48
q Recognition is the process that assigns a label to an object based on its descriptors
q A pattern is an arrangement of descriptors also known as features
q A pattern class is a family of patterns that share some common properties
q Pattern recognition by machine involves techniques for assigning patterns to their
respective classes automatically and with as little human intervention as possible
Dr. Ali Javed
Key Stages in Digital Image Processing
49
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Representation
Image
&
Acquisition Description
Problem Domain Object
Recognition
Color Image Image
Processing Compression
Dr. Ali Javed
Image Compression
50
q Image compression is minimizing the size in bytes of a graphics file without
degrading the quality of the image to an unacceptable level.
q The reduction in file size allows more images to be stored in a given amount of disk
or memory space. It also reduces the time required for images to be sent over the
Internet or downloaded from Web pages.
q Image Compression methods can be based on either:
ü Lossy Compression methods
ü Lossless Compression methods
Dr. Ali Javed
Image Compression
51
Dr. Ali Javed
Key Stages in Digital Image Processing
52
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Representation
Image &
Acquisition Description
Object
Problem Domain
Recognition
Color Image Image
Processing Compression
Dr. Ali Javed
53 Image Processing Components
Dr. Ali Javed
Image Processing Components
54
q Image Sensing device
q Storage Media
q Processing Systems
q Displays [5]
q Communication Media
q Hardcopy devices (e.g Printer)
q Frame Grabber
Dr. Ali Javed
Camera
55
q Lens (CMount, CSMount) [3-4]
q Optical Filter (Selectivity in EM waves)
q Imaging Sensor (CCD Sensor ,CMOS Sensor)[6]
q Pixel count
q Optical vs Digital Zoom
q Flash (Used for lighting/Illumination)
ü Front Illumination
ü Back Illumination
Dr. Ali Javed
Camera Lens
56
q The function of the lens in the camera is to direct the light source to the camera
sensor to help focusing the image.
q The main difference of the different lens brands will be the coating that they use.
q Different lens coating will give varying results from sharpness to color
reproduction.
q Some "legendary" brands of camera/lens are Carl Zeiss, Leica, Schneider
Kreuchnach, etc
Dr. Ali Javed
Camera Filter/Optical Filter
57
q Camera filters alter the properties of light entering the camera lens for the purpose of
improving the image being recorded.
q The filter can be a square or oblong shape mounted in a holder accessory, or, more commonly,
a glass or plastic disk with a metal or plastic ring frame, which can be placed in front of the
lens
q Filters can affect contrast, sharpness, color, and light intensity, either individually, or in various
combinations.
q The negative aspects of using filters, though often negligible, include the possibility of loss of
image definition if using dirty or scratched filters
Dr. Ali Javed
Pixel count [6]
58
q Gross Pixel count
ü The gross count refers to the total number of pixels on the sensor
q Effective Pixel count
ü Effective count tells you how many pixels will be used when taking
video or still photos
q For example, a camera that is 2.1 gross/2.0 effective means that the
CCD is comprised of a total of 2.1 million pixels, but the image it captures is
actually using only 2.0 million pixels to create the photo.
Dr. Ali Javed
Optical vs Digital Zoom [7]
59
q Optical Zoom
ü Optical zoom is when the lens actually moves in and out and gets you
closer to the object. An optical zoom is a “real zoom”.
q Digital Zoom
ü Digital pictures are made up of tons of tiny dots called pixels. A
digital zoom just takes those small pixels and enlarges them internally.
Dr. Ali Javed
Image Editing Apps [11]
60
1. YouCam Perfect
2. YouCam Makeup
3. PhotoDirector The global Image Editing Software market size
4. Photoshop Express Photo Editor was valued at USD 1079.52 million in 2022
5. Snapseed and is expected to expand at a CAGR of
6. Picsart 8.66% during the forecast period, reaching
USD 1776.93 million by 2028 [12].
7. Adobe Lightroom Mobile
8. BeFunky
9. VSCO
10. Instasize Photo Editor
11. Photo Editor Pro - Polish
12. piZap
13. Canva
14. Airbrush
15. Pixlr
Dr. Ali Javed
References
61
1. DIP by Gonzalez and Woods
2. http://en.wikipedia.org/wiki/Bartlane_cable_picture_transmission_system
3. http://www.ikegami.com/cb/products/pdf/tech/lensmount.pdf
4. http://www.securityideas.com/corcsmount.html
5. http://compreviews.about.com/od/multimedia/a/CRTvsLCD.htm
6. http://camcorders.about.com/od/camcorders101/a/cmos_vs_ccd.htm
7. http://camcorders.about.com/od/camcorder101/a/optialvsdigital.htm
8. https://en.wikipedia.org/wiki/Shot_transition_detection
9. https://en.wikipedia.org/wiki/Dissolve_(filmmaking)
10. https://en.wikipedia.org/wiki/Wipe_(transition)
11. https://www.perfectcorp.com/consumer/blog/photo-editing/best-free-photo-
editing-apps-iphone-android
12. https://www.globenewswire.com/news-release/2023/01/30/2597361/0/en/8-
66-Growth-in-Image-Editing-Software-Market-by-2023-2028-Latest-Trends-Key-
Players-Types-Applications-Opportunities-Challenges-Risks-Factors-Analysis-Gross-
Margin-and-Revenue.html
Dr. Ali Javed
For any query Feel Free to ask
62
Dr. Ali Javed