Digital Image Processing Lecture 2 Intensity Transformations and Spatial Filtering Second Semester...

105
Digital Image Processing Lecture 2 Intensity Transformations and Spatial Filtering Second Semester Azad University Islamshar Branch Y.ebrahimdoost@iiau. ac.ir

Transcript of Digital Image Processing Lecture 2 Intensity Transformations and Spatial Filtering Second Semester...

PowerPoint Presentation

Digital Image ProcessingLecture 2

Intensity Transformations and Spatial Filtering

Second Semester

Azad UniversityIslamshar [email protected] Basic Relationships Between Pixels and Introduction to the Mathematical Tools

Some Basic Intensity Transformation function

Histogram Processing

Fundamentals of Spatial Filtering

Smoothing Spatial Filtering

Sharpening Spatial Filtering

Combining Spatial Enhancement Methods

Using Fuzzy Techniques for Intensity TransformationsLecture NotesBasic Relationships Between Pixels1. Neighbors of pixel

4-neighbors of p, denoted by N4(p):

4 diagonal neighbors of p, denoted by ND(p):

8 neighbors of p, denoted N8(p)4-neighbors of pixel4-neighbors of pixel is denoted by N4(p)It is set of horizontal and vertical neighborsf(x, y) is a red circlef(x,y-1) is top onef(x-1,y) is left onef(x+1,y) is right onef(x,y+1) is bottom one(x-1)(y-1)(y+1)(x+1)(x)(y)4 4 diagonal neighbors of pixelDiagonal neighbors of pixel is denoted by ND(p)It is set of diagonal neighborsf(x, y) , is a yellow circlef(x-1,y-1) is top-left onef(x+1,y-1) is top-right onef(x-1,y+1) is bottom-left onef(x+1,y+1)is bottom-right one(x-1)(y-1)(y+1)(x+1)(x)(y)8-neighbors of pixel8-neighbors of pixel is denoted by N8(p)4-neighbors and Diagonal neighbors of pixelf(x,y) is a yellow circle(x-1,y-1), (x,y-1),(x+1,y-1), (x-1,y), (x,y), (x+1,y),(x-1,y+1),(x,y+1), (x+1,y+1)(x-1)(y-1)(y+1)(x+1)(x)(y)2. ConnectivityLet V is the set of intensity values used to define connectivityThere are three type of connectivity:

1. 4-Connectivity : 2 pixels (p and q) with value in V are 4-connectivity if q is in the set N4(p)

Basic Relationships Between Pixels2. 8-Connectivity : 2 pixels (p and q) with value in V are 8-connectivity if q is in the set N8(p)3. m-Connectivity : 2 pixels (p and q) with value in V are m-connectivity ifq is in N4(p), orq is in ND(p) and the set N4(p) N4(q) has no pixels whose values are from V.Basic Relationships Between Pixels2. ConnectivityA (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 connected 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.

3.PathBasic Relationships Between PixelsExamples: Adjacency and Path

0 1 1 0 1 1 0 1 10 2 0 0 2 0 0 2 00 0 1 0 0 1 0 0 1

V = {1, 2}

8-connectivitym-connectivity

Examples: Adjacency and Path

V = {1, 2}

11Let S represent a subset of pixels in an image. Two pixels p with coordinates (x0, y0) and q with coordinates (xn, yn) are said to be connected in S if there exists a path

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

Where:

4. Connected in S

Basic Relationships Between Pixels12Let S represent a subset of pixels in an image

For every pixel p in S, the set of pixels in S that are connected to p is called a connected component of S.If S has only one connected component, then S is called Connected Set.

We call R a region of the image if R is a connected set

Two regions, Ri and Rj are said to be adjacent if their union forms a connected set. Regions that are not to be adjacent are said to be disjoint.

Basic Relationships Between PixelsBasic Relationships Between PixelsBasic Relationships Between PixelsDistance MeasuresGiven pixels p, q and z with coordinates (x, y), (s, t), (u, v) respectively, the distance function D has following properties:

D(p, q) 0 [D(p, q) = 0, iff p = q]

D(p, q) = D(q, p)

D(p, z) D(p, q) + D(q, z)The following are the different Distance measures: a. Euclidean Distance :

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

b. City Block Distance:

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

c. Chess Board Distance:

D8(p, q) = max(|x-s|, |y-t|)

Basic Relationships Between PixelsDistance Measures

Introduction to Mathematical Tools in DIP Array vs. Matrix Operation

Array productMatrix productIntroduction to Mathematical Tools in DIP Linear vs. Nonlinear Operation

H is said to be a linear operator;

H is said to be a nonlinear operator if it does not meet the above qualification.Introduction to Mathematical Tools in DIP Arithmetic OperationsArithmetic operations between images are array operations. The four arithmetic operations are denoted as

s(x,y) = f(x,y) + g(x,y) d(x,y) = f(x,y) g(x,y) p(x,y) = f(x,y) g(x,y) v(x,y) = f(x,y) g(x,y)Example: Arithmetic Operations (Subtraction)

Example : Image Multiplication Spatial Operation1. Single-pixel operationsAlter the values of an images pixels based on the intensity (For example Negative of an image).

Spatial Operation2. Neighborhood operations

Image TransformGiven T(u, v), the original image f(x, y) can be recoverd using the inverse tranformation of T(u, v).

Introduction to Mathematical Tools in DIP

Image Transform

Example: Image Denoising by Using FFT Transform

Intensity Transformation and Spatial Filtering

Spatial Domain Process

1. Intensity Transformation Function (Point Processing)Example 1 : Image Negatives

Example 1 : Image Negatives

Example 2 : Log Transformations

Example 2 : Log TransformationsLog function has an important characteristic in which compress a dynamic range of images (Fourier Spectrum)

Example 3 : Power-Law (Gamma) Transformations

If 1 then the function has opposite effect.Example 3 - 1 : Gamma Correction (