introduction to digital image processing

46
Digital Image Processing Dr. Faraz Akram The University of Faisalabad

Upload: farsun

Post on 13-Dec-2015

17 views

Category:

Documents


1 download

DESCRIPTION

Lecture 1-2 DIP

TRANSCRIPT

Page 1: Introduction to Digital Image Processing

Digital Image Processing

Dr. Faraz AkramThe University of Faisalabad

Page 2: Introduction to Digital Image Processing

2

Prerequisites: - Signals and Systems

- Digital Signal Processing

- Computer Programming (MATLAB or C++)

Textbook:- Digital Image Processing, third edition”,

by R. Gonzalez and R. Woods,

 

Page 3: Introduction to Digital Image Processing

3 Introduction

“One picture is worth more than ten thousand words”

Anonymous

Page 4: Introduction to Digital Image Processing

4 Contents

This lecture will cover:

– What is a digital image?– What is digital image processing?– State of the art examples of digital image

processing

Page 5: Introduction to Digital Image Processing

5 What is a Digital Image?

“a two-dimensional function, f(x, y), where x and y are spatial coordinates, and the amplitude of f at any pair of coordinates (x, y) is called the intensity (gray level of the image) at that point. When x, y, and the amplitude values of f are all finite, discrete quantities, we call the image a digital image.”

(Gonzalez and Woods)

Page 6: Introduction to Digital Image Processing

6 What is a Digital Image?

DIGITAL IMAGES are electronic snapshots taken of a scene or scanned from documents, such as photographs, manuscripts, printed texts, and artwork.

The digital image is sampled and mapped as a grid of dots or picture elements (pixels). Each pixel is assigned a tonal value (black, white, shades of gray or color)

Page 7: Introduction to Digital Image Processing

7 What is a Digital Image?

A digital image is a representation of a two-dimensional image as a finite set of digital values, called picture elements or pixels.

Page 8: Introduction to Digital Image Processing

8 What is pixel?

• Pixel is the smallest element of an image. Each pixel correspond to any one value.

• The value of a pixel at any point correspond to the light intensity at that particular location.

Page 9: Introduction to Digital Image Processing

9

What is megapixel of your camera?

And what does that mean?

Page 10: Introduction to Digital Image Processing

10 What is a Digital Image? (cont…)

Pixel values typically represent gray levels, colors, heights, opacities etc.Remember digitization implies that a digital image is an approximation of a real scene

1 pixel

Page 11: Introduction to Digital Image Processing

11 What is a Digital Image? (cont…)

Common image formats include:– 1 sample per point (B&W or Grayscale)– 3 samples per point (Red, Green, and Blue)– 4 samples per point (Red, Green, Blue, and “Alpha”,

a.k.a. Opacity)

For most of this course we will focus on grey-scale images

Page 12: Introduction to Digital Image Processing

12 Gray level?

The value of the pixel at any point denotes the intensity of image at that location, and that is also known as gray level.

Page 13: Introduction to Digital Image Processing

13 What is Digital Image Processing?

Digital image processing focuses on two major tasks

– Improvement of pictorial information for human interpretation

– Processing of image data for storage, transmission and representation for autonomous machine perception

Page 14: Introduction to Digital Image Processing

14

Why we need Digital Image Processing?

Page 15: Introduction to Digital Image Processing

15 Examples: Artistic Effects

Artistic effects are used to make images more visually appealing, to add special effects and to make composite images

Page 16: Introduction to Digital Image Processing

16 Examples: Image Enhancement

One of the most common uses of DIP techniques: improve quality, remove noise etc

Page 17: Introduction to Digital Image Processing

17 Examples: PCB Inspection

Printed Circuit Board (PCB) inspection– Machine inspection is used to determine that

all components are present and that all solder joints are acceptable

– Both conventional imaging and x-ray imaging are used

Page 18: Introduction to Digital Image Processing

18 Examples: Industrial Inspection

Human operators are expensive, slow andunreliable.

Make machines do thejob instead.

Industrial vision systems

are used in all kinds of industries.

Can we trust them?

Page 19: Introduction to Digital Image Processing

19 Examples: Medical Imaging

Page 20: Introduction to Digital Image Processing

20 Examples: Law Enforcement

Image processing techniques are used extensively by law enforcers

– Number plate recognition for speed cameras/automated toll systems

– Fingerprint recognition– Enhancement of

CCTV images

Page 21: Introduction to Digital Image Processing

21 Examples: Hurdle detection

Hurdle detection is one of the common task that has been done through image processing, by identifying different type of objects in the image and then calculating the distance between robot and hurdles.

Page 22: Introduction to Digital Image Processing

22 Examples: The Hubble Telescope

Launched in 1990 the Hubble telescope can take images of very distant objects

However, an incorrect mirror made many of Hubble’s images useless

Image processing techniques were used to fix this

Page 23: Introduction to Digital Image Processing

23 Examples: GIS

Geographic Information Systems– Digital image processing techniques are used

extensively to manipulate satellite imagery– Terrain classification– Meteorology

Page 24: Introduction to Digital Image Processing

25 Examples: HCI

Try to make human computer interfaces more natural

– Face recognition– Gesture recognition

Page 25: Introduction to Digital Image Processing

26 What we learned today?

• Digital images• Basic terms of digital imaging

• Pixel• Grayscale

• Digital Image processing• Applications of Digital Image Processing

Page 26: Introduction to Digital Image Processing

Digital Image ProcessingLecture-2

Dr. Faraz AkramThe University of Faisalabad

Page 27: Introduction to Digital Image Processing

28 Concept of Dimensions

Dimensions define the minimum number of points required to point a position of any particular object within a space.

1 dimension signal: The common example of a 1D signal is a waveform [F(x)].

2 dimension signal: The common example of a two dimensional signal is an image [F(x, y)].

1D Signal 2D Image

Page 28: Introduction to Digital Image Processing

29 Bits Per Pixel and shades

How many numbers can be represented by one bit?

Shades:

The famous gray scale image is of 8 bpp, means it has =256 different colors in it or 256 shades (0 - 255).

Page 29: Introduction to Digital Image Processing

30

Black color: Remember , 0 pixel value always denotes black color. But there is no fixed value that denotes white color.

White color: The value that denotes white color can be calculated as:

White in Binary? White in 8 bit?

Page 30: Introduction to Digital Image Processing

31 Varying # of bits per pixel

Page 31: Introduction to Digital Image Processing

32 Image Size

The size of an image depends upon three things.• Number of rows• Number of columns• Number of bits per pixel

Grayscale image, having 256 different shades of gray

No of Rows= 1024No of Columns= 1024

What is the image size in Mb?

Page 32: Introduction to Digital Image Processing

33 Sampling and Quantization

The basic idea behind converting an analog signal to its digital signal is to convert both of its axis (x, y) into a digital format.

Sampling: Digitizing coordinate values

Quantization: Digitizing Amplitude values

Page 33: Introduction to Digital Image Processing

34 Sampling and Quantization

Sampling : related to coordinates values

(Nyquist frequency)

Quantization : related to intensity values

0 0 0 75 75 75 128 128 128 128

0 75 75 75 128 128 128 255 255 255

75 75 75 200 200 200 255 255 255 200

128 128 128 200 200 255 255 200 200 200

128 128 128 255 255 200 200 200 75 75

175 175 175 225 225 225 75 75 75 100

175 175 100 100 100 225 225 75 75 100

75 75 75 35 35 35 0 0 0 35

35 35 35 0 0 0 35 35 35 75

75 75 75 100 100 100 200 200 200 200

Page 34: Introduction to Digital Image Processing

35 Sampling and Quantization

(a) Continuous image projected onto a sensor array. (b) Result of image sampling and quantization.

a b

Page 35: Introduction to Digital Image Processing

36

1024 512 256

128 64 32

Page 36: Introduction to Digital Image Processing

37 Aliasing and moiré patterns

Aliasing occurs when a signal is sampled at a less than twice the highest frequency present in the signal.

Properly sampled image Spatial aliasing in the form of a moiré pattern

moiré pattern

Page 37: Introduction to Digital Image Processing

38 Relationship between Pixels

Neighbors of a pixel:

A pixel at coordinates (x, y) has 4 horizontal and vertical neighbors whose coordinates are…?

This set of pixels are called the 4-neighbors of P, and is denoted by .

A1 A2 A3

A4 A5 A6

A7 A8 A9

Page 38: Introduction to Digital Image Processing

39 Relationship between Pixels

The four diagonal neighbors of are given by,

This set is denoted by .

A1 A2 A3

A4 A5 A6

A7 A8 A9

Page 39: Introduction to Digital Image Processing

40 Relationship between Pixels

The points and are together known as 8-neighbors of the point , denoted by

Note: Some of the points in the , and may fall outside image when lies on the border of image.

Page 40: Introduction to Digital Image Processing

41 Neighbors of a Pixel

• 4-neighbors of a pixel are its vertical and horizontal neighbors denoted by

• 8-neighbors of a pixel are its vertical, horizontal and 4 diagonal neighbors denoted by

Page 41: Introduction to Digital Image Processing

42 Adjacency

• Two pixels are connected if they are neighbors and their gray levels satisfy some specified criterion of similarity.

• For example, in a binary image two pixels are connected if they are 4-neighbors and have same value (0/1).

Page 42: Introduction to Digital Image Processing

43 Types of Adjacency

• Let V be set of gray levels values used to define adjacency.

• 4-adjacency: Two pixels p and q with values from V are 4-adjacent if q is in the set .

• 8-adjacency: Two pixels p and q with values from V are 8-adjacent if q is in the set .

• m-adjacency: Two pixels p and q with values from V are m-adjacent if, • q is in • q is in and the set [ ] is empty

(has no pixels whose values are from V).

Page 43: Introduction to Digital Image Processing

44 Types of Adjacency

• Mixed adjacency is a modification of 8-adjacency. It is introduced to eliminate the ambiguities that often arise when 8-adjacency is used.

For example:

Page 44: Introduction to Digital Image Processing

45 Types of Adjacency

In this example, we can note that to connect between two pixels (finding a path between two pixels):– In 8-adjacency way, you can find multiple paths

between two pixels– While, in m-adjacency, you can find only one path

between two pixels

So, m-adjacency has eliminated the multiple path connection that has been generated by the 8-adjacency.

Page 45: Introduction to Digital Image Processing

46 Distance Measures

The Euclidean distance between two 2-D points , is defined by

City Block Distance ()

Chessboard distance ()

Page 46: Introduction to Digital Image Processing

47 Distance Measures

Given pixels p, q and z with coordinates

(x, y), (s, t), (u, v) respectively,

the distance function D has following properties:

a. [ ]

b.

c.