Filtering and Image Enhancements - PowerPoint PPT Presentation

1 / 60
About This Presentation
Title:

Filtering and Image Enhancements

Description:

Image processing more accurately filtering, enhancement ... Operations can be based on local neighborhood or on the entire image. ... The Canny Edge Detector ... – PowerPoint PPT presentation

Number of Views:63
Avg rating:3.0/5.0
Slides: 61
Provided by: cit62
Category:

less

Transcript and Presenter's Notes

Title: Filtering and Image Enhancements


1
Filtering and Image Enhancements
  • Dr. Ramprasad Bala
  • Computer and Information Science
  • UMASS Dartmouth
  • CIS 465 Topics in Computer Vision

2
Introduction
  • Image processing more accurately filtering,
    enhancement or conditioning is the process of
    extracting the signal or structure in the image
    while suppressing unwanted or uninteresting
    variations in the image.
  • Operations can be based on local neighborhood or
    on the entire image.
  • Correlation or Convolution.

3
What needs fixing?
Image Enhancement
4
Image Enhancement
  • Image enhancement operators improve detectability
    of important image details or objects manually or
    automatically.
  • Noise reduction/suppression
  • Smoothing
  • Contrast stretching
  • Edge enhancement

5
Image Restoration
6
Image Restoration
  • Image restoration attempts to restore a degraded
    image to an ideal condition for further
    processing.
  • Constrained by the understanding and modeling of
    the ideal image formation and image degradation
    process.
  • If successful we can use the model to invert the
    degradation to return the ideal image.

7
Gray-level Mapping
  • Change the appearance of an image by transforming
    the pixels via a single function that maps an
    input gray-value into a new output value.
  • This can be done to the entire image or to use
    different functions for different sub-images.
  • Remapping the gray values is called stretching

8
Example
9
Example
10
Gamma correction
  • Any function map can be used.
  • The square root function (f(x) x ½ ) for
    example boosts, nonlinearly, all intensities, but
    more so the lower intensities than higher ones.
  • The function f(x) x 1/? is called Gamma
    correction. Where ? can be varying.
  • Image variation will be increased in the
    intensity ranges where the slope of the function
    is greater than 1.

11
Point operator
  • A point operator applied to an image is an
    operator in which the output pixel is determined
    only by the input pixel,
  • Outx,y f(Inx,y)
  • function f() may depend on some global
    parameter.
  • A contrast stretching operator is a point
    operator that used a piecewise smooth function
    f(Inx,y) of the input gray level to enhance
    important details of the image.

12
Disclaimer
  • While monotonic point operators work well in
    enhancing images for human consumption (or
    graphics etc), they do change the original
    intensities considerably.
  • In applications where the original intensity
    levels play a significant role (eg. mammography
    images) point operators are not good solutions
    for image enhancement.

13
Histogram Equalization
  • Histogram equalization is often used to enhance
    an image.
  • It accomplishes the following
  • The output image uses all available gray levels
  • The output image has approximately the same
    number of pixels of each gray level.
  • While a. makes sense, b. is ad hoc and its
    effectiveness can be judged only empirically.

14
Histogram Equalization
15
Histogram Equalization
16
Mathematically Speaking
  • Condition a. implies that all gray levels will be
    representedz z1,z z2z zn
  • Condition b. implies that gray level zk is used q
    times where q (RxC)/n, where R,C and n are
    number of rows, number of columns and number of
    intensities in the image respectively.

17
Implementation
  • Hini is the number of pixels of the input image
    having gray level zi.
  • The first gray level threshold t1is found by
    advancing I in the input image histogram until
    approximately q1 pixels are accounted for
    i.e.all input image pixels zk lt t1 1 will be
    mapped to gray level z1 in the output image.

18
Assignment 6
  • Implement histogram equalization.
  • Your program will take as input the number of
    intensities you want represented in the image.
  • Display the original image, its intensity
    histogram, the output image and its intensity
    histogram. The assignment should run off of a
    gui.
  • Due March 21th.

19
Noise Removal
  • Salt and Pepper Noise.
  • The presence of a single bright pixel in a dark
    region or vise versa is called Salt and Pepper
    noise.
  • Typically results from classification errors
    resulting from variation in surface material or
    illumination.
  • A (4- or 8 neighbor) mask is usually applied to
    eliminate this noise.
  • CC can also be used for removal of small regions.

20
(No Transcript)
21
Image Smoothing
  • Smoothing an image by equally weighting a
    rectangular neighborhood of pixels is called
    using a box filter.
  • Mean filter use the average of it neighbors

22
Original image modified with some gaussian noise.
23
Gaussian Filter
  • Instead of weighting the neighbors equally you
    could weight them based on their distance from
    the center pixel.
  • When a Gaussian filter is used, pixel x,y is
    weighted according to
  • where d sqrt((x-xc)2 (y-yc)2).
  • More on this later

24
Median Filter
  • The Mean filter usually works if the regions tend
    to be homogenous.
  • The Median Filter replaces the center pixel with
    the median of the neighboring values.
  • Works well for many types of noise.
  • Preserves edges, unlike the mean filter.
  • Computationally expensive, due to sorting.

25
5x5 Median Filter
7x7 Median Filter
26
Another Example
27
Detecting Edges Using Differencing Masks
  • Image points of high contrast can be detected by
    computing intensity differences in local image
    regions.
  • Differencing in the 1-D signal
  • The derivative would be discretely computed by
    subtracting successive values.
  • In the form a mask it will look like this
  • M

28
(No Transcript)
29
Difference masks can be used to obtain different
results. I only the presence of an edge is
important, you can simply compute the absolute.
If direction of the edge is important then leave
the sign in there. In the former case -1 1
would be equivalent mask to 1 1. Similarly for
the second derivative, The mask 1 2 1 would
be equivalent to -1 2 1. The first derivative
gives you information about sharp changes. The
second derivative gives you information on
zero-crossing.
30
First derivative mask
31
Second derivative mask
32
Smoothing versus differencing
33
Properties of Differencing
  • Coordinates of derivative masks have opposite
    signs in order to obtain a high response in
    signal regions of high contrast.
  • The sum of coordinates of derivative masks is
    zero so that zero response is obtained on
    constant regions.
  • First derivative masks produce high absolute
    values at points of high contrast.
  • Second derivative masks produce zero-crossing at
    points of high contrasts.

34
Properties of Smoothing Masks
  • Coordinates of smoothing masks are positive and
    sum to one so that output on constant regions is
    the same as the input.
  • The amount of smoothing and noise reduction is
    proportional to the mask size.
  • Step edges are blurred in proportion to the mask
    size.

35
Different operators on 2D signals.
  • From calculus we know that the derivative of a 2D
    function is given by
  • df/dx df/dy and the direction is given by
    tan-1 of these two values.
  • Since an edge might cut across an edge we may
    want to use more than one point to find the
    difference.

36
So the difference is defined as
37
Intuitively
38
Transforming this into a mask...
39
Applying this mask to an image
40
(No Transcript)
41
The Sobel Operator
42
Analysis
43
Notes on using these operators
  • The Roberts mask is more efficient due to smaller
    neighborhood operation.
  • All these local operators miss a lot of edges.
  • Computing square roots and squares can become
    quite expensive other variations include,
    absolute, maximum.

44
Zero crossings of the second derivative
  • The main disadvantage of these edge detectors is
    their dependence on the size of objects and
    sensitivity to noise.
  • An edge detection technique, based on the zero
    crossings of the second derivative explores the
    fact that a step edge corresponds to an abrupt
    change in the image function.
  • The first derivative of the image function should
    have an extrema at the position corresponding to
    the edge in the image, and so the second
    derivative should be zero at the same position.

45
Gaussian Filtering and LoG
  • A Gaussian function of one variable with spread s
    is of the following form
  • A Gaussian function in two variables is shown
    below

46
Laplacian of the Gaussian
  • Robust calculation of the 2nd derivative
  • smooth an image first (to reduce noise) and then
    compute second derivatives.
  • the 2D Gaussian smoothing operator G(x,y)

47
LoG
  • After returning to the original co-ordinates x, y
    and introducing a normalizing multiplicative
    coefficient c (that includes 1/ 2), we get a
    convolution mask of a zero crossing detector
  • where c normalizes the sum of mask elements to
    zero.

48
(No Transcript)
49
(No Transcript)
50
Some Properties
  • The area under the curve of g(x) making it
    suitable for being used as a filter.
  • g(x) is g(x) multiplied by the function x and
    one over s2.
  • g(x) is the difference of two even functions
    and the central lobe will be negative when x is
    approximately 0. The zero crossings occur when x
    s2.

51
Examples of G-masks
52
LoG
53
A large LoG filter
54
LOG Roberts Prewitt Sobel
55
Neural Networks
56
Marr-Hildreth Theory
57
(No Transcript)
58
The Canny Edge Detector
  • Smoothes the intensity image and then produces
    extended contour segments by following high
    gradient magnitudes from one neighborhood to
    another.
  • Details in chapter 10.

59
(No Transcript)
60
  • Color and Shading
Write a Comment
User Comments (0)
About PowerShow.com