You are on page 1of 40

Fall, 2021

DIGITAL IMAGE PROCESSING


LEC-02:
Digital Image Fundamentals

Instructor: Dr. Hung Ta


2

Contents

This lecture will cover:


• Light and the electromagnetic spectrum
• Image representation
• Image sensing and acquisition
• Sampling, quantisation and resolution
Image Formation

Graphical representation of the eye looking at a palm tree.


Point C is the focal center of the lens.

Focal length
4

Light And The Electromagnetic Spectrum

• Light is just a particular part of the electromagnetic


spectrum that can be sensed by the human eye.
• The electromagnetic spectrum is split up
according to the wavelengths of different forms of
energy
5

Reflected Light

• The colours that we perceive are determined by


the nature of the light reflected from an object
• For example, if white
light is shone onto a Wh
ite L
ight
green object most Colours
wavelengths are Absorbed

Light
absorbed, while green Green

light is reflected from


the object.
6

Sampling, Quantisation And Resolution

In the following slides we will consider what is


involved in capturing a digital image of a real-world
scene
• Image sensing and representation
• Sampling and quantisation
• Resolution
Image Acquisition

(a) Single sensing element. (b) Line sensor. (c) Array sensor.
Image Acquisition

Combining a single sensing element with mechanical motion


to generate a 2-D image.
Image Acquisition

(a) Image acquisition using a linear sensor strip. (b) Image


acquisition using a circular sensor strip.
10

Image Acquisition

• Images are typically generated by illuminating a


scene and absorbing the energy reflected by the
objects in that scene.
• Typical notions of
illumination and
scene can be way off:
• X-rays of a skeleton
• Ultrasound of an
unborn baby
• Electro-microscopic
images of molecules
11

Image Sensing
• Incoming energy lands on a sensor material
responsive to that type of energy and this
generates a voltage
• Collections of sensors are arranged to capture
images

Imaging Sensor

Line of Image Sensors


Array of Image Sensors
12

Image Sampling And Quantisation

• A digital sensor can only measure a limited


number of samples at a discrete set of energy
levels
• Quantisation is the process of converting a
continuous analogue signal into a digital
representation of this signal
13

Image Sampling And Quantisation (cont…)

• Remember that a digital image is always only an


approximation of a real world scene
14

Image Representation

• Before we discuss image acquisition recall that a


digital image is composed of M rows and N
columns of pixels each storing a value.
• Pixel values are most col
often grey levels in the
range 0-255(black-white).
• We will see later on
that images can easily
be represented as
f (row, col)
matrices. row

• Spatial resolution = NxM pixels


15

Image Representation
16

Spatial Resolution

• The spatial resolution of an image is determined


by how sampling was carried out
• Spatial resolution simply refers to the smallest
discernable detail in an image
– Vision specialists will
often talk about pixel
size
– Graphic designers will 5.1 ls
talk about dots per g ap ixe
Me
inch (DPI)
17

Image Resolution

• Resolution refers to the number of pixels in an


image.
• Resolution is sometimes identified by the width
and height of the image (wide x high) as well as
the total number of pixels in the image.
– EX: an image that is 2048 pixels wide and 1536 pixels
high (2048X1536) contains (multiply) 3,145,728 pixels
(or 3.1 Megapixels). You could call it a 2048X1536 or a
3.1 Megapixel image.
– This means that a 5 megapixel camera is capable of
capturing a larger image than a 3 megapixel camera.
18

Spatial Resolution (cont…)


19

Spatial Resolution (cont…)


20

Spatial Resolution (cont…)


21

Spatial Resolution (cont…)


22

Spatial Resolution (cont…)


23

Spatial Resolution (cont…)


24

Intensity Level Resolution

• Intensity level resolution refers to the number of


intensity levels used to represent the image
– The more intensity levels used, the finer the level of detail discernable in an image
– Intensity level resolution is usually given in terms of the number of bits used to
store each intensity level

Number of Intensity
Number of Bits Examples
Levels
1 2 0, 1
2 4 00, 01, 10, 11
4 16 0000, 0101, 1111
8 256 00110011, 01010101
16 65,536 1010101010101010
25

Intensity Level Resolution (cont…)


256 grey levels (8 bits per pixel) 128 grey levels (7 bpp) 64 grey levels (6 bpp) 32 grey levels (5 bpp)

16 grey levels (4 bpp) 8 grey levels (3 bpp) 4 grey levels (2 bpp) 2 grey levels (1 bpp)
26

Saturation & Noise


27

Resolution: How Much Is Enough?


The big question with resolution is always how much
is enough?
• This all depends on what is in the image and what
you would like to do with it
• Key questions include
– Does the image look aesthetically pleasing?
– Can you see what you need to see within the image?
28

Resolution: How Much Is Enough? (cont…)

• The picture on the right is fine for counting the


number of cars, but not for reading the number plate
29

Common Image File Formats


30

Concepts of Video
31

Concepts of Video

• Video is a collection of bit-mapped still images (called


frames) that are taken one after the other. When the file is
played these pictures are shown in quick succession to give
the impression of a moving image.
• The number of frames is called the frame rate and this is
measured in FPS (Frames per Second).
• The common video frame rate (24p, 25p, 30p, 60i ‘interlaced’)
• The size of code used to represent the colour of each pixel in
a frame will also affect the file size and picture quality. As
with still images this is called the bit-depth or colour depth.
32

Concepts of Video
• Resolution is the number of pixels in the area that
has been captured. This is usually measured in
megapixels. A higher setting for resolution when a
shot is being captured will mean better quality but of
course, a higher file size.
• The bit-rate is the number of bits that are sent in
one second when transmitting a video file. If the
data cannot be sent quickly enough then the video
will not be able to display in real-time.
• Common file types: AVI (Audio Video Interleave
and a standard developed by Microsoft) , MPEG
(Moving Picture Expert Group)
33

Concepts of Video

• Video resolution
34

Relationships Between Pixels


• Neighbors of a pixel: consider a pixel p at (x,y)

• 4-neighbors of p, N4(p): neighbors at (x+1,y), (x-1,y),


(x,y+1), (x,y-1).
• 4-diagonal neighbors of p, ND(p): (x+1,y+1), (x+1,y-
1), (x-1,y+1), (x-1,y-1).
• 8-neighbors of p, N8(p): N4(p) and ND(p).
35

Relationships Between Pixels

• Connectivity: Two pixels are connected if they are


adjacent (e.g. 4-neighbors) and their gray levels
satisfy specified criterion of similarity (e.g. they are
equal). Let V set of gray levels used to define
connectivity (e.g. V={1}: binary image;
V={32,33,…,63,64}: gray-scale image).
• 4-connectivity (4-adjacent): p and q are 4-connected if
their values from V and q is in N4(p).
• 8-connectivity (8-adjacent): p and q are 8-connected if
their values from V and q is in N8(p).
36

Relationships Between Pixels

• m-connectivity (m-adjacent, mixed connectivity): p


and q are m-connected if their values from V and
ü q is in N4(p), or
ü q is in ND(p) and set S=N4(p) Ç N4(q) is empty (pixels Î S are
4-neighbors of both p and q, and whose values are from V).

• m-connectivity introduced to eliminate ambiguity in


path connections (resulted from allowing 8-
connectivity)
37

Relationships Between Pixels


• Path
• A (digital) path (or curve) from pixel p with coordinates (x0, y0) to pixel q with
coordinates (xn, yn) is a sequence of distinct pixels with coordinates:

(x0, y0), (x1, y1), …, (xn, yn)

where (xi, yi) and (xi-1, yi-1) are adjacent for 1 ≤ i ≤ n. Here
n is the length of the path.

• If (x0, y0) = (xn, yn), the path is closed path.

• We can define 4-, 8-, and m-paths based on the type of connectivity used.
38

Relationships Between Pixels


Examples: Connectivity and Path, V = {1, 2}
Relationships Between Pixels

(a) An arrangement of pixels. (b) Pixels that are 8-adjacent


(adjacency is shown by dashed lines). (c) m-adjacency. (d) Two
regions (of 1’s) that are 8-adjacent. (e) The circled point is on the
boundary of the 1-valued pixels only if 8-adjacency between the
region and background is used. (f) The inner boundary of the 1-
valued region does not form a closed path, but its outer boundary
does.
40

Summary

• Light and the electromagnetic spectrum


• Image representation
• Image sensing and acquisition
• Sampling, quantisation and resolution

Next lecture, we start to look at techniques for image


enhancement

You might also like