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

Post on 03-Jan-2016

216 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

Transcript

EE663Image 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

3

Early Vision – One Image

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

5

Point Processing Methods

• Identity transformation • Negative transformation

6

Point Processing Methods

• Contrast stretching / Compression− Stretch gray-level

ranges where we desire more information

7

Point Processing Methods

• Intensity-level slicing− Highlight a specific

range of gray-levels only

− Same as double thresholding

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.

9

Point Processing Methods

• Exponential− The effect is the reverse of that

obtained with logarithmic mapping.

10

Point Processing Methods

• Thresholding

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

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

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.

14

Point Processing Methods• Histogram equalization

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

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.

16

Frame Processing Methods

• Averaging

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

17

Frame Processing Methods

• Subtraction

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

− Useful for "change detection“

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

19

Geometric Transformations

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

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

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

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.

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)

24

Geometric Transformations

• First-order interpolation

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

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)

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 ,,,ˆ

27

Image Noise

• Gaussian Noise:

− Is used to model additive random noise

2

2

2, n

eyxn

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

,,ˆ

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

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.

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.

32

Area/Mask Processing Methods

• Mathematical definition of (discrete) convolution:

top related