lecture 03,04,05 - intensity transformation and spatial filtering.pdf

Upload: vu-quang-pham

Post on 03-Jun-2018

230 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    1/46

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    2/46

    Intensity transformation and spatial filtering

    2

    Digital Image Processing 3

    I.Introduction Spatial Domain Process

    ( , ) [ ( , )])

    ( , ) : input image

    ( , ) :output image

    : an operator on defined over

    a neighborhood of point ( , )

    g x y T f x y

    f x y

    g x y

    T f

    x y

    =

    Digital Image Processing

    4

    I.Introduction

    Spatial Domain Process

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    3/46

    Intensity transformation and spatial filtering

    3

    Digital Image Processing 5

    II.IntensitytransformationfunctionIntensity transformation function

    ( )s T r=

    Digital Image Processing

    6

    II.Intensitytransformationfunction

    Some basic intensity transformation

    Functions

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    4/46

    Intensity transformation and spatial filtering

    4

    Digital Image Processing 7

    II.1.NegativeImage negatives

    1s L r=

    Digital Image Processing

    8

    II.1.Negative

    Smalllesion

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    5/46

    Intensity transformation and spatial filtering

    5

    Digital Image Processing 9

    II.2.LogTransformLog Transformations

    log(1 )s c r= +

    Digital Image Processing

    10

    II.2.LogTransform

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    6/46

    Intensity transformation and spatial filtering

    6

    Digital Image Processing 11

    II.3.Power Law

    s cr=

    Digital Image Processing

    12

    II.3.Power Law

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    7/46

    Intensity transformation and spatial filtering

    7

    Digital Image Processing 13

    II.3.Power Law

    Digital Image Processing

    14

    II.4.Piecewise-LinearTransform..

    Contrast Stretching Expands the range of intensity levels in an image so

    that it spans the full intensity range of the recording

    medium or display device

    Intensity-level Slicing Highlighting a specific range of intensities in an image

    often is of interest

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    8/46

    Intensity transformation and spatial filtering

    8

    Digital Image Processing 15

    II.4.Piecewise-LinearTransform

    Digital Image Processing

    16

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    9/46

    Intensity transformation and spatial filtering

    9

    Digital Image Processing 17

    II.5.Bit PlaneSlicing

    Digital Image Processing

    18

    II.5.Bit PlaneSlicing

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    10/46

    Intensity transformation and spatial filtering

    10

    Digital Image Processing 19

    III.Histogramprocessing Histogram Equalization

    Histogram Matching

    Local Histogram Processing

    Using Histogram Statistics for Image

    Enhancement

    Digital Image Processing

    20

    III.Histogramprocessing

    Histogram ( )

    is the intensity value

    is the number of pixels in the image with intensity

    k k

    th

    k

    k k

    h r n

    r k

    n r

    =

    Normalized histogram ( )

    : the number of pixels in the image of

    size M N with intensity

    kk

    k

    k

    np r

    MN

    n

    r

    =

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    11/46

    Intensity transformation and spatial filtering

    11

    Digital Image Processing 21

    III.Histogramprocessing

    4x4 image

    Gray scale = [0,9]histogram

    0 1

    1

    2

    2

    3

    3

    4

    4

    5

    5

    6

    6

    7 8 9

    No. of pixels

    Gray level

    2 3 3 2

    4 2 4 3

    3 2 3 5

    2 4 2 4

    Digital Image Processing

    22

    III.Histogramprocessing

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    12/46

    Intensity transformation and spatial filtering

    12

    Digital Image Processing 23

    III.1.HistogramEqualization As the low-contrast images histogram is narrow

    and centered toward the middle of the gray scale,

    if we distribute the histogram to a wider range the

    quality of the image will be improved.

    We can do it by adjusting the probability density

    function of the original histogram of the image so

    that the probability spread equally

    Digital Image Processing

    24

    III.1.HistogramEqualization

    Histogram transformation

    0 1rk

    sk= T(rk)

    s

    r

    T(r)

    s = T(r)s = T(r)

    Where 0 r 1

    T(r) satisfies (a). T(r) is single-valued

    and monotonicallyincreasingly in the interval0 r 1

    (b). 0 T(r) 1 for0 r 1

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    13/46

    Intensity transformation and spatial filtering

    13

    Digital Image Processing 25

    III.1.HistogramEqualization 2 conditions of T(r)

    Single-valued (one-to-one relationship) guarantees that

    the inverse transformation will exist

    Monotonicity condition preserves the increasing order from

    black to white in the output image thus it wont cause a

    negative image

    0 T(r) 1 for 0 r 1 guarantees that the output graylevels will be in the same range as the input levels.

    The inverse transformation from s back to r is

    r = Tr = T --11(s) ; 0(s) ; 0 ss 11

    Digital Image Processing

    26

    III.1.HistogramEqualization

    Let

    pprr(r)(r) denote the PDF of random variable r

    ppss(s(s)) denote the PDF of random variable s

    Ifpprr(r)(r) and T(r)T(r) are known and TT--11(s)(s) satisfiescondition (a) thenppss(s(s)) can be obtained using a

    formula :

    ds

    dr(r)p(s)p rs =

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    14/46

    Intensity transformation and spatial filtering

    14

    Digital Image Processing 27

    III.1.HistogramEqualization A transformation function is a cumulative distribution

    function (CDF) of random variable r :

    CDF is an integral of a probability function (always positive) is the

    area under the function Thus, CDF is always single valued and monotonically increasing

    Thus, CDF satisfies the condition (a)

    We can use CDF as a transformation function

    ==r

    r dw)w(p)r(Ts0

    Digital Image Processing

    28

    III.1.HistogramEqualization

    )r(p

    dw)w(pdr

    d

    dr

    )r(dT

    dr

    ds

    r

    r

    r

    =

    =

    =

    0

    10where1

    1

    =

    =

    =

    s

    )r(p)r(p

    ds

    dr)r(p)s(p

    r

    r

    rs

    Substitute and yield

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    15/46

    Intensity transformation and spatial filtering

    15

    Digital Image Processing 29

    III.1.HistogramEqualization Ps(s):

    Asps(s) is a probability function, it must be zero outside

    the interval [0,1] in this case because its integral over all

    values of s must equal 1.

    Calledps(s) as a uniform probability densitya uniform probability density functionfunction

    ps(s) is always a uniform, independent of the form of

    pr(r)

    Digital Image Processing

    30

    III.1.HistogramEqualization

    Discrete Transformation Function

    The probability of occurrence of gray level in an image

    is approximated by

    The discrete version of transformation

    =

    =

    ==

    ==

    k

    j

    j

    k

    j

    jrkk

    , ..., L-,where kn

    n

    )r(p)r(Ts

    0

    0

    110

    110 , ..., L-,where kn

    n)r(p kkr ==

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    16/46

    Intensity transformation and spatial filtering

    16

    Digital Image Processing 31

    III.1.HistogramEqualization Thus, an output image is obtained by mapping

    each pixel with level rrkk in the input image into a

    corresponding pixel with level sskk in the output

    image

    In discrete space, it cannot be proved in general

    that this discrete transformation will produce the

    discrete equivalent of a uniform probability density

    function, which would be a uniform histogram

    Digital Image Processing

    32

    III.1.HistogramEqualization

    Example before after Histogramequalization

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    17/46

    Intensity transformation and spatial filtering

    17

    Digital Image Processing 33

    III.1.HistogramEqualization Example

    before after Histogramequalization

    The quality is

    not improvedmuch becausethe originalimage alreadyhas a broadengray-level scale

    Digital Image Processing

    34

    III.Histogramprocessing

    4x4 image

    Gray scale = [0,9]histogram

    0 1

    1

    2

    2

    3

    3

    4

    4

    5

    5

    6

    6

    7 8 9

    No. of pixels

    Gray level

    2 3 3 2

    4 2 4 3

    3 2 3 5

    2 4 2 4

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    18/46

    Intensity transformation and spatial filtering

    18

    Digital Image Processing 35

    III.1.HistogramEqualization Example

    Gray Level 0 1 2 3 4 5 6 7 8 9

    No.of pixels 0

    16

    16/

    16

    9s x 9

    0 0 6 5 4 1 0 0 0

    0 0 6 11 15 16 16 16 16

    0 06 /

    16

    11 /

    16

    15 /

    16

    16 /

    16

    16/

    16

    16/

    16

    16/

    16

    0 03.3

    3

    6.1

    6

    8.4

    89 9 9 9

    =

    k

    j

    jn0

    =

    =k

    j

    j

    n

    ns

    0

    Digital Image Processing

    36

    III.1.HistogramEqualization

    Example

    Output image

    Gray scale = [0,9]

    Histogram equalization

    0 1

    1

    2

    2

    3

    3

    4

    4

    5

    5

    6

    6

    7 8 9

    No. of pixels

    Gray level

    3 6 6 3

    8 3 8 6

    6 3 6 9

    3 8 3 8

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    19/46

    Intensity transformation and spatial filtering

    19

    Digital Image Processing 37

    III.2.HistogramMatching Generate a processed image that has a specified

    histogram

    Let ( ) and ( ) denote the continous probability

    density functions of the variables and . ( ) is the

    specified probability density function.

    Let be the random variable with the prob

    r z

    z

    p r p z

    r z p z

    s

    0

    0

    ability ( ) ( 1) ( )

    Define a random variable with the probability

    ( ) ( 1) ( )

    r

    r

    z

    z

    s T r L p w dw

    z

    G z L p t dt s

    = =

    = =

    Digital Image Processing

    38

    III.2.HistogramMatching

    0

    0

    ( ) ( 1) ( )

    ( ) ( 1) ( )

    r

    r

    z

    z

    s T r L p w dw

    G z L p t dt s

    = =

    = =

    [ ]1 1( ) ( )z G s G T r = =

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    20/46

    Intensity transformation and spatial filtering

    20

    Digital Image Processing 39

    III.2.HistogramMatching Procedure

    1. Obtain pr(r) from the input image and then obtain the values of s

    2. Use the specified PDF and obtain the transformation function

    G(z)

    3. Mapping from s to z

    0( 1) ( )

    r

    rs L p w dw=

    0( ) ( 1) ( )

    z

    zG z L p t dt s= =1( )z G s=

    Digital Image Processing

    40

    III.2.HistogramMatching

    Example

    Assume an image has a gray level probability density functionpr(r) as shown.

    0 1 2

    1

    2

    Pr(r)

    +=

    elsewhere;0

    1r;022 r)r(p r

    10

    =r

    r dw)w(p

    r

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    21/46

    Intensity transformation and spatial filtering

    21

    Digital Image Processing 41

    III.2.HistogramMatching Example

    We would like to apply the histogram specification with thedesired probability density function pz(z) as shown.

    0 1 2

    1

    2

    Pz(z)

    z

    =elsewhere;0

    1z;02z)z(pz

    10

    =z

    z dw)w(p

    Digital Image Processing

    42

    III.2.HistogramMatching

    Example

    0 1

    1

    s=T(r)

    rrr

    ww

    dw)w(

    dw)w(p)r(Ts

    r

    r

    r

    r

    2

    2

    22

    2

    0

    2

    0

    0

    +=

    +=

    +=

    ==

    1. Obtain the transformation function T(r)

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    22/46

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    23/46

    Intensity transformation and spatial filtering

    23

    Digital Image Processing 45

    III.2.HistogramMatching Procedure in discrete cases

    1. Obtain pr(rj) from the input image and then obtain the values ofsk, round the value to the integer range [0, L-1]

    2. Use the specified PDF and obtain the transformation functionG(zq), round the value to the integer range [0, L-1].

    3. Mapping from sk to zq

    0 0

    ( 1)( ) ( 1) ( )

    k k

    k k r j j

    j j

    Ls T r L p r n

    MN= =

    = = =

    0

    ( ) ( 1) ( )q

    q z i k

    i

    G z L p z s=

    = =

    1( )q kz G s=

    Digital Image Processing

    46

    III.2.HistogramMatching

    ExampleSuppose that a 3-bit image (L=8) of size 64 64 pixels (MN =4096) has the intensity distribution shown in the followingtable (on the left). Get the histogram transformation functionand make the output image with the specified histogram, listedin the table on the right.

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    24/46

    Intensity transformation and spatial filtering

    24

    Digital Image Processing 47

    III.2.HistogramMatching Example

    Obtain the scaled histogram-equalized values,

    Compute all the values of the transformation function G,

    0 1 2 3 4

    5 6 7

    1, 3, 5, 6, 7,

    7, 7, 7.

    s s s s s

    s s s

    = = = = =

    = = =

    0

    0

    0

    ( ) 7 ( ) 0.00z jj

    G z p z

    =

    = =

    1 2

    3 4

    5 6

    7

    ( ) 0.00 ( ) 0.00

    ( ) 1.05 ( ) 2.45

    ( ) 4.55 ( ) 5.95

    ( ) 7.00

    G z G z

    G z G z

    G z G z

    G z

    = =

    = =

    = =

    =

    0

    0 01 2

    65

    7

    s0

    s2 s3

    s5 s6 s7

    s1

    s4

    Digital Image Processing

    48

    III.2.HistogramMatching

    Example 0 1 2 3 4

    5 6 7

    1, 3, 5, 6, 7,

    7, 7, 7.

    s s s s s

    s s s

    = = = = =

    = = =

    01

    2

    3

    4

    5

    6

    7

    kr

    0 3

    1 4

    2 5

    3 6

    4 7

    5 7

    6 7

    7 7

    k qr z

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    25/46

    Intensity transformation and spatial filtering

    25

    Digital Image Processing 49

    III.2.HistogramMatching Example

    Digital Image Processing

    50

    III.2.HistogramMatching

    Example

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    26/46

    Intensity transformation and spatial filtering

    26

    Digital Image Processing 51

    III.3.LocalHistogramProcessingDefine a neighborhood and move its center from pixel to pixel

    At each location, the histogram of the points in the

    neighborhood is computed. Either histogram equalization or

    histogram specification transformation function is obtained

    Map the intensity of the pixel centered in the neighborhood

    Move to the next location and repeat the procedure

    Digital Image Processing

    52

    III.3.LocalHistogramProcessing

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    27/46

    Intensity transformation and spatial filtering

    27

    Digital Image Processing 53

    III.4.UsingHistogramStatistics

    1

    0

    ( )L

    i i

    i

    m r p r

    =

    = 1

    0

    ( ) ( ) ( )L

    n

    n i i

    i

    u r r m p r

    =

    =

    12 2

    2

    0

    ( ) ( ) ( )L

    i i

    i

    u r r m p r

    =

    = =

    1 1

    0 0

    1( , )

    M N

    x y

    x yMN

    = =

    =

    [ ]1 1

    2

    0 0

    1( , )

    M N

    x y

    f x y mMN

    = =

    =

    Average Intensity

    Variance

    Digital Image Processing

    54

    III.4.UsingHistogramStatistics

    1

    0

    Local average intensity

    ( )

    denotes a neighborhood

    xy xy

    L

    s i s i

    i

    xy

    m r p r

    s

    =

    =

    12 2

    0

    Local variance

    ( ) ( )xy xy xy

    L

    s i s s i

    i

    r m p r

    =

    =

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    28/46

    Intensity transformation and spatial filtering

    28

    Digital Image Processing 55

    III.4.UsingHistogramStatistics

    0 1 2

    0 1 2

    ( , ), if and( , )

    ( , ), otherwise

    : global mean; : global standard deviation

    0.4; 0.02; 0.4; 4

    xy xys G G s G

    G G

    E f x y m k m k kg x y

    f x y

    m

    k k k E

    =

    = = = =

    Digital Image Processing

    56

    IV.UsingArithmetic/LogicOperators

    Arithmetic/Logic operations perform on pixel by

    pixel basis between two or more images, except

    NOT operation which perform only on a single

    image

    Logic operation performs on gray-level images,

    the pixel values are processed as binary

    numbers:

    Light represents a binary 1, and

    Dark represents a binary 0

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    29/46

    Intensity transformation and spatial filtering

    29

    Digital Image Processing 57

    IV.1.LogicOperators

    Digital Image Processing

    58

    IV.2.ImageSubtraction

    g(x,y) = f(x,y)g(x,y) = f(x,y)h(x,y)h(x,y)

    Extraction of the differences between images

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    30/46

    Intensity transformation and spatial filtering

    30

    Digital Image Processing 59

    IV.3.ImageAveraging Consider a noisy image g(x,y) formed by the addition of noise (x,y)

    to an original image f(x,y)

    g(x,y) = f(x,y) + (x,y) If noise has zero mean and be uncorrelated then it can be shown that

    if

    ),( yxg = image formed by averagingK different noisy images

    =

    =K

    i

    i yxgK

    yxg1

    ),(1

    ),(

    Digital Image Processing

    60

    IV.3.ImageAveraging

    Then

    ),(2

    ),(2 1

    yxyxg

    K

    =

    = variances of g and ),(2

    ),(2 , yxyxg

    if K increase, it indicates that the variability (noise) of the pixel ateach location (x,y) decreases.

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    31/46

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    32/46

    Intensity transformation and spatial filtering

    32

    Digital Image Processing 63

    V.SpatialFiltering

    Example

    M=3, N=3

    3x3

    Or M=5, N=5

    5x5

    Digital Image Processing

    64

    V.1.SmoothingFilters

    Smoothing filters are used for blurring and for noise reduction

    Blurring is used in removal of small details and bridging of small

    gaps in lines or curves

    Smoothing spatial filters include linear filters and nonlinear filters.

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    33/46

    Intensity transformation and spatial filtering

    33

    Digital Image Processing 65

    V.1.SmoothingFilters Linear filters

    The general implementation for filtering an M N image

    with a weighted averaging filter of size m n is given

    ( , ) ( , )

    ( , )( , )

    where 2 1

    a b

    s a t b

    a b

    s a t b

    w s t f x s y t

    g x yw s t

    m a

    = =

    = =

    + +

    =

    = +

    , 2 1.n b= +

    Digital Image Processing

    66

    V.1.SmoothingFilters

    Linear filters

    Averaging Filter Masks

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    34/46

    Intensity transformation and spatial filtering

    34

    Digital Image Processing 67

    V.1.SmoothingFilters Example

    Averaging Filter Masks

    a). original image 500x500 pixel

    b). - f). results of smoothing with

    square averaging filter masks of

    size n = 3, 5, 9, 15 and 35,

    respectively.

    Note:

    Big mask is used to eliminate small objects

    from an image.

    The size of the mask establishes the

    relative size of the objects that will be

    blended with the background.

    a b

    c d

    e f

    Digital Image Processing

    68

    V.1.SmoothingFilters

    original image result after smoothing with15x15 averaging mask

    result of thresholding

    we can see that the result after smoothing and thresholding, theremains are the largest and brightest objects in the image.

    Example

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    35/46

    Intensity transformation and spatial filtering

    35

    Digital Image Processing 69

    V.1.SmoothingFilters Order-Statistics Filters (Nonlinear Filters)

    The response is based on ordering (ranking) the pixels

    contained in the image area encompassed by the filter

    Example

    Median filter : R = median{zk |k = 1,2,,n x n}

    Max filter : R = max{zk |k = 1,2,,n x n}

    Min filter : R = min{zk |k = 1,2,,n x n}

    Note: n x n is the size of the mask

    Digital Image Processing

    70

    V.1.SmoothingFilters

    Median Filter Median: X= {x1,x2,, x2b+1}, x is called the median of X if x

    greater than or equal b elements and less than or equal b other

    elements in X;

    For example: X={3,2,3,2,3,4,5,6,5} (b=4) -> Median is 3

    Peplaces the value of a pixel by the median of the gray levels in

    the neighborhood of that pixel (the original value of the pixel is

    included in the computation of the median)

    Quite popular because for certain types of random noise (impulseimpulse

    noisenoise salt and pepper noisesalt and pepper noise) , they provide excellent noiseprovide excellent noise--

    reduction capabilitiesreduction capabilities, with considering less blurring than linearless blurring than linear

    smoothing filters of similar sizesmoothing filters of similar size

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    36/46

    Intensity transformation and spatial filtering

    36

    Digital Image Processing 71

    V.1.SmoothingFilters Median Filter

    Example

    Digital Image Processing

    72

    V.2.SharpeningSpatialFilters

    Foundation

    Laplacian Operator

    Unsharp Masking and Highboost Filtering

    Using First-Order Derivatives for Nonlinear Image

    Sharpening - The Gradient

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    37/46

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    38/46

    Intensity transformation and spatial filtering

    38

    Digital Image Processing 75

    Laplace Operator

    V.3.MethodbasedonLaplaceOperator

    The second-order isotropic derivative operator is the Laplacian

    for a function (image) f(x,y)2 2

    2

    2 2

    f ff

    x y

    = +

    2

    2( 1, ) ( 1, ) 2 ( , )

    ff x y f x y f x y

    x

    = + +

    22

    ( , 1) ( , 1) 2 ( , )f

    f x y f x y f x yy

    = + +

    2 ( 1, ) ( 1, ) ( , 1) ( , 1)

    - 4 ( , )

    f f x y f x y f x y f x y

    f x y

    = + + + + +

    Digital Image Processing

    76

    Masks

    V.3.MethodbasedonLaplaceOperator

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    39/46

    Intensity transformation and spatial filtering

    39

    Digital Image Processing 77

    Image sharpening in the way of using the

    Laplacian:

    where g(x,y) sharpened image

    V.3.MethodbasedonLaplaceOperator

    Digital Image Processing

    78

    Example

    V.3.MethodbasedonLaplaceOperator

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    40/46

    Intensity transformation and spatial filtering

    40

    Digital Image Processing 79

    V.4. Unsharp Masking and Highboost

    Filtering

    Digital Image Processing

    80

    V.4. Unsharp Masking and Highboost

    Filtering

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    41/46

    Intensity transformation and spatial filtering

    41

    Digital Image Processing 81

    V.4. Unsharp Masking and Highboost

    Filtering

    Digital Image Processing

    82

    V.4. Unsharp Masking and Highboost

    Filtering Example

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    42/46

    Intensity transformation and spatial filtering

    42

    Digital Image Processing 83

    V.4. Unsharp Masking and Highboost

    Filtering Example

    Digital Image Processing

    84

    V.5. Method based on First-Order

    Derivatives(Gradient)

    For function ( , ), the gradient of at coordinates ( , )

    is defined as

    grad( ) x

    y

    f x y f x y

    f

    g xf f

    fg

    y

    =

    2 2

    The of vector , denoted as ( , )

    ( , ) mag( ) x y

    magnitude f M x y

    M x y f g g

    = = +

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    43/46

    Intensity transformation and spatial filtering

    43

    Digital Image Processing 85

    V.5. Method based on First-Order

    Derivatives(Gradient)

    2 2

    The of vector , denoted as ( , )

    ( , ) mag( ) x y

    magnitude f M x y

    M x y f g g

    = = +

    ( , ) | | | |x y

    x y g g +

    z1 z2 z3

    z4 z5 z6

    z7 z8 z9

    8 5 6 5( , ) | | | |x y z z z z= +

    Digital Image Processing

    86

    V.5. Method based on First-Order

    Derivatives(Gradient)

    z1 z2 z3

    z4 z5 z6

    z7 z8 z9

    9 5 8 6

    Roberts Cross-gradient Operators

    ( , ) | | | |M x y z z z z +

    7 8 9 1 2 3

    3 6 9 1 4 7

    Sobel Operators

    ( , ) | ( 2 ) ( 2 ) |

    | ( 2 ) ( 2 ) |

    M x y z z z z z z

    z z z z z z

    + + + +

    + + + + +

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    44/46

    Intensity transformation and spatial filtering

    44

    Digital Image Processing 87

    V.5. Method based on First-Order

    Derivatives(Gradient)

    Digital Image Processing

    88

    V.5. Method based on First-Order

    Derivatives(Gradient)

    Example

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    45/46

    Intensity transformation and spatial filtering

    45

    Digital Image Processing 89

    V.6. Combining Spatial Enhancement

    Methods

    Solve:

    1. Laplacian to highlight fine detail

    2. Gradient to enhance prominent edges

    3. Gray-level transformation to increase the

    dynamic range of gray levels

    Digital Image Processing

    90

    V.6. Combining Spatial Enhancement

    Methods

    Exampe

  • 8/12/2019 Lecture 03,04,05 - Intensity transformation and Spatial Filtering.pdf

    46/46

    Intensity transformation and spatial filtering

    Digital Image Processing 91

    V.6. Combining Spatial Enhancement

    Methods

    Exampe