Top Banner
EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals
32

EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

Jan 03, 2016

Download

Documents

Junior Copeland
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

EE663Image Processing

Dr. Samir H. Abdul-Jauwad

Electrical Engineering Department

King Fahd University of Petroleum & Minerals

Page 2: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

2

Early Vision – One Image

• Classification of Image Operations− Spatial domain methods

− Point Processing Transformations− Area/Mask Processing Transformations− Geometric Transformations− Frame Processing Transformations

− Frequency domain methods

Page 3: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

3

Early Vision – One Image

Page 4: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

4

Point Processing Methods• The most primitive, yet essential, image processing

operations.• Intensity transformations that convert an old pixel into a

new pixel based on some predefined function.• Operate on a pixel based solely on that pixel’s value.• Used primarily for image enhancement.

Transformation function

Page 5: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

5

Point Processing Methods

• Identity transformation • Negative transformation

Page 6: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

6

Point Processing Methods

• Contrast stretching / Compression− Stretch gray-level

ranges where we desire more information

Page 7: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

7

Point Processing Methods

• Intensity-level slicing− Highlight a specific

range of gray-levels only

− Same as double thresholding

Page 8: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

8

Point Processing Methods

• Non-linear transformations− We may use any function, provided that is gives a one-to-one or

many-to-one (i.e., single-valued) mapping.

• Logarithmic

− Useful for enhancing details in the darker regions of the image at the expense of detail in the brighter regions.

Page 9: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

9

Point Processing Methods

• Exponential− The effect is the reverse of that

obtained with logarithmic mapping.

Page 10: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

10

Point Processing Methods

• Thresholding

Page 11: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

11

Point Processing Methods• Histogram equalization

− Low contrast images are usually mostly dark, mostly light, or mostly gray.

− High contrast images have large regions of dark and large regions of white.

− Good contrast images exhibit a wide range of pixel values (i.e., no single gray level dominates the image).

Page 12: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

12

Point Processing Methods• Histogram equalization

− The histogram of an image (i.e., a plot of the gray-level frequencies) provides important information regarding the contrast of an image.

− Histogram with a small spread: low contrast image

− Histogram with wide spread: high contrast image

− Histogram clustered at the low end: dark image

− Histogram clustered at the high end: bright image

Page 13: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

13

Point Processing Methods• Histogram equalization

− is a transformation that stretches the contrast by redistributing the gray-level values uniformly.

− is fully automatic compared to other contrast stretching techniques.

Page 14: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

14

Point Processing Methods• Histogram equalization

− In practice, the histogram might not become totally flat !

Page 15: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

15

Frame Processing Methods• Generate a pixel value based on an operation involving two

or more different images.• Each output pixel is usually located at the same position in

the input image.

• Addition

− Useful for combining information in two images.

Page 16: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

16

Frame Processing Methods

• Averaging

− Image quality can be improved by averaging a number of images together.

Page 17: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

17

Frame Processing Methods

• Subtraction

O(r, c) = |I1(r, c) - I2(r, c)|

− Useful for "change detection“

Page 18: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

18

Frame Processing Methods

• AND / OR

− The AND operator is usually used to mask out part of an image.

− Parts of another image can be added with a logical OR operator.

AND

AND

OR

Page 19: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

19

Geometric Transformations

• Modify the arrangement of pixels based on some geometric transformation.

Page 20: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

20

Geometric Transformations

• Translationr’ = r + tr

c’ = c + tc

• Scalingr’ = sr r

r’ = sc c

• Rotationr’ = r0 + (r - r0)cos() - (c - c0)sin()

c’ = c0 + (r - r0)sin() + (c - c0)sin()

• Affine Transformationr’ = a11r + a12c + b1

c’ = a21r + a22c + b2

Page 21: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

21

Geometric Transformations

• Some Practical Problems1) Transformed pixel coordinates might not lie within the bounds of

the image.

2) Transformed pixel coordinates can be non-integer.

3) There might be no pixels in the input image that map to certain pixel locations in the transformed image (one-to-one correspondence can be lost).

Page 22: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

22

Geometric Transformations

• Problem (3): Forward vs. Inverse Mapping − To guarantee that a value is generated for every pixel in the output

image, we must consider each output pixel in turn and use the inverse mapping to determine the position in the input image.

Page 23: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

23

Geometric Transformations

• Problem (2): Image Interpolation− Interpolation is the process of generating integer coordinates for a

transformed pixel by examining its surrounding pixels.

• Zero-order interpolation (or nearest-neighbor)

Page 24: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

24

Geometric Transformations

• First-order interpolation

• Higher-order interpolation schemes are more sophisticated but also more time consuming

Page 25: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

25

Noise

• Noise in Computer Vision:

• Can think of noise in several contexts:

− Any entity (in images, data, or intermediate results) that is not interesting for the main computation

− Spurious pixel fluctuations, introduced by image acquisition− Numerical inaccuracies, introduced by the computer’s limited

precision, round-offs or truncations, etc− Entities that do not belong to any meaningful region (edges that do

not correspond to actual object contours)

Page 26: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

26

Image Noise

• Additive and random noise:

• I(x,y) : the true pixel values • n(x,y) : the (random) noise at pixel (x,y)

yxnyxIyxI ,,,ˆ

Page 27: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

27

Image Noise

• Gaussian Noise:

− Is used to model additive random noise

2

2

2, n

eyxn

Page 28: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

28

Image Noise

• Salt-and-Pepper Noise:

− Is used to model impulsive noise

• Impulsive Noise− Alters random pixels− Makes their values very different from the true ones

• p, r are uniformly distributed random variables

• l, smin, smax are constants

lpssrs

lpyxIyxI

minmaxmin

,,ˆ

Page 29: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

29

Area/Mask Processing Methods

• A pixel value is computed from its old value and the values of pixels in its vicinity.

• More costly operations than simple point processes, but more powerful.

• What is a Mask?

− A mask is a small matrix whose values are called weights.− Each mask has an origin, which is usually one of its positions.− The origins of symmetric masks are usually their center pixel

position.− For non-symmetric masks, any pixel location may be chosen as the

origin (depending on the intended use).

Page 30: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

30

Area/Mask Processing Methods

• Examples:

• Applying masks to images (filtering)− The application of a mask to an input image produces an output

image of the same size as the input.

Page 31: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

31

Area/Mask Processing Methods• Convolution

1) For each pixel in the input image, the mask is conceptually placed on top of the image with its origin lying on that pixel.

2) The values of each input image pixel under the mask are multiplied by the values of the corresponding mask weights.

3) The results are summed together to yield a single output value that is placed in the output image at the location of the pixel being processed on the input.

Page 32: EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.

32

Area/Mask Processing Methods

• Mathematical definition of (discrete) convolution: