Chapter 2: Image Analysis - PowerPoint PPT Presentation

1 / 87
About This Presentation
Title:

Chapter 2: Image Analysis

Description:

Image analysis involves manipulating image data to provide the info necessary to ... Zero-order: Repeating the previous pixel values, thus creating a blocky effect. ... – PowerPoint PPT presentation

Number of Views:133
Avg rating:3.0/5.0
Slides: 88
Provided by: metalabU
Category:

less

Transcript and Presenter's Notes

Title: Chapter 2: Image Analysis


1
Chapter 2 Image Analysis
  • Introduction and Preprocessing

2
Overview
  • Image analysis involves manipulating image data
    to provide the info necessary to solve a computer
    imaging problem.
  • It is primarily a data reduction process.
  • Extract only the necessary information.
  • Used in both computer vision and image processing.

3
Overview
  • For computer vision, the end product is typically
    the extraction of high-level information.
  • Shape parameters, color and texture features.
  • For image processing, it is used to help
    determine the type of processing required and the
    parameters needed.
  • Degradation function, enhancement algorithm, and
    determining visually important information.

4
System Model
5
System Model
  • Preprocessing is used to remove noise and
    eliminate irrelevant, visually unnecessary
    information.
  • This process may involve
  • Gray-level or spatial quantization (reduction of
    number of bits per pixel or image size).
  • Finding regions of interest for further
    processing.

6
System Model
  • Data reduction involves either reducing the data
    in spatial domain, or transforming it into
    another domain (the frequency domain).
  • Then the data needed for the analysis process is
    extracted.
  • Finally, the extracted features are examined and
    evaluated for their use in the application.

7
System Model
8
System Model
9
Preprocessing
  • The objective is to make the data reduction and
    analysis task easier.
  • The requirements are typically obvious and
    simple. For example
  • Noise removal.
  • Eliminate borders from images digitized from
    film.
  • Mask out rulers in skin tumor slides.
  • Convert gray-level image to binary.

10
Preprocessing
  • Among the preprocessing operations are
  • Extracting region of interest.
  • Performing basic algebraic operations on images.
  • Enhancing specific image features.
  • Reducing data in both resolution and brightness.

11
Region-of-Interest Image Geometry
  • Often, for image analysis, we want to investigate
    more closely a specific area within an image.
  • Region of Interest (ROI).
  • This requires operations that modify the spatial
    coordinates of the image.
  • Image geometry operations.

12
Region-of-Interest Image Geometry
  • Examples of image geometry operations
  • Crop, zoom, enlarge, shrink, translate, rotate.
  • Crop is the process of selecting a small portion
    of the image, and cutting it away from the rest
    of the image.
  • After we have crop the image, we can zoom in on
    it by enlarging it.

13
Region-of-Interest Image Geometry
14
Region-of-Interest Image Geometry
15
Region-of-Interest Image Geometry
  • The zoom process can be done in numerous ways,
    but typically zero-order or first-order hold is
    used.
  • Zero-order Repeating the previous pixel values,
    thus creating a blocky effect.
  • First-order Perform linear interpolation
    (averaging) between two pixels.
  • These methods allow us to enlarge an NxN size
    image to a size of (2N-1)x(2N-1).

16
Example of First-order Hold
17
Region-of-Interest Image Geometry
  • Another method that can achieve the same result
    (first-order hold) is a mathematical process
    called convolution.
  • The process has two steps
  • Extend the image by adding rows and columns of
    zeros between the existing rows and columns.
  • Perform convolution.

18
Region-of-Interest Image Geometry
19
Region-of-Interest Image Geometry
  • Convolution is done using a convolution mask.

20
Region-of-Interest Image Geometry
  • The convolution process requires us to overlay
    the mask on the image, multiply the coincident
    values, and sum all these results.
  • The result is used to substitute the pixel value
    that coincide with the center of the mask.
  • The process is repeated for every pixels in the
    image (except the outer ones).

21
Region-of-Interest Image Geometry
22
Region-of-Interest Image Geometry
23
Region-of-Interest Image Geometry
24
Region-of-Interest Image Geometry
  • Why use convolution instead of basic-averaging-of-
    neighbors method?
  • Many computer imaging board can perform
    calculation in hardware.
  • Convolution can be done very fast in hardware.
  • Zero-order hold can also be performed using
    convolution. But a different mask is used.

25
Region-of-Interest Image Geometry
  • Since there is no center pixel, the result need
    to be put in the pixel location corresponding to
    the lower-right corner.

26
Region-of-Interest Image Geometry
  • To enlarge by a factor of K (rather than of
    2N-1)
  • Subtract the two adjacent values.
  • Divide the result by K.
  • Add the result to the smaller value, and keep
    adding the result from the second step in a
    running total until all (K-1) intermediate pixel
    locations are filled.
  • This is done for every pair of adjacent pixels.

27
Region-of-Interest Image Geometry
28
Region-of-Interest Image Geometry
  • Translation is the process of moving an ROI from
    one position to another.
  • Rotation is the process of rotating an ROI for a
    number of degrees.
  • These two operations can be performed by applying
    equations.

29
Region-of-Interest Image Geometry
  • The equations for translation are given as
    follows
  • r and c are the new coordinates.
  • r and c are the original coordinates.
  • r0 and c0 are the distances to move or translate
    the image.

30
Region-of-Interest Image Geometry
  • The equations for rotation are given as follows
  • r and c are the new coordinates.
  • r and c are the original coordinates.
  • ? is the angle of rotation of the image, defined
    in a clockwise direction from the horizontal axis
    at the image origin in the upper left corner.

31
Region-of-Interest Image Geometry
  • The translation and rotation process can be
    combined into one set of equations.

32
Region-of-Interest Image Geometry
  • After translation, there might be a leftover
    space. What to do with it?
  • There are two options
  • Fill with constant values, either black (0) or
    white (255).
  • Wrap around.

33
Region-of-Interest Image Geometry
34
Region-of-Interest Image Geometry
  • After rotation, some part of the image might be
    rotated off the screen (the image plane).
  • How can we view the full, rotated image?
    Solution
  • Translate the image back to the center.
  • Enlarge the image plane.

35
Region-of-Interest Image Geometry
36
Region-of-Interest Image Geometry
37
Region-of-Interest Image Geometry
Example of enlarged image plane
38
Image Algebra
  • There are two categories of algebraic operations
    that can be applied to images.
  • Arithmetic operations
  • Addition, subtraction, division and
    multiplication.
  • Logic operations
  • AND, OR, NOT

39
Image Algebra
  • Addition is used to combine information in two
    images.
  • Subtraction is used to detect motion.
  • Multiplication and division are used to adjust
    brightness of an image.
  • AND and OR are used to perform a masking
    operation (an easy way to extract an ROI).
  • NOT creates a negative of original image.

40
Image Algebra - Addition
41
Image Algebra - Addition


42
Image Algebra - Addition


43
Image Algebra - Subtraction

44
Image Algebra - Subtraction
45
Image Algebra Multiplication
46
Image Algebra Division
47
Image Algebra - AND
  • Logic operations operate in bit-wise fashion on
    pixel data.

48
Image Algebra - AND
49
Image Algebra - OR
50
Image Algebra - NOT
Original image
Result of NOT operation
51
Spatial Filters
  • Done for noise removal or image enhancement.
  • Three types of filters will be discussed
  • Mean filters.
  • Median filters.
  • Enhancement filters.

52
Spatial Filters
  • Mean and median filters are primarily used to
    conceal or remove noise.
  • They can also be used for special applications.
  • For example, mean filter adds softer look to an
    image.
  • The enhancement filters highlight edges and
    details within an image.

53
Spatial Filters
54
Spatial Filters
Enhancement Filter
Original image
Image after enhancement filter is applied
55
Spatial Filters
  • Many filters are implemented with convolution
    masks.
  • Since the result is a weighted sum of the values
    of pixel of its neighbors, it is called a linear
    filter.
  • The overall effect on the image can be predicted
    based on the general pattern of the convolution
    mask.

56
Spatial Filters
  • If the coefficients of the mask sum to one,
    average brightness is retained.
  • If the coefficients of the mask sum to zero, the
    average brightness will be lost and will return a
    dark image.
  • If the coefficients are alternating positive and
    negative, filtering will return edge information.
  • If the coefficients are all positive, the image
    will be blurred.

57
Spatial Filters
  • Mean filters are averaging filters.
  • They replace the center pixel with the average of
    neighboring pixels.
  • The 3x3 mean filter convolution mask

58
Spatial Filters
  • The result of applying this filter can be
    guessed
  • Coefficients sum to one, therefore the image
    brightness is retained.
  • The coefficients are all positive, therefore it
    will blur the image.

59
Spatial Filters
  • Median filter replaces the center pixel value
    with the median value present among its
    neighbors.
  • Median filter is a non-linear filter
  • The result cannot be found by a weighted sum of
    the neighborhood pixels
  • It can use a neighborhood of any size, but 3x3,
    5x5 and 7x7 are typical.

60
Spatial Filters
61
Spatial Filters
Median Filter
Original Image
Median-filtered Image
62
Spatial Filters
  • Enhancement filters will tend to bring out or
    enhance details in the image.
  • We will discuss two types of enhancement filters
  • Laplacian filters
  • Difference filters

63
Spatial Filters
  • Two 3x3 convolution masks for laplacian filters
    are

64
Spatial Filters
  • Laplacian filters will enhance detail in all
    directions equally.
  • The difference filters will enhance details in
    the direction specific to the mask selected.
  • There are four difference filter convolution
    masks, corresponding to lines in the vertical,
    horizontal, and two diagonal directions.

65
Spatial Filters
66
Spatial Filters
67
Spatial Filters
68
Spatial Filters
69
Spatial Filters
70
Spatial Filters
71
Image Quantization
  • Process of reducing image data by removing some
    of the detail information by mapping groups of
    data to a single point.
  • There are two types gray-level reduction and
    spatial reduction.
  • Gray-level reduction
  • Reduce the precision of pixel values.
  • Map groups of values into one.

72
Image Quantization
  • Spatial reduction
  • Reduce number of pixels.
  • Map a group of pixels into one pixels.
  • The simplest method of gray-level reduction is
    thresholding.
  • Any pixel above the threshold is set to 1, and
    the rest to 0.
  • This turns a gray-level image into binary image.

73
Image Quantization
  • A more versatile method of gray-level reduction
    is by reducing the number of bits per pixel.
  • This can be done by masking the lower bits via an
    AND operation.
  • The number of bits that are masked determines the
    number of gray-levels available.

74
Image Quantization
75
Image Quantization
  • The general rule goes like this. If we want to
    reduce 256 gray levels to n gray levels
  • Find k such that 256/2k n.
  • Mask the lower k bits.
  • We can reduce the number of gray-levels to any
    power of 2 2, 4, 8, 16, 32, 64, or 128.
  • As the number of gray-level decreases, contouring
    increases.

76
Image Quantization
77
Image Quantization
78
Image Quantization
  • Contouring effect can be visually improved by
    using IGS (Improved gray-scale) quantization
    method.
  • It takes advantage of human visual systems
    sensitivity to edge by adding small random number
    to each pixel before quantization.
  • Results in a more visually pleasing appearance.

79
Image Quantization
80
Image Quantization
  • The AND-based method maps the quantized
    gray-level values to the low end of each range.
  • Alternatively, we can map the quantized
    gray-level values to the high end of the range
    using an OR operation.

81
Image Quantization
82
Image Quantization
  • The quantized values can also be mapped to the
    mid-point of the range.
  • This is done by an AND after an OR operation, or
    an OR after an AND operation.

83
Image Quantization
  • Although AND/OR method is very efficient, it is
    not very flexible since the size of the
    quantization bin is not variable.
  • There are also gray-level quantization methods
    that allow for variable bin sizes.
  • These methods are more complicated and the
    variable bin size is application dependent.

84
Image Quantization
85
Image Quantization
  • Quantization in spatial coordinates results in
    reducing the size of the image.
  • This is accomplished by taking groups of pixels
    that are spatially adjacent and mapping them to
    one pixel.

86
Image Quantization
  • This can be done in one of three ways
  • Averaging Find the average of the pixels
    (highest visual quality).
  • Median Sort the pixels from lowest to highest
    and find the median.
  • Decimation Simply choose one of the pixel
    (lowest visual quality).

87
Image Quantization
  • The quality of a decimation quantization image
    can be improved by preprocessing the image with
    an averaging, or mean spatial filter.
  • This type of filtering is called anti-aliasing
    filtering.
Write a Comment
User Comments (0)
About PowerShow.com