linear filtering 2

Upload: souvik5000

Post on 04-Jun-2018

234 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 Linear Filtering 2

    1/16

    contd.

    Linear Filtering and Convolution

    Ideal Low-pass Filter

  • 8/13/2019 Linear Filtering 2

    2/16

    Linear Filtering and Convolution

    Butterworth LP Filter

    Linear Filtering and Convolution

    Butterworth LP

    Filter, 2nd Order

  • 8/13/2019 Linear Filtering 2

    3/16

    Linear Filtering and Convolution

    Linear Filtering and Convolution

    Gaussian

  • 8/13/2019 Linear Filtering 2

    4/16

    Linear Filtering and Convolution

    Gaussian

    Variable Cutoffs

    Linear Filtering and Convolution

    Ideal highpass filter

    Butterworth highpass filter

    Gaussian highpass filter

    0

    0

    Dv)D(u,if1

    Dv)D(u,if0),( vuH

    nvuDvuH

    2

    0 ),(D1

    1),(

    2

    0

    2

    2/),(1),( DvuD

    evuH

  • 8/13/2019 Linear Filtering 2

    5/16

    Linear Filtering and Convolution

    Linear Filtering and Convolution

    Ideal

  • 8/13/2019 Linear Filtering 2

    6/16

    Linear Filtering and Convolution

    Butterworth

    Linear Filtering and Convolution

    Gaussian

  • 8/13/2019 Linear Filtering 2

    7/16

    Linear Filtering and Convolution

    Example of series operations

    Linear Filtering and Convolution

    Image sharpening is frequently used to improve

    the appearance of images by increasing

    delineation between different regions of possibly

    limited contrast. The goal is to improve high spatial frequency

    definition with minimal disturbance to the contrast

    information.

  • 8/13/2019 Linear Filtering 2

    8/16

    Deconvolution

    Deconvolution is exactly what it sounds like: the

    undoing of convolution.

    This means that instead of mixing two signals in

    convolution, we are isolating them.

    This is used for analyzing the characteristics of the

    input signal and the impulse response when given

    only the output of the system.

    Given y(t) = x(t) * h(t), the system should isolatex(t) and h(t) so that we may study each

    individually.

    Ideal Deconvolution System

  • 8/13/2019 Linear Filtering 2

    9/16

    Deconvolution

    Instead of producing one system that outputs both

    the convolved signals, it will be easier to consider

    separate systems that output one signal at a time.

    Each system here is annihilating the undesired

    signal, and is called a homomorphic filter

    Homomorphic Filters Homomorphic filters have been used in signal

    processing methods since the 1970s.

    A Homomorphic filter is a system which accepts asignal composed of two components and returns thesignal with one of the components removed.

    A frequently used method is to convert the convolutionof two signals into a sum, and then implement ahomomorphic filter to remove signal components.

  • 8/13/2019 Linear Filtering 2

    10/16

    Linear Filtering and Convolution

    Linear Filtering and Convolution

  • 8/13/2019 Linear Filtering 2

    11/16

    Linear Filtering and Convolution

    In frequency space, one can use a filter that

    reduces DC by 50%, then increases the filter

    function linearly to 4.0 96 pixels from DC and

    remains constant thereafter.

    In this case, the total power remains unchanged.

  • 8/13/2019 Linear Filtering 2

    12/16

  • 8/13/2019 Linear Filtering 2

    13/16

  • 8/13/2019 Linear Filtering 2

    14/16

    MATLAB Syntax

    Convolution is an example of a neighborhood function.

    Dilation and median filtering are also examples of

    neighborhood functions.

    MATLAB provides functions for implementing

    neighborhood functions across images using a single

    command.

    MATLAB Syntax

    Convolution kernels may be defined manually, or

    derived from MATLAB library.

    As an example, one may define a 3x3 smoothing filter:h1=[0 .5 0; .5 1 .5; 0 .5 0];

    Another approach is to use the fspecial function:

    h1= fspecial(sobel);

  • 8/13/2019 Linear Filtering 2

    15/16

    MATLAB Syntax

    To perform the convolution with your filter and an

    input image (A), use the conv2 function:

    B = conv2(A,h1);

    Where B is the output image, and h1 is the filter

    kernel.

    MATLAB Syntax

    MATLAB also provides for higher dimension

    convolution using the convn function which is

    useful, for example, when working with multiple

    RGB arrays. For example if you have 5 RGB images, instead of

    calling conv2 15 times, a 4D array can be

    assembled and convn called once.

  • 8/13/2019 Linear Filtering 2

    16/16

    MATLAB Syntax

    To determine the rank of a matrix, A:

    b = rank(A);

    If the rank = 1, use singular value decompositionto find the row and column vectors:

    [u,s,v]=svd(A);

    kcol = u(:,1) * sqrt(s(1));

    krow = conj(v(:,1))' * sqrt(s(1));

    If the process was performed correctly, thenkcol krow

    should give you back the original kernel.