0% found this document useful (0 votes)
12 views49 pages

Course Title: Computer Vision and Image Processing

Chapter Two of the course on Computer Vision and Image Processing covers digital image fundamentals, including concepts of image perception, acquisition, sampling, quantization, and representation of different image types. It discusses the mathematical tools necessary for digital image processing, various image resolutions, and the operations performed on images using software tools like OpenCV and MATLAB. The chapter concludes with an assignment related to image processing techniques.

Uploaded by

abinett503
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)
12 views49 pages

Course Title: Computer Vision and Image Processing

Chapter Two of the course on Computer Vision and Image Processing covers digital image fundamentals, including concepts of image perception, acquisition, sampling, quantization, and representation of different image types. It discusses the mathematical tools necessary for digital image processing, various image resolutions, and the operations performed on images using software tools like OpenCV and MATLAB. The chapter concludes with an assignment related to image processing techniques.

Uploaded by

abinett503
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/ 49

Course Title: Computer Vision and

Image Processing
Chapter Two

Digital image fundamentals

Jigjiga Institute of Technology


School of Computing
Department of Computer Science

Lecturer: Tahir Ibrahim (MSc. In Computer Science)


Contents

1. Basic concept of image


2. Digital image Representation
3. Digital image acquisition process
4. Image sampling and quantization
5. Representation of different image type’s
6. Mathematical Tools used in Digital Image Processing
Image Perception
• Perception means to realize, notice, appreciate, and understand. It is not just see.
• Image Perception is influenced by:
-What it represents?
-Where the ideas comes from?
-Whether the image moves or is still?
-What type of frame or support it used to display?
-The position, color, light, shapes of the represented image
-Our need and motivation
-Our context and background
image Sensing and acquisition process

A) Single photo diode B) 1D Array of Photo Diodes C) A 2D Matrix of Light Sensing Elements (Photo Diodes)
….
 Images can be acquired using single sensing elements (photodiode) or an array of sensing
elements.
 When a light wave strikes a photo diode, it produces voltage that is proportional to
intensity of light.
 The selectivity of sensor can be improved by using a filter in front of diode.
 A linear sensor can capture the light coming from a linear source.
 We can think of linear sensor as “line” imaging device And finally, if the diodes are
arranged in the form of a matrix, a 2D image can be constructed.
Image formation Model
 An image can be considered as 2D function ƒ(𝑥, 𝑦). 𝑥, 𝑦 denote the position of pixel which
is discrete.
 For example, in the last slide picture, position of each diode determines the position of pixel.
 The position of a diode in row one and column one can be denoted as ƒ(0,0) [or ƒ(1,1) if
indexing starts from 1] and the value of light intensity on that diode is the value of
corresponding pixel located at position (0,0) in image.
 Image pixel values are normally non-negative however it depends upon the intensity
interpretation scheme that we use.
Example of Image Formation

There are two factors that affect the value of ƒ(𝑥, 𝑦).
 Illumination i(x, 𝑦) : The amount of source illumination incident on the scene being viewed,
 Reflection 𝑟(x, 𝑦): The amount of illumination reflected by the objects in the scene
 An image ƒ(𝑥, 𝑦) is formed as product of these two components 𝑓(x, 𝑦) = i(x, 𝑦)𝑟(x, 𝑦)
Sampling and Quantization
 A computer is a machine that work with discrete quantitates however most of the quantities
occurring in our real life are continuous in nature.
 For example, intensity of light, temperature and amount of water.
 It is required to convert continuous quantities into discrete for computer processing.
 Sampling: it is the process of measuring a continuous quantity or signal after equal intervals
of time. For example, we can measure intensity of light after every one second.
 Quantization is done by rounding off the amplitude of each sample and then assigning a
different value according to its amplitude.
Representing Digital Images
 Let ƒ(𝑠, 𝑡) is the function that represents the continuous image and ƒ(𝑥, 𝑦) is its
equivalent representation in discrete form obtained after sampling and digitization.
 Let there are 𝑀 rows and 𝑁 columns in resulting digital image.
 A matrix of discrete values can represent the digital image.
 This matrix will contain the sampled and quantized values of intensity of light incident on
each sensor.
 If we index the sensors starting from zero, then ƒ(0,0) will represent the value of light
intensity incident on first sensor.
Spatial and Intensity Resolution
There are different notations that can be used to represent the digital image in the form of
unsigned integer values

Such image representation is known as representation in Spatial domain


Image Resolution
There are two type of resolutions (details) that we can consider in the context of an image.
Spatial resolution: This defines the number of pixels in unit area.
• For example, the number of pixels that can be drawn in a millimeter area.
• More the pixels, higher the resolution.
• It can be measured in dots per inch.
Gray level resolution: It defines the number of intensity levels that are present in the image.
 For example, an image has intensity levels in the interval [0-255], its resolution is 255
 whereas another image having intensity levels from [0-1000] and such an image has
intensity levels 1000
….
• Usually the gray levels are power of 2

A) High Spatial Resolution Image – 930 dpi B) Low Resolution Image – 72 dpi
• And following figure shows two images having different intensity resolutions

Intensity Resolution. A) 256 Level Image B) 4 Intensity Levels C) 2 Intensity Levels


Images of Different Sizes
Images of Different Sizes
Fewer Pixels Mean Lower Spatial Resolution
Gray Level Resolution

256 64

16 4

• Different numbers of gray levels


Representation of different image type’s
There are different types of images that can be categorized as:
 Grayscale images (monochrome images)
 Color images
 Multi-channel images
Grayscale images
 In monochromatic or achromatic light colors are absent whereas
chromatic light contains various colors.
There are some attributes that are associated with achromatic light as
listed below.
 intensity of achromatic light determines its amount known as level.
 There are 256 levels in a monochromatic image and these levels are
called the gray scale
 An image formed using gray scale is known as grayscale image
Color images
• Color images are formed using monochrome images.
• In ordinary color image, there are three monochrome images: red, green and blue.
 There are different color spaces (schemes to represent color images), however simple and
commonly used color scheme is RGB.
• When each color component is visualized separately, it is shown as gray image.
• A color image is collection of three images
• Like grayscale image, each image in color image has intensity values ranging from 0-255.
• Each sub image is also called the channel.
• Hence, we can say that a color image has three channels.
Multi-channel images
• Color images have usually three channels, however, there are other type of images that
contain more than 3 channels.
• Example of such images include the CT scans or MRI scans.
• A brain MRI image may contain 100 or more channels.
• In medical domain, these channels are named as slices.
Assignment one (10%) *(Pixels and their relationships)
There are different types of relationships that can exist among the pixels.
Briefly Explain the following each of one with examples
1. Adjacency
2. 4-neighbour relationship 𝑁4(𝑝)
3. Digital Path
4. Connected component
5. Image Region
6. Adjacent and Disjoint Regions
7. Image foreground and background
8. The Contour
9. Distance Measure
Basic Mathematics for Digital Image Processing
 It has been observed that computer science students usually avoid mathematics.
 However, computing stands for mathematics so a computer scientist must convince
himself to understand and program mathematics.
 Digital image processing requires some initial mathematics and we will review it here in this
context.
 The reader of this text must have observed that an image is matrix of unsigned discrete
values. So, we will perform some matrix operations.
….
Elementwise matrix operations
 Element wise operations means that each element of matrix must be applied some
operations individually.
 Simplest operation is adding a scalar element in each pixel value in an image as shown here

Matrix Operations
 We can also perform different matrix operations easily using python vector computing
capabilities.
 For example, following two matrices can easily be added together using single python
statement.
Input matrices Result Python Statement

1 1 1 6 6 6 7 7 7 i𝑚𝑔1 + i𝑚𝑔2
𝐴 = [2 2 2] , 𝐵 = [7 7 7] 𝐴+𝐵 = [9 9 9]
3 3 3 8 8 8 11 11 11
Linear vs Non-Linear Operations
 An operation 𝛽 is called a linear operation if it fulfills following properties:

Where a,b f1(x,y), f2(x,y) are arbitrary constant and images (of the same size respectively)
There are two properties that must be satisfied for linear operation.
• Additivity: Equation indicates that the output of a linear operation due to the sum of the two inputs is the
same as performing the operation on the inputs individually and then summing the results

• Homogeneity: the output of a linear operation on a constant multiplied by an input is the


same as the output of the operation due to the original input multiplied by that constant

Arithmetic Operations
Followings are few arithmetic operations that can be performed on two images ƒ(𝑥, 𝑦) and 𝑔(𝑥, 𝑦)
(matrix operations)

S(x,y)=f(x,y)+g(x,y)
S(x,y)=f(x,y)-g(x,y)
S(x,y)=f(x,y)*g(x,y)
S(x,y)=f(x,y)/g(x,y)

An arithmetic operation can be used to extract different features from the images.
• For example, removing noise from noisy images and finding the change in an image.
• Image subtraction is normally used in mask mode radiography in which first a patient is
imaged and this image is named as mask.
• Then a contrast agent is injected into the body of patient and patient is imaged again.
• The new image is then subtracted from original image (image taken without injection) that
gives the change caused due to contrast agent.
• Image multiplication and division can be used for shading correction present in an image.
Addition operation is used frequently for Image Enhancement.
The noise can be reduced by adding a no. of noisy images and taking the average
A frequent application of image subtraction is in the enhancement of differences between
images which are not noticeable by human.
Common use of image multiplication is in masking also called as region of interest operations.
Set Operations
A set is collection of distinct objects. If we denote a set with 𝑆 and its object with ai where i is
the index of elements then a set can be written as 𝑆 = {𝑎0, 𝑎1, 𝑎2, … , 𝑎𝑛}. Following list
shows different concepts associated with sets.
Set membership: 𝑎i ∈ 𝑆 denotes that element 𝑎i belongs to set 𝑆 and 𝑎i ∉ 𝑆 denotes that 𝑎I
does not belong to set 𝑆
Cartesian product: It is defined over two sets 𝐴, 𝐵 and is a set of all ordered pairs in which first
element of each pair is from set A and second element is from set B.
𝐴X𝐵 = {(𝑎, 𝑏)|𝑎 ∈ 𝐴, 𝑏 ∈ 𝐵}

Set operation involving grayscale images
A) original image
B) image negative obtained using set complement
C) the union of a) and constant image
Spatial Operations
These are the operations that are performed directly on the values of image pixels.
The operations that we have seen till now are all spatial operations. These operations can be
categorized as:
Single pixel operations
Neighborhood operations
Geometric spatial transformations
Single pixel operations
The simplest operation we perform on a digital image is to alter the values of its individual pixels
based on their intensity.
Single pixel operations are performed on each pixel separately without considering value of other
pixels in the image.
The operation is denoted as 𝑠 = 𝑇(𝑧).
z-intensity of original image
s-intensity of transformed image
Where T some operation (transformation).
For example, if A represents an image, then 2 ∗ 𝐴 operation multiplies each pixel with value 2 that
is a transformation

Neighborhood Operations (NHO)
Assume Sxy as a set of neighborhood pixels around a center (x,y) in image f.
Neighborhood operations generate an intensity value for the center pixel (x,y) such that its value
is determined by a specified operation on the neighborhood of the pixels in the input image.
For example, if we want to perform the neighborhood average:

Geometric Operations (GO)
These are also known as rubber sheet transformation.
The name is given as application of such transformation do not bring any change in structure of
image however the shape of image is changed.
Geometric transformations of digital images consist of two basic operations:
Spatial transformation of coordinates.
Intensity interpolation that assigns intensity values to the spatially transformed pixels.
Such a transformation can be expressed as:

Where (𝑥, 𝑦) are pixel coordinates in original image and (𝑥’, 𝑦’) are transformed coordinates.
We will be mostly interested in affine transformations that include scaling, translation, rotation
and sheering.
It is the property of such transformation that they maintain the positions of points, corners,
straight lines and planes.
It is possible to use homogeneous coordinates to express all four affine transformations.
It is done by using a single 3x3 matrix as given below:
This transformation can handle all four operations i.e. scaling, rotation, translation and shearing
depending upon the values chosen for matrix A.
In following table, we provide for this affine matrix A to implement different geometric operations.
Open CV and Image Processing
A software 𝑡oo𝑙𝑘i𝑡 is collection of libraries that help you to learn, experiment and develop
software for a particular domain.
For example, in image processing, there are many algorithms that we apply on images to
perform different tasks on images like quality enhancement, sharpening, information extraction
and segmentation.
Although there are many image processing toolkits available in market however two most
popular applications are
 OpenCV

 MATLAB
Open CV
Open CV stands for Open Computer Vision or most precisely Open Source Computer Vision
Library.
There are two main objectives behind the development of Open CV:
• To provide common infrastructure for computer vision applications
• To accelerate the use of machine vision in commercial software products
Software Required for this Course
End of Chapter Two

Thank you

Question?
Assignment 1
In Matlab, using the help information under the image processing toolbox, click on Getting
Started and read/try out the following:
• What Is the Image Processing Toolbox?– introduction about the toolbox
 Example 1 - guides you through an example of some of the basic image processing
capabilities, including reading, writing, and displaying images
 Example 2 – guides you through some advanced image processing topics
• Getting Help - provides pointers to additional sources of information

You might also like