03 - Image Transforms

Embed Size (px)

Citation preview

  • 8/8/2019 03 - Image Transforms

    1/9

    Image Transforms

    copyright 2002H. R. Myler

    Fourier Transform Pair:

    2 ux v

    +

    ( )2( , ) ( , )j ux vy

    f x y F u v e dudv

    +

    =

    , ,u v x y e x y

    =

    copyright 2002H. R. Myler

    Same properties as in 1D apply

  • 8/8/2019 03 - Image Transforms

    2/9

    Fourier Transform Pair:

    We can show that for a box image of finite size X by Yand of a constant value A:

    ( ) ( ) ( )2 2

    2

    2 2

    sin sin( , )

    X Y

    j ux vy

    X Y

    uX vY F u v Ae dxdy AXY

    uX vY

    +

    = =

    The magnitude (spectrum) is:

    copyright 2002H. R. Myler

    ( ) ( )sin sin( , )

    uX vY F u v AXY

    uX vY

    =

    maxima of:cos 2 (ux+vy)

    copyright 2002H. R. Myler

  • 8/8/2019 03 - Image Transforms

    3/9

  • 8/8/2019 03 - Image Transforms

    4/9

    http://sepwww.stanford.edu/oldsep/hale/FftLab.html

    copyright 2002H. R. Myler

    Fast Fourier TransformTo approximate a function by samples, and toapproximate the Fourier integral by the discrete Fouriertransform, requires applying a matrix whose order is the

    .

    Since multiplying an n x n matrix by a vector costs on theorder of n2 arithmetic operations, the problem gets quicklyworse as the number of sample points increases.

    However, if the samples are uniformly spaced, then the

    copyright 2002H. R. Myler

    sparse matrices, and the resulting factors can be appliedto a vector in a total of order n log narithmetic operations.

    This is the so-called fast Fourier transform or FFT.

  • 8/8/2019 03 - Image Transforms

    5/9

    A separable transform can be written as:

    1 1

    1 2

    0 0

    ( , ) ( , ) ( , ) ( , )M N

    x

    T u v f x y g x u g y v

    = ==

    The kernel is symmetric if:

    1 1

    1 2

    0 0

    ( , ) ( , ) ( , ) ( , )M N

    u v

    f x y T u v h x u h y v

    = =

    =

    copyright 2002H. R. Myler

    g1(x,u)= g2(y,v)

    A separable transform can be computed intwo steps:

    1N

    1

    1

    0

    ( , ) ( , ) ( , )M

    x

    T u v T x v g x u

    =

    =

    2

    0

    , , ,y=

    =

    copyright 2002H. R. Myler

    This means that the transform can becomputed on the rows of the image, andthen on the columns.

  • 8/8/2019 03 - Image Transforms

    6/9

    This means that the transform can becomputed on the rows of the image, and

    then on the columns.f(x,y) processrows

    T(x,v)

    T(u,v) processcolumns

    copyright 2002H. R. Myler

    2D DFT example

    Bright spots

    in the corners

    Centered

    copyright 2002H. R. Myler

    spectrum

  • 8/8/2019 03 - Image Transforms

    7/9

    2D DFT examples with enhanced details

    Details were enhancedby the logtransformation.

    Both spectrum of thetranslated rectangle isidentical to the spectrum

    of the initial rectangle(previous slide).

    The spectrum of therotated ima e also

    copyright 2002H. R. Myler

    rotates by the sameangle

    Walsh Transform:

    ( ) 11

    ( ) ( )1( , ) 1 i n i

    nb x b u

    g x u

    =

    b k z is the kth bit from the binaryrepresentation of z.

    e.g., let z=13, then z=1101 binary.=

    0i=

    copyright 2002H. R. Myler

    3 z =

    b 2 z =1b 1 z =0

  • 8/8/2019 03 - Image Transforms

    8/9

    TheWalshtransformusessquarewavesas

    it's

    basis

    functions,

    and

    these

    vary

    from

    1

    to+1.

    whendiscussingtheWalsh.TheadvantageoftheWalshtransformis

    thatitdoesnotrequirefloatingpointmathortranscendentalfunctions.

    TheinverseWalshkernelisidenticaltothe

    copyright 2002H. R. Myler

    forwardkernel.

    Hadamard Transform:

    TheHadamardtransformissimilartotheWalshinthatitusessquarewavesof1to+1in

    .Thetransformiseasilyderivedfrom

    multiplicationoftheimagewiththeHadamardmatrix:

    F=

    copyright 2002H. R. Myler

    Thelowest

    order

    Hadamard

    matrices

    are

    given

    by:

    0 1 2

    1 1 1 1

    1 1 1 1 1 11 11; ;

    1 1 1 1 1 122

    1 1 1 1

    H H H

    = = =

  • 8/8/2019 03 - Image Transforms

    9/9

    Anyorderof2NHadamardmatrixcannowbederivedfrom:

    22

    N N

    N

    N N

    HH H

    =

    copyright 2002H. R. Myler

    ,omitted.

    Discrete Cosine Transform(DCT):

    g(x,u) = 2N

    cos2x+1u

    2NKernel:

    ThistransformissimplerthantheFourierasitdoesnotrequirecomplexnumbers.TheDCThastheaddedadvantageofmirrorsymmetry.

    1 1

    0 0

    1 1( , ) ( , )cos cos

    2 2

    M N

    x y

    F u v f x y x u y vM N

    = =

    = + +

    2D:

    copyright 2002H. R. Myler

    IftheDCTisusedforblockencoding,wheretheimageispartitionedintosubpicturespriortotransforming,theDCThaslessedgedegredationbecauseofit'ssymmetryproperties.

    Theinversekernelisidenticaltotheforwardform.