eele 5310: digital image processing chapter 2 fundamentals...

40
EELE 5310: Digital Image Processing Chapter 2 Fundamentals of Digital Image Processing

Upload: others

Post on 05-Oct-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

EELE 5310: Digital Image Processing

Chapter 2

Fundamentals of Digital Image Processing

Page 2: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Image Acquisition

Page 3: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Image Sampling and Quantization

Digitalization of an analog signal involves two operations:

Sampling: Degitizing the x- and y-coordinates.

Quantization: Degitizing the amplitude values.

Page 4: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Image Sampling and Quantization

Page 5: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Representing Ddigital Images

A digital image is composed of M rows and N columns

of pixels each storing a value.

Page 6: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Representing Ddigital Images

A complete M × N digital image can be written in the following compact matrix form:

The right side of this equation is by definition a digital image. Each element of his matrix array is called an image element, picture element, pixel, or pel.

Page 7: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Storage Capacity

A digital image can be represented as a 2-D function whose coordinates and amplitude values are integers.

The digitization process requires decisions about values for M, N, and for the number, L, of discrete gray levels allowed for each pixel.

Due to processing, storage, and sampling hardware consideration, the number of gray levels is a power of 2:

The discrete levels are equally spaced integers in the interval [0, L-1], this range is called the dynamic range of an image.

Images with high dynamic range will have high contrast and (vise versa).

Page 8: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

The number, b, of bits required to store a digitized image

is: b = M x N x k

When M=N the equation become b=N2k

Storage Capacity cont…..

Page 9: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Storage Capacity cont…..

When an image can have 2k gray levels, it is common

practice to refer to the image as a “k-bit image.”For

example, an image with 256 possible gray-level values is

called an 8-bit image. Note that storage requirements for

8-bit images of size 1024*1024 and higher are not

insignificant.

Page 10: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

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

Page 11: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Gray-level Resolution

Gray-level resolution is the smallest discernible

change in gray level.

Due to hardware considerations, the number of gray

levels is usually an integer power of 2. The most

common number is 8 bits, i.e 256 levels.

It is common to refer to an L-level digital image of

size MxN as having a spatial resolution of MxN

pixels and a gray-level resolution of L levels.

Page 12: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Effects of Varying Spatial Resolution

Page 13: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Effects of Varying Spatial Resolution

Page 14: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Effects of Varying Gray-Level Resolution

Ridge like

structure

False contouring

Page 15: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Effects of Varying Gray-Level Resolution

Page 16: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Effects of Varying Gray-Level Resolution

As a very rough rule of thumb, and assuming

powers of 2 for convenience, images of size

256*256 pixels and 64 gray levels are about the

smallest images that can be expected to be

reasonably free of objectionable sampling

checkerboards and false contouring.

Page 17: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Relationships Between Pixels

1- Neighbors of a Pixel:

The 4- neighbors of pixel p are: N4(p)

A pixel p at coordinates (x, y) has four

horizontal and vertical neighbors whose coordinates are given by:

P

Page 18: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Relationships Between Pixels cont…

The 4- diagonal neighbors are: ND(p)

The 8-neighbors are : N8(p)

The 4- diagonal neighbors together with the 4-

neighbors of p

P

P

Page 19: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Relationships Between Pixels cont…

Connectivity between pixels is important because it is

used in establishing boundaries of objects and

components of regions in an image

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, …)

Page 20: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Adjacency

Let V be the set of intensity used to define adjacency;

e.g. V={1} in a binary image or

V={100,101,102,…,120} in a gray-scale image.

We consider three types of adjacency :

1. 4-adjacency:

Two pixels p and q with values from V are 4-adjacent if

q is in the set N4(p).

2. 8-adjacency:

Two pixels p and q with values from V are 8- adjacent if

q is in the set N8(p).

Page 21: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Adjacency

3. m-adjacency (mixed adjacency):

Two pixels p and q with values from V are m- adjacent if :

(i) q is in N4(p),or

(ii) q is in ND( p)and N4( p)∩ N4(q) is empty

Mixed adjacency is a modification of 8-adjacency. It is introduced to

eliminate the ambiguities that often arise when 8-adjacency is used.

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

to some pixel in S2.

Page 22: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Digital path (curve)

A (digital) path (or curve) from pixel p with coordinates

(x, y) to pixel q with coordinates (s, t) is a sequence of

distinct pixels with coordinates

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

where (x0, y0) = (x, y), (xn, yn) = (s, t), and pixels (xi, yi)

and (xi-1, yi-1) are adjacent for 1≤ i ≤ n. In this case, n is

the length of the path. If (x0, y0) = (xn, yn) the path is a

closed path.

Page 23: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Regions

Let S represent a subset of pixels in an image.

Two pixels p and q are said to be connected in S if

there exists a path between them consisting of pixels

in S.

For any pixel p in S, the set of pixels that are

connected to it in S is called a connected component

of S.

If S only has one connected component, then it is

called a connected set.

Let R be a subset of pixels in an image. We call R a

region of the image if R is a connected set

Page 24: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Region Boundary and edge

The boundary (also called border or contour) of

a region R is the set of pixels in the region that

have one or more neighbors that are not in R.

Edges are formed from pixels with derivative

values that exceed a preset threshold.

An edge is a “local” concept that is based on a

measure of gray-level discontinuity at a point.

Page 25: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Distance Measures

Page 26: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Distance Measures

Page 27: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Distance Measures

Page 28: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed
Page 29: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Distance Measures

The Dm distance: the shortest m-path

between the points.

Page 30: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Image Operations on a Pixel Basis

when we refer to an operation like “dividing one

image by another,” we mean specifically that the

division is carried out between corresponding

pixels in the two images.

Page 31: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed
Page 32: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed
Page 33: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed
Page 34: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed
Page 35: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed
Page 36: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed
Page 37: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed
Page 38: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed
Page 39: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Reading

Sections 2.4 and 2.5 of the textbook.

Page 40: EELE 5310: Digital Image Processing Chapter 2 Fundamentals ...site.iugaza.edu.ps/rsalamah/files/2012/02/chapter21.pdf · (ii) q is in N D ( p)and N 4( p)∩ N 4 (q) is empty Mixed

Homework

Answer the following problems from the text

book:

9, 11, 15,18, 19