You are on page 1of 105

In the Name God

Digital Image Processing

Chapter 2 - Digital
Image Fundamentals
koochari@gmail.com Abbas Koochari

1
Human Visual Perception

2
The Human Eye
 Diameter: 20 mm

 3 membranes enclose the eye


 Cornea & sclera
 Choroid
 Retina

3
Structure of the Human Eye

Cornea is a transparent structure that


Pupil allows varying
covers the iris and pupil
amounts of light to
enter the eye.

Retina includes
- Rods (94%)
Lens helps to focus (light sensitive)
light on the retina.
- Cones (6%)
(color sensitive)

Cones are
concentrated in
the center of the
retina - the fovea

4
The Choroid
 The choroid contains blood vessels for eye nutrition and
is heavily pigmented to reduce extraneous light entrance
and backscatter.

 It is divided into the ciliary body and the iris diaphragm,


which controls the amount of light that enters the pupil
(2 mm ~ 8 mm).

5
The Lens
 The lens is made up of fibrous cells and is suspended by
fibers that attach it to the ciliary body.

 It is slightly yellow and absorbs approx. 8% of the visible


light spectrum.

6
The Retina
 The retina lines the entire posterior portion.

 Discrete light receptors are distributed over the surface


of the retina:

 cones (6-7 million per eye) and


 rods (75-150 million per eye)

7
Cones
 Cones are located in the fovea and are sensitive to color.

 Each one is connected to its own nerve end.

 Cone vision is called photopic (or bright-light vision).

8
Rods
 Rods are giving a general, overall picture of the field of
view and are not involved in color vision.

 Several rods are connected to a single nerve and are


sensitive to low levels of illumination (scotopic or dim-light
vision).

9
Receptor Distribution
 The distribution of receptors is radially symmetric about
the fovea.

 Cones are most dense in the center of the fovea while


rods increase in density from the center out to
approximately 20 (degree) off axis and then decrease.

10
Cones & Rods

11
The Fovea
 The fovea is circular (1.5 mm in diameter) but can be
assumed to be a square sensor array (1.5 mm x 1.5 mm).

 The density of cones: 150,000 elements/mm2 ~ 337,000


for the fovea.

 A CCD imaging chip of medium resolution needs 5 mm x


5 mm for this number of elements

12
Image Formation in the Eye
 The eye lens (if compared to an optical lens) is flexible.

 It gets controlled by the fibers of the ciliary body and to


focus on distant objects it gets flatter (and vice versa).

13
Image Formation in the Eye
 Distance between the center of the lens and the retina
(focal length):
 varies from 17 mm to 14 mm (refractive power of lens goes
from minimum to maximum).

 Objects farther than 3 m use minimum refractive lens


powers (and vice versa).

14
Image Formation in the Eye

 Example:
 Calculation of retinal image of an object

15 x

100 17

x  2.55 mm

15
Image Formation in the Eye
 Perception takes place by the relative excitation of light
receptors.

 These receptors transform radiant energy into electrical


impulses that are ultimately decoded by the brain.

16
Brightness Adaptation & Discrimination

 Range of light intensity levels to which HVS (human visual


system) can adapt: on the order of 1010.

 Subjective brightness (i.e. intensity as perceived by the


HVS) is a logarithmic function of the light intensity
incident on the eye.

17
Illustration

Brightness adaptation

18
Brightness Adaptation & Discrimination

 The HVS cannot operate over such a range


simultaneously.

 For any given set of conditions, the current sensitivity


level of HVS is called the brightness adaptation level.

19
Brightness Adaptation & Discrimination

 The eye also discriminates between changes in


brightness at any specific adaptation level.

I c
 Weber ratio
I
Where: Ic: the increment of illumination
discriminable 50% of the time and
I : background illumination

20
Experiments on Discrimination

The ability of the eye to discriminate between


changes in light Intensity at any specific
adaptation level

21
Discriminate

22
Brightness Adaptation & Discrimination

 Small values of Weber ratio mean good brightness


discrimination (and vice versa).

 At low levels of illumination brightness discrimination is


poor (rods) and it improves significantly as background
illumination increases (cones).

23
Brightness Adaptation & Discrimination

 The typical observer can discern one to two dozen


different intensity changes

 i.e. the number of different intensities a person can see at any


one point in a monochrome image

24
Brightness Adaptation & Discrimination

 Overall intensity discrimination is broad due to different


set of incremental changes to be detected at each new
adaptation level.

 Perceived brightness is not a simple function of intensity


 Scalloped effect, Mach band pattern
 Simultaneous contrast

25
‫‪Mach Bands Effect‬‬

‫سیستم بینائی مایل است در‬


‫مرز ناحیه های شدت‬
‫مختلف‪ ،‬به پائین یا باال‬
‫جهش کند‪ .‬گرچه شدت‬
‫نوارها ثابت است‪ ،‬یک‬
‫الگوی روشنائی را دریافت‬
‫می کنیم که شدیدا در‬
‫نزدیک مرزها کنگره مانند‬
‫دیده میشود‪.‬‬

‫‪Perceived Intensity is‬‬


‫‪not a simple function‬‬
‫‪of actual intensity.‬‬

‫‪26‬‬
‫‪Simultaneous Contrast‬‬

‫کنتراست همزمان ‪ :‬روشنائی دریافتی ناحیه‪ ،‬ارتباط ساده ای با شدت آن ندارد‪.‬‬


‫تمام مربع های مرکزی شدت یکسانی دارند اما هر چه زمینه روشنتر می شود آنها در‬
‫چشم تیره تر دیده میشوند‪.‬‬

‫‪27‬‬
‫‪Optical Illusions‬‬

‫توهم نوری پدیده ایست که‬


‫در آن چشم با اطالعاتی پر‬
‫می شود که وجود ندارد یا‬
‫به طور نادرست خواص‬
‫هندسی اشیا را دریافت می‬
‫کند‪.‬‬

‫‪28‬‬
2.2 Light and the Electromagnetic Spectrum

29
Light and the Electromagnetic Spectrum
(1)

2.1- Elements of
Visual Perception
In 1666, Sir Isaac Newton discovered that when a beam of
2.2- Light and the sunlight is passed through a glass prism, the emerging beam of
Electromagnetic light is not white but consists instead of a continuous spectrum
Spectrum
of colors ranging from violet at one end to red at the other.
2.3- Image Sensing
and Acquisition The range of colors we perceive in visible light represents a very
small portion of the electromagnetic spectrum.
2.4- Image Sampling
and Quantization
On one end of the spectrum are radio waves with wavelengths
2.5- Some Basic billions of times longer than those of visible light.
Relationships
Between Pixels
On the other end of the spectrum are gamma rays with
2.6- An Introduction
to the Mathematical
wavelengths millions of times smaller than those of visible light.
Tools Used in Digital
Image Processing
30
Light and the Electromagnetic Spectrum
(2)

2.1- Elements of
Visual Perception
=
2.2- Light and the
Electromagnetic
Spectrum

2.3- Image Sensing


and Acquisition

2.4- Image Sampling The electromagnetic spectrum can be expressed in terms of


and Quantization
wavelength, frequency, or energy.
2.5- Some Basic
Relationships
Between Pixels
• h is Planck’s constant.
• The units of wavelength are meters, with the terms microns and
2.6- An Introduction nanometers being used just as frequently.
to the Mathematical
Tools Used in Digital • Frequency is measured in Hertz (Hz), with one Hertz being
Image Processing equal to one cycle of a sinusoidal wave per second.
31 • unit of energy is the electron-volt.
‫‪Light and the Electromagnetic Spectrum‬‬
‫)‪(3‬‬

‫‪2.1- Elements of‬‬


‫‪Visual Perception‬‬

‫‪2.2- Light and the‬‬


‫‪Electromagnetic‬‬ ‫امواج الکترومغناطیسی را می توان پخش امواج سینوسی در نظر گرفت که طول‬
‫‪Spectrum‬‬ ‫موج آنها ‪ λ‬است‪.‬‬

‫‪2.3- Image Sensing‬‬


‫‪and Acquisition‬‬ ‫آنها را میتوان جریانی از ذرات بدون جرم دانست که هر کدام به صورت یک‬
‫الگوی شبیه موج با سرعت نور حرکت می کنند‪.‬‬
‫‪2.4- Image Sampling‬‬
‫‪and Quantization‬‬
‫هر ذره بدون جرم شامل مقداری انرژی است‪.‬‬
‫‪2.5- Some Basic‬‬
‫‪Relationships‬‬
‫‪Between Pixels‬‬ ‫هر بسته انرژی فوتون نام دارد‪ .‬لذا پدیده الکترومغناطیس با فرکانس باالتر (طول‬
‫موج کوتاهتر) انرژی بیشتری حمل می کند‪.‬‬
‫‪2.6- An Introduction‬‬
‫‪to the Mathematical‬‬
‫‪Tools Used in Digital‬‬
‫‪Image Processing‬‬
‫‪32‬‬
Light and the Electromagnetic Spectrum
(4)

2.1- Elements of
Visual Perception

2.2- Light and the


Electromagnetic
Spectrum

2.3- Image Sensing


and Acquisition

2.4- Image Sampling


and Quantization

2.5- Some Basic


Relationships
Between Pixels

2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
33
Light and the Electromagnetic Spectrum
(5)

2.1- Elements of
Visual Perception
Electromagnetic waves can be visualized as propagating
2.2- Light and the sinusoidal waves with wavelength, or they can be thought of as a
Electromagnetic stream of mass-less particles, each traveling in a wavelike pattern
Spectrum and moving at the speed of light. Each mass-less particle contains
a certain amount (or bundle) of energy. Each bundle of energy is
2.3- Image Sensing
and Acquisition called a photon.

2.4- Image Sampling Energy is proportional to frequency,


and Quantization
Higher-frequency (shorter wavelength) electromagnetic
2.5- Some Basic phenomena carry more energy per photon.
Relationships
Between Pixels
Gamma rays are so dangerous to living organisms.
2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
34
Light and the Electromagnetic Spectrum
(Light)

2.1- Elements of
Visual Perception

2.2- Light and the Light is a particular type of electromagnetic radiation that can be
Electromagnetic seen and sensed by the human eye.
Spectrum

2.3- Image Sensing The visible band of the electromagnetic spectrum spans the
and Acquisition range from approximately 0.43 micro m (violet) to about 0.79
micro m (red).
2.4- Image Sampling
and Quantization
For convenience, the color spectrum is divided into six broad
2.5- Some Basic regions: Violet, Blue, Green, Yellow, Orange, and Red.
Relationships
Between Pixels

2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
35
The Origins of Digital Image Processing
(color)

2.1- Elements of
Visual Perception
The colors that humans perceive in an object are determined by
2.2- Light and the the nature of the light reflected from the object.
Electromagnetic
Spectrum
A body that reflects light and is relatively balanced in all visible
2.3- Image Sensing wavelengths appears white to the observer.
and Acquisition

2.4- Image Sampling A body that favors reflectance in a limited range of the visible
and Quantization
spectrum exhibits some shades of color.
2.5- Some Basic For example, green objects reflect light with wavelengths
Relationships primarily in the 500 to 570 nm range while absorbing most
Between Pixels of the energy at other wavelengths.
2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
36
The Origins of Digital Image Processing
(Achromatic or Monochromatic)

2.1- Elements of
Visual Perception

2.2- Light and the Light that is void of color is called achromatic or
Electromagnetic
Spectrum monochromatic light.

2.3- Image Sensing


and Acquisition
The only attribute of such light is its intensity, or amount.

2.4- Image Sampling The term gray level generally is used to describe monochromatic
and Quantization
intensity because it ranges from black, to grays, and finally to
2.5- Some Basic
white.
Relationships
Between Pixels

2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
37
The Origins of Digital Image Processing
(Chromatic light)

2.1- Elements of
Visual Perception

2.2- Light and the Chromatic light spans the electromagnetic energy spectrum from
Electromagnetic
Spectrum approximately 0.43 to 0.79 m, as noted previously.

2.3- Image Sensing


and Acquisition ‫ سه کمیت اساسی برای توصیف کیفیت منبع نور رنگی به کار‬،‫عالوه بر فرکانس‬
: ‫می‌رود‬
2.4- Image Sampling ‫ میزان کل انرژی است که از منبع نور جاری می شود‬: ‫تابندگی‬
and Quantization
‫ معیاری برای میزان انرژی است که بیننده از منبع دریافت‬:‫درخشندگی‬
2.5- Some Basic ‫میکند‬
Relationships ‫ یک توصیف ذهنی است که اندازه گیری آن غیرممکن است‬:‫روشنائی‬
Between Pixels

2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
38
The Origins of Digital Image Processing
(Chromatic light)

2.1- Elements of
Visual Perception
Radiance is the total amount of energy that flows from the light
2.2- Light and the source, and it is usually measured in watts (W).
Electromagnetic
Spectrum
Luminance, measured in lumens (lm), gives a measure of the
2.3- Image Sensing amount of energy an observer perceives from a light source.
and Acquisition
For example, light emitted from a source operating in the
2.4- Image Sampling far infrared region of the spectrum could have significant
and Quantization energy (radiance), but an observer would hardly perceive it;
its luminance would be almost zero.
2.5- Some Basic
Relationships
Between Pixels Brightness is a subjective descriptor of light perception that is
practically impossible to measure. It embodies the achromatic
2.6- An Introduction
to the Mathematical
notion of intensity and is one of the key factors in describing
Tools Used in Digital color sensation.
Image Processing
39
2.3 Image Sensing and Acquisition

40
Image Sensing and Acquisition

2.1- Elements of
Visual Perception

2.2- Light and the


Electromagnetic Image Acquisition Using a Single Sensor
Spectrum

2.3- Image Sensing Image Acquisition Using Sensor Strips


and Acquisition

2.4- Image Sampling Image Acquisition Using Sensor Arrays


and Quantization

2.5- Some Basic A Simple Image Formation Model


Relationships
Between Pixels

2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
41
Introduction(1)

2.1- Elements of
Visual Perception

2.2- Light and the Incoming energy is transformed into a voltage by the
Electromagnetic
Spectrum combination of input electrical power and sensor material that is
responsive to the particular type of energy being detected.
2.3- Image Sensing
and Acquisition
The output voltage waveform is the response of the sensor(s),
2.4- Image Sampling and a digital quantity is obtained from each sensor by digitizing
and Quantization its response.
2.5- Some Basic
Relationships
Between Pixels

2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
42
Introduction(2)

2.1- Elements of
Visual Perception

2.2- Light and the ‫ توسط‬،‫انرژی ورودی‬


Single
Electromagnetic ‫ترکیب توان الکتریکی‬
Spectrum imaging
‫ورودی و ماده حسگری‬
Sensor
2.3- Image Sensing
‫که مسئول تشخیص نوع‬
and Acquisition ‫ به‬،‫خاصی انرژی است‬
Line .‫یک ولتاژ تبدیل میگردد‬
2.4- Image Sampling Sensor ‫ولتاژ خروجی موج‬
and Quantization ‫ پاسخ حسگرها‬،‫شکل‬
‫ و یک کمیت‬،‫است‬
2.5- Some Basic
Relationships ‫دیجیتال از هر حسگر‬
Between Pixels ‫بدست می آید که برای‬
Array ‫این کار باید پاسخ آن‬
2.6- An Introduction Sensor .‫رقمی گردد‬
to the Mathematical
Tools Used in Digital
Image Processing
43
Image Acquisition Using a Single Sensor

44
Image Acquisition Using Sensor Strips

45
Image Sensing and Acquisition

2.1- Elements of
Visual Perception

2.2- Light and the


Electromagnetic Image Acquisition Using a Single Sensor
Spectrum

2.3- Image Sensing Image Acquisition Using Sensor Strips


and Acquisition

2.4- Image Sampling Image Acquisition Using Sensor Arrays


and Quantization

2.5- Some Basic A Simple Image Formation Model


Relationships
Between Pixels

2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
46
Image Acquisition Using Sensor Arrays

47
‫‪Image Acquisition Using Sensor Arrays‬‬

‫‪2.1- Elements of‬‬


‫‪Visual Perception‬‬

‫‪2.2- Light and the‬‬ ‫روش اصلی به کارگیری آرایه ای از حسگرها در شکل قبل آمده است‪ .‬این شکل‪،‬‬
‫‪Electromagnetic‬‬ ‫انرژی را از منبع روشنائی نشان می دهد که در حال انعکاس از یک عنصر محیطی‬
‫‪Spectrum‬‬ ‫است‪.‬‬
‫‪2.3- Image Sensing‬‬
‫‪and Acquisition‬‬ ‫اولین کار انجام شده توسط سیستم تصویربرداری در این شکل جمع آوری انرژی‬
‫ورودی و متمرکز کردن آن روی صفحه تصویر است‪ .‬اگر روشنائی نور باشد‪،‬‬
‫‪2.4- Image Sampling‬‬
‫‪and Quantization‬‬
‫بخش جلوئی سیستم‪ ،‬یک لنز نوری است که صحنه دیده شده را روی صفحه کانونی‬
‫لنز تصویربرداری می کند‪.‬‬
‫‪2.5- Some Basic‬‬
‫‪Relationships‬‬
‫‪Between Pixels‬‬
‫آرایه حسگر‪ ،‬که مطابق با صفحه کانونی است‪ ،‬خروجی هائی را تولید می کند که‬
‫متناسب با انتگرال نور دریافتی در هر حسگر است‪.‬‬
‫‪2.6- An Introduction‬‬
‫‪to the Mathematical‬‬
‫‪Tools Used in Digital‬‬
‫‪Image Processing‬‬
‫‪48‬‬
Image Sensing and Acquisition

2.1- Elements of
Visual Perception

2.2- Light and the


Electromagnetic Image Acquisition Using a Single Sensor
Spectrum

2.3- Image Sensing Image Acquisition Using Sensor Strips


and Acquisition

2.4- Image Sampling Image Acquisition Using Sensor Arrays


and Quantization

2.5- Some Basic A Simple Image Formation Model


Relationships
Between Pixels

2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
49
A Simple Image Model
 Image: a 2-D light-intensity function f(x,y)

 The value of f at (x,y)  the intensity (brightness) of the


image at that point

 0 < f(x,y) < 

50
A Simple Image Model
 Nature of f(x,y):

 The amount of source light incident on the scene being viewed

 The amount of light reflected by the objects in the scene

51
A Simple Image Model

 Illumination & reflectance components:

 Illumination: i(x,y)
 Reflectance: r(x,y)

 f(x,y) = i(x,y)  r(x,y)

 0 < i(x,y) < 


and 0 < r(x,y) < 1
(from total absorption to total reflectance)

52
A Simple Image Model
 Sample values of r(x,y):
 0.01: black velvet
 0.93: snow

 Sample values of i(x,y):


 9000 foot-candles: sunny day
 1000 foot-candles: cloudy day
 0.01 foot-candles: full moon

a foot candle is a measurement of light intensity and is defined as the


illuminance on a one-square foot surface from a uniform source of light.

53
A Simple Image Model
 Intensity of a monochrome image f at (xo,yo): gray level l
of the image at that point
l=f(xo, yo)

 Lmin ≤ l ≤ Lmax
 Where Lmin: positive
Lmax: finite

54
A Simple Image Model
 In practice:
 Lmin = imin rmin and
 Lmax = imax rmax

 E.g. for indoor image processing:


 Lmin ≈ 10 Lmax ≈ 1000

 [Lmin, Lmax] : gray scale


 Often shifted to [0,L-1]  l=0: black
l=L-1: white

55
Sampling & Quantization
 The spatial and amplitude digitization of f(x,y) is called:

 image sampling when it refers to spatial coordinates (x,y) and

 gray-level quantization when it refers to the amplitude.

56
Digital Image

57
‫‪Sampling and Quantization‬‬

‫اختصاص‌یک‌مقدار‌شدت‌به‌هر‌جفت‌از‌مختصات‌)‪ (x,y‬را‌کوانتیزه‌کردن‌می‌گویند‪.‬‬

‫تصویر‌پیوسته‌روی‌آرایه‌حسگر‬ ‫نتیجه‌نمونه‌برداری‌و‌کوانتیزه‌کردن‬

‫‪58‬‬
A Digital Image

59
Sampling & Quantization

 f (0,0) f (0,1) ... f (0, M  1) 


 f (1,0) ... ... f (1, M  1) 
f ( x, y )  
 ... ... ... ... 
 
 f ( N  1,0) f ( N  1,1) ... f ( N  1, M  1)

Digital Image Image Elements


(Pixels)

60
Sampling & Quantization

 Important terms for future discussion:

 Z: set of real integers

 R: set of real numbers

61
Sampling & Quantization

 Sampling: partitioning xy plane into a grid

 the coordinate of the center of each grid is a pair of


elements from the Cartesian product Z x Z (Z2)

 Z2 is the set of all ordered pairs of elements (a,b) with


a and b being integers from Z.

62
Sampling & Quantization
 f(x,y) is a digital image if:

 (x,y) are integers from Z2 and


 f is a function that assigns a gray-level value (from R) to each
distinct pair of coordinates (x,y) [quantization]

 Gray levels are usually integers


 then Z replaces R

63
Sampling & Quantization
 The digitization process requires decisions about:

 values for N,M (where N x M: the image array)

and

 the number of discrete gray levels allowed for each pixel.

64
Sampling & Quantization
 Usually, in DIP these quantities are integer powers of two:
N=2n M=2m and G=2k

number of gray levels

 Another assumption is that the discrete levels are equally


spaced between 0 and L-1 in the gray scale.

65
Representing Digital Images

2.1- Elements of
Visual Perception

2.2- Light and the


Electromagnetic
Spectrum

2.3- Image Sensing


and Acquisition

2.4- Image Sampling


and Quantization

2.5- Some Basic


Relationships
Between Pixels

2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
66
‫‪Representing Digital Images‬‬

‫‪2.1- Elements of‬‬


‫‪Visual Perception‬‬ ‫بازه پویای سیستم تصویربرداری ‪ :‬نسبت‬

‫‪2.2- Light and the‬‬ ‫حداکثر شدت قابل اندازه گیری به‬
‫‪Electromagnetic‬‬
‫‪Spectrum‬‬ ‫حداقل سطح شدت اندازه‌‌گیری در‬

‫‪2.3- Image Sensing‬‬ ‫سیستم تعریف می شود‪.‬‬


‫‪and Acquisition‬‬
‫به عنوان یک قانون‪ ،‬حد باال اشباع و حد‬
‫‪2.4- Image Sampling‬‬
‫‪and Quantization‬‬ ‫پائین را نویز می‌گوئیم‪.‬‬

‫‪2.5- Some Basic‬‬ ‫کنتراست به تفاوت بین پائین ترین و‬


‫‪Relationships‬‬
‫‪Between Pixels‬‬ ‫باالترین سطوح شدت‪ ،‬که سیستم‬
‫‪2.6- An Introduction‬‬ ‫قابلیت نمایش آن را دارد گفته میشود‪.‬‬
‫‪to the Mathematical‬‬
‫‪Tools Used in Digital‬‬
‫‪Image Processing‬‬
‫تصویر با کنتراست پائین بیشتر خاکستری‬
‫‪67‬‬ ‫به نظر می‌رسد‪.‬‬
Representing Digital Images

2.1- Elements of
Visual Perception
The number , b, of bits required to store a digitized image is:
2.2- Light and the b=M*N*K
Electromagnetic When M=N, this equation becomes
Spectrum
b = (N2)*K
2.3- Image Sensing
and Acquisition

2.4- Image Sampling


and Quantization

2.5- Some Basic


Relationships
Between Pixels

2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
68
Image Sampling and Quantization

2.1- Elements of
Visual Perception

2.2- Light and the


Electromagnetic Basic Concepts in Sampling and Quantization
Spectrum

2.3- Image Sensing Representing Digital Images


and Acquisition

2.4- Image Sampling Spatial and Intensity Resolution


and Quantization

2.5- Some Basic Image Interpolation


Relationships
Between Pixels

2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
69
Spatial and Intensity Resolution

2.1- Elements of
Visual Perception 1250DPI 300DPI
‫ معیاری از کوچکترین بخش‬: ‫دقت فضائی‬
2.2- Light and the
Electromagnetic .‫قابل تمیز در تصویر است‬
Spectrum

2.3- Image Sensing


‫ دقت فضائی را میتوان به‬،‫از نظر کمی‬
and Acquisition
‫روشهای مختلفی بیان کرد که جفتهای‬
2.4- Image Sampling
and Quantization
‫ و نقاط‬،‫خط در هر واحد فاصله‬
150DPI 72DPI
‫(پیکسل) در هر واحد فاصله متداول‬
2.5- Some Basic
Relationships
Between Pixels
.‫ترین روشهاست‬

2.6- An Introduction
‫ کوچکترین تغییر قابل تشخیص‬: ‫دقت شدت‬
to the Mathematical
Tools Used in Digital .‫در سطح شدت است‬
Image Processing
70
Spatial and Intensity Resolution

2.1- Elements of
Visual Perception
How many samples and gray levels are required for a good
2.2- Light and the approximation?
Electromagnetic
Spectrum
Resolution (the degree of discernible detail) of an image
2.3- Image Sensing depends on sample number and gray level number.
and Acquisition
i.e. the more these parameters are increased, the closer the
2.4- Image Sampling digitized array approximates the original image.
and Quantization But: storage & processing requirements increase rapidly as
a function of N, M, and k
2.5- Some Basic
Relationships
Between Pixels

2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
71
Spatial and Intensity Resolution

2.1- Elements of
Visual Perception

2.2- Light and the Different versions (images) of the same object can be generated
Electromagnetic
Spectrum through:

2.3- Image Sensing Varying N, M numbers


and Acquisition
Varying k (number of bits)
2.4- Image Sampling Varying both
and Quantization

2.5- Some Basic


Relationships
Between Pixels

2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
72
Spatial and Intensity Resolution
(Ex1)

2.1- Elements of
Visual Perception

2.2- Light and the


Electromagnetic
Spectrum

2.3- Image Sensing


and Acquisition

2.4- Image Sampling


and Quantization

2.5- Some Basic


Relationships
Between Pixels

2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
73
Spatial and Intensity Resolution
(Ex1)

2.1- Elements of
Visual Perception

2.2- Light and the


Electromagnetic
Spectrum

2.3- Image Sensing


and Acquisition

2.4- Image Sampling


and Quantization

2.5- Some Basic


Relationships
Between Pixels

2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
74
Spatial and Intensity Resolution
(Ex2)

2.1- Elements of
Visual Perception

2.2- Light and the


Electromagnetic
Spectrum

2.3- Image Sensing


and Acquisition

2.4- Image Sampling


and Quantization

2.5- Some Basic


Relationships
Between Pixels

2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
75
Spatial and Intensity Resolution
(Ex2)

2.1- Elements of
Visual Perception

2.2- Light and the


Electromagnetic
Spectrum

2.3- Image Sensing


and Acquisition

2.4- Image Sampling


and Quantization

2.5- Some Basic


Relationships
Between Pixels

2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
76
Spatial and Intensity Resolution

2.1- Elements of
Visual Perception

2.2- Light and the Isopreference curves (in the NM plane)


Electromagnetic
Spectrum
Each point: image having values of N and k equal to the
2.3- Image Sensing coordinates of this point
and Acquisition

2.4- Image Sampling Points lying on an isopreference curve correspond to


and Quantization images of equal subjective quality.
2.5- Some Basic
Relationships
Between Pixels

2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
77
Spatial and Intensity Resolution

2.1- Elements of
Visual Perception

2.2- Light and the


Electromagnetic Conclusions:
Spectrum

2.3- Image Sensing


Quality of images increases as N & k increase
and Acquisition Sometimes, for fixed N, the quality improved by
decreasing k (increased contrast)
2.4- Image Sampling
and Quantization For images with large amounts of detail, few gray levels
are needed
2.5- Some Basic
Relationships
Between Pixels

2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
78
Detail Level

2.1- Elements of
Visual Perception

2.2- Light and the


Electromagnetic
Spectrum

2.3- Image Sensing


and Acquisition

2.4- Image Sampling


and Quantization

2.5- Some Basic


Relationships
Between Pixels

2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
79
Image Sampling and Quantization

2.1- Elements of
Visual Perception

2.2- Light and the


Electromagnetic Basic Concepts in Sampling and Quantization
Spectrum

2.3- Image Sensing Representing Digital Images


and Acquisition

2.4- Image Sampling Spatial and Intensity Resolution


and Quantization

2.5- Some Basic Image Interpolation


Relationships
Between Pixels

2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
80
‫)‪Image Interpolation(1‬‬

‫‪2.1- Elements of‬‬


‫‪Visual Perception‬‬

‫‪2.2- Light and the‬‬ ‫درونیابی‪ ،‬فرایند استفاده از داده‌های شناخته برای برآورد مقادیر در مکانهای‬
‫‪Electromagnetic‬‬ ‫ناشناخته است‪.‬‬
‫‪Spectrum‬‬

‫‪2.3- Image Sensing‬‬ ‫درونیابی نزدیکترین همسایه ‪ :‬روشی است که به هر مکان جدید‪ ،‬شدت‬
‫‪and Acquisition‬‬ ‫نزدیکترین همسایه‌اش در تصویر اصلی را نسبت میدهد‪ .‬در این روش‬
‫احتمال نتیجه نامطلوب در خمیدگی شدید لبه ها مستقیم وجود دارد‪.‬‬
‫‪2.4- Image Sampling‬‬
‫‪and Quantization‬‬
‫درونیابی دوخطی ‪ :‬از چهار نزدیکترین همسایه برای برآورد شدت در‬
‫‪2.5- Some Basic‬‬ ‫مکان مورد نظر استفاده میشود‪.‬‬
‫‪Relationships‬‬
‫‪Between Pixels‬‬
‫درونیابی دو مکعبی ‪ :‬شامل شانزده نزدیکترین همسایه یک نقطه برای‬
‫‪2.6- An Introduction‬‬ ‫برآورد است‪.‬‬
‫‪to the Mathematical‬‬
‫‪Tools Used in Digital‬‬
‫‪Image Processing‬‬
‫‪81‬‬
Image Interpolation(2)

2.1- Elements of
Visual Perception

2.2- Light and the (a) Image reduced to 72 dpi


Electromagnetic and zoomed back to its
Spectrum original size ( pixels)
using nearest neighbor
2.3- Image Sensing
and Acquisition
interpolation. (b) Image
shrunk and zoomed
2.4- Image Sampling using bilinear
and Quantization interpolation. (c) Same
as (b) but using bicubic
2.5- Some Basic interpolation. (d)–(f)
Relationships Same sequence, but
Between Pixels
shrinking down to 150
2.6- An Introduction
dpi instead of 72 dpi
to the Mathematical [Fig. 2.24(d) is the
Tools Used in Digital same as Fig. 2.20(c)].
Image Processing
82
Nonuniform Sampling & Quantization

2.1- Elements of
Visual Perception
An adaptive sampling scheme can improve the appearance of an
2.2- Light and the
Electromagnetic image, where the sampling would consider the characteristics of
Spectrum the image.
2.3- Image Sensing
and Acquisition i.e. fine sampling in the neighborhood of sharp gray-level
transitions (e.g. boundaries)
2.4- Image Sampling Coarse sampling in relatively smooth regions
and Quantization

2.5- Some Basic Considerations: boundary detection, detail content


Relationships
Between Pixels

2.6- An Introduction
to the Mathematical
Tools Used in Digital
Image Processing
83
2.5 Some Basic Relationships
Between Pixels

84
Some Basic Relationships Between Pixels

 Definitions:

 f(x,y): digital image


 Pixels: q, p
 Subset of pixels of f(x,y): S

85
Neighbors of a Pixel
 A pixel p at (x,y) has 2 horizontal and 2 vertical
neighbors:

 (x+1,y), (x-1,y), (x,y+1), (x,y-1)

 This set of pixels is called the 4-neighbors of p: N4(p)

86
Neighbors of a Pixel
 The 4 diagonal neighbors of p are: (ND(p))

 (x+1,y+1), (x+1,y-1), (x-1,y+1), (x-1,y-1)

 N4(p) + ND(p)  N8(p): the 8-neighbors of p

87
Connectivity
 Connectivity between pixels is important:

 Because it is used in establishing boundaries of objects and


components of regions in an image

88
Connectivity
 Two pixels are connected if:

 They are neighbors (i.e. adjacent in some sense -- e.g. N4(p),


N8(p), …)
 Their gray levels satisfy a specified criterion of similarity (e.g.
equality, …)

 V is the set of gray-level values used to define adjacency


(e.g.V={1} for adjacency of pixels of value 1)

89
Adjacency
 We consider three types of adjacency:

 4-adjacency: two pixels p and q with values from V are 4-


adjacent if q is in the set N4(p)

 8-adjacency : p & q are 8- adjacent if q is in the set N8(p)

90
Adjacency
 The third type of adjacency:

 m-adjacency: p & q with values from V are m-adjacent if

 q is in N4(p) or
 q is in ND(p) and the set N4(p)N4(q) has no pixels with values from
V

91
Adjacency
 Mixed adjacency is a modification of 8-adjacency and is
used to eliminate the multiple path connections that
often arise when 8-adjacency is used.

0 1 1 0 1 1 0 1 1
0 1 0 0 1 0 0 1 0
0 0 1 0 0 1 0 0 1

92
Adjacency

 Two image subsets S1 and S2 are adjacent if some pixel in S1 is


adjacent to some pixel in S2.

93
Path
 A path (curve) from pixel p with coordinates (x,y) to
pixel q with coordinates (s,t) is a sequence of distinct
pixels:

 (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), for 1≤i ≤n ; n is the
length of the path.
 If (xo, yo) = (xn, yn): a closed path

94
Paths
 4-, 8-, m-paths can be defined depending on the type of
adjacency specified.

 If p,q  S, then q is connected to p in S if there is a path


from p to q consisting entirely of pixels in S.

95
Connectivity
 For any pixel p in S, the set of pixels in S that are
connected to p is a connected component of S.

 If S has only one connected component then S is called a


connected set.

96
Boundary
 R a subset of pixels: R is a region if R is a connected set.
 Its boundary (border, contour) is the set of pixels in R
that have at least one neighbor not in R
 Edge can be the region boundary (in binary images)

97
Distance Measures
 For pixels p,q,z with coordinates (x,y), (s,t), (u,v), D is a
distance function or metric if:

 D(p,q) ≥ 0 (D(p,q)=0 iff p=q)


 D(p,q) = D(q,p) and
 D(p,z) ≤ D(p,q) + D(q,z)

98
Distance Measures
 Euclidean distance:

 De(p,q) = [(x-s)2 + (y-t)2]1/2

 Points (pixels) having a distance less than or equal to r from


(x,y) are contained in a disk of radius r centered at (x,y).

99
Distance Measures
 D4 distance (city-block distance):

 D4(p,q) = |x-s| + |y-t|


 forms a diamond centered at (x,y)
 e.g. pixels with D4≤2 from p

2
2 1 2
2 1 0 1 2 D4 = 1 are the 4-neighbors of p
2 1 2
2

100
Distance Measures
 D8 distance (chessboard distance):

 D8(p,q) = max(|x-s|,|y-t|)
 Forms a square centered at p
 e.g. pixels with D8≤2 from p

2 2 2 2 2
2 1 1 1 2
2 1 0 1 2 D8 = 1 are the 8-neighbors of p
2 1 1 1 2
2 2 2 2 2

101
Distance Measures
 D4 and D8 distances between p and q are independent of
any paths that exist between the points because these
distances involve only the coordinates of the points
(regardless of whether a connected path exists between
them).

102
Distance Measures
 However, for m-connectivity the value of the distance
(length of path) between two pixels depends on the
values of the pixels along the path and those of their
neighbors.

103
Distance Measures
 e.g. assume p, p2, p4 = 1
p1, p3 = can have either 0 or 1

If only connectivity of pixels valued 1 is


p3 p4 allowed, and p1 and p3 are 0, the m-
distance between p and p4 is 2.
p1 p2
If either p1 or p3 is 1, the distance is 3.
p
If both p1 and p3 are 1, the distance is 4
(pp1p2p3p4)

104
Chapter 2 - The end

105

You might also like