Introduction to Digital Image Processing

Post on 13-Dec-2015

17 views 1 download

description

Lecture 1-2 DIP

Transcript of Introduction to Digital Image Processing

Digital Image Processing

Dr. Faraz AkramThe University of Faisalabad

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,

 

3 Introduction

“One picture is worth more than ten thousand words”

Anonymous

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

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)

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)

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.

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.

9

What is megapixel of your camera?

And what does that mean?

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

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

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.

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

14

Why we need 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

16 Examples: Image Enhancement

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

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

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?

19 Examples: Medical Imaging

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

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.

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

23 Examples: GIS

Geographic Information Systems– Digital image processing techniques are used

extensively to manipulate satellite imagery– Terrain classification– Meteorology

25 Examples: HCI

Try to make human computer interfaces more natural

– Face recognition– Gesture recognition

26 What we learned today?

• Digital images• Basic terms of digital imaging

• Pixel• Grayscale

• Digital Image processing• Applications of Digital Image Processing

Digital Image ProcessingLecture-2

Dr. Faraz AkramThe University of Faisalabad

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

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).

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?

31 Varying # of bits per pixel

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?

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

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

35 Sampling and Quantization

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

a b

36

1024 512 256

128 64 32

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

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

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

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.

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

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).

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).

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:

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.

46 Distance Measures

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

City Block Distance ()

Chessboard distance ()

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.