XueyanLi-FinalProject

Embed Size (px)

Citation preview

  • 7/27/2019 XueyanLi-FinalProject

    1/27

    CIS581 Presentation

    Morphological Operations

    Presented by: Xueyan LiSupervised by: Longin Jan Lateckie

  • 7/27/2019 XueyanLi-FinalProject

    2/27

    Presentation Outline

    Terminology and properties of Morphology Operations

    Structure element

    Four morphological Principles

    Iterative Morphological Operations

    Matlab Programs and results images for each operation

  • 7/27/2019 XueyanLi-FinalProject

    3/27

    Introduction---Morphology Operations

    Terminology

    Morphology:a broad set of image processing operations that

    process images based on shapes.

    Morphological operations apply a structuring elements to an

    input image, creating an output image of the same size.

    Properties

    Morphological operations simplify images, and quantify and

    preserve the main shape characteristics of objects.

  • 7/27/2019 XueyanLi-FinalProject

    4/27

    Four morphological principles

    Dilation

    Erosion

    Opening

    Closing

  • 7/27/2019 XueyanLi-FinalProject

    5/27

    Relationship of four operations

    Dilation and Erosion are the basic operations, can be

    combined into more complex sequences.

    Erosion and dilation are not invertible operations ---if an

    image is eroded and dilated, the original image is not re-

    obtained.

    The combination of Erosion and dilation constitutes new

    operations ----opening and closing. They are the most

    useful morphological filtering.

  • 7/27/2019 XueyanLi-FinalProject

    6/27

    Structuring element

    Morphological operations can be customized for anapplication by the proper selection of the structuring element,which determines exactly how the object will be dilated oreroded.

    matlab function strel() can create many kinds of structuringelement:

    dish-shaped,

    diamond-shaped,

    ball-shaped,

    square

    flat linear with length LEN

    arbitrary flat or a nonflat with the specified neighborhood

  • 7/27/2019 XueyanLi-FinalProject

    7/27

    Dilation

    Dilation allows objects to expand, then potentially filling in small

    holes and connecting disjoint object.

    Performance: laying the structuring element on the image and

    sliding it across the image.

    1) If the origin of the structuring element coincides with a 0 in

    the image, there is no change; move to the next pixel.

    2) If the origin of the structuring element coincides with a 1 inthe images, perform the OR logic operation on all pixels within

    the structuring element.

  • 7/27/2019 XueyanLi-FinalProject

    8/27

    My input images

  • 7/27/2019 XueyanLi-FinalProject

    9/27

    Matlab programming ---dilation

    %Read image

    I = imread(ford.tiff');

    figure('Name', 'original');

    imshow(I);

    %create structuring elements

    % 11-by-11 square

    se1 = strel('square',11);

    %Apply dilation operationfigure('Name', 'Dilate');

    Idilate1 = imdilate(I,se1);

    %Show the result image

    subplot(1,1,1), imshow(Idilate1),

    title('11x11 square');

    original image (above)

    Image after dilation (below)

  • 7/27/2019 XueyanLi-FinalProject

    10/27

    Erosion

    Erosion shrinks objects by etching away (eroding) their

    boundaries.

    Performance:

    1) If the origin of the structuring element coincides with a 0 in

    the image, there is no change; move to the next pixel.

    2) If the origin of the structuring element coincides with a 1 in

    the image, and any of the 1 pixels in the structuring element

    extend beyond the object (1 pixels) in the image, then

    change the 1 pixel in the image to a 0;

  • 7/27/2019 XueyanLi-FinalProject

    11/27

    Matlab programming ---erosion

    %Read image

    I = imread(ford.tiff');

    figure('Name', 'original');

    imshow(I);

    %create structuring elements

    % 11-by-11 square

    se1 = strel('square',11);

    %Apply erosion operationfigure('Name', 'Erode');

    Ierode1 = imerode(I,se1);

    %Show the result image

    subplot(1,1,1), imshow(Ierode1),

    title('11x11 square');

    original image (above)

    Image after erosion (below)

  • 7/27/2019 XueyanLi-FinalProject

    12/27

    Opening

    Opening consists of an erosion followed by a dilation and can

    be used to eliminate all pixels in regions that are to small to

    contain the structuring element.

    In this case the structuring element is often called a probe,

    because it is probing the image looking for small objects to

    filter out of the image.

  • 7/27/2019 XueyanLi-FinalProject

    13/27

    Matlab programming--- opening

    %Read image

    I = imread(ford.tiff');

    figure('Name', 'original');

    imshow(I);

    %create structuring elements

    % 11-by-11 square

    se1 = strel('square',11);

    %Apply the open opration

    figure('Name', 'Open');

    Iopen1 = imopen(I,se1);

    %Show the result image

    subplot(1,1,1), imshow(Iopen1), title('11x11

    square');

    original image (above)

    Image after opening (below)

  • 7/27/2019 XueyanLi-FinalProject

    14/27

    Closing

    Closing consists of a dilation followed by an erosion and

    connects objects that are close to each other. It can be used

    to fill in holes and small gaps.

  • 7/27/2019 XueyanLi-FinalProject

    15/27

    Matlab programming ---closing

    %Read image

    I = imread(ford.tiff');

    figure('Name', 'original');

    imshow(I);

    %create structuring elements

    % 11-by-11 square

    se1 = strel('square',11);

    %Apply close operationfigure('Name', Close');

    Iclose1 = imclose(I,se1);

    %Show the result image

    subplot(1,1,1), imshow(Iclose1),

    title('11x11 square');

    original image (above)

    Image after closing (below)

  • 7/27/2019 XueyanLi-FinalProject

    16/27

    Iterative Morphological Operations

    We can apply one or several operations to an image

    iteratively.

    InputImage ---(apply an operation) outputImage1---(apply the operation again) outputImage2and so on..until get your desired image

  • 7/27/2019 XueyanLi-FinalProject

    17/27

    Matlab program

    iterative operation of dilation (1)

    Original image after 1 dilation

    after 5th dilations after inf dilations

  • 7/27/2019 XueyanLi-FinalProject

    18/27

    Matlab program

    iterative operation of dilation (2)

    Original image after 1 dilation

    after 5th dilations after inf dilations

  • 7/27/2019 XueyanLi-FinalProject

    19/27

    Matlab program

    iterative operation of erosion (1)

    Original image after 1 erosion

    after 5th erosions after inf erosions

  • 7/27/2019 XueyanLi-FinalProject

    20/27

    Matlab program

    iterative operation of erosion (2)

    Original image after 1 erosion

    after 5th erosions after inf erosions

  • 7/27/2019 XueyanLi-FinalProject

    21/27

    Matlab program

    iterative operation of opening (1)

    Original image after 1 opening

    after 5th openings after inf openings

  • 7/27/2019 XueyanLi-FinalProject

    22/27

    Matlab program

    iterative operation of opening (2)

    Original image after 1 opening

    after 5th openings after inf openings

    l b

  • 7/27/2019 XueyanLi-FinalProject

    23/27

    Matlab program

    iterative operation of closing (1)

    Original image after 1 closing

    after 5th closings after inf closnings

    l b

  • 7/27/2019 XueyanLi-FinalProject

    24/27

    Matlab program

    iterative operation of closing (2)

    Original image after 1 closing

    after 5th closings after inf closings

  • 7/27/2019 XueyanLi-FinalProject

    25/27

    Morphological operations

    on gray-level image

    Original image Image after dilation Image after erosion

  • 7/27/2019 XueyanLi-FinalProject

    26/27

    My programming files

    1. morphor.m

    2. bwmorhpr.m

    If you are more interested in this topic, you can try to play

    the source code with a updated Matlab. Im sure a lot of fun

    there!

  • 7/27/2019 XueyanLi-FinalProject

    27/27

    Thank you !