Object Detection & Description

Embed Size (px)

Citation preview

  • 8/3/2019 Object Detection & Description

    1/20

    www.utem.edu.my

    Click to edit Master subtitle style

    UNIVERSITY TEKNIKAL MALAYSIA MELAKA

    Object Detection & De-

    scription

    Engr. Khairul Muzzammil b. Saipullah

  • 8/3/2019 Object Detection & Description

    2/20

    www.utem.edu.my

    5/4/12

    Content

    Thresholding Object detection (Basic) Face detection

    Object description (Feature Extraction)

  • 8/3/2019 Object Detection & Description

    3/20

    www.utem.edu.my

    5/4/12

    Thresholding

    Convert image into binary image (Black or White) Ex: if pixel >150 -->255, pixel 150)=255;B(A

  • 8/3/2019 Object Detection & Description

    4/20

    www.utem.edu.my

    5/4/12

    Thresholding

    Auto thresholding using Otsu thresholding Optimum division between foreground and background

    A=imread('images.jpg');A=rgb2gray(A);B=im2bw(A);imshow(B);

  • 8/3/2019 Object Detection & Description

    5/20

    www.utem.edu.my

    5/4/12

    Thresholding

    Auto thresholding using Otsu thresholding Optimum division between foreground and background

    >> a=imread('coin.jpg');>> b=im2bw(rgb2gray(a));>> imshow(~b)%inverse black and white

  • 8/3/2019 Object Detection & Description

    6/20

    www.utem.edu.my

    5/4/12

    Object Detection

    Using Otsu thresholding try to locate the ball

    >> A=imread('ball.jpg');>> b=im2bw(rgb2gray(A));>> imshow(b)

  • 8/3/2019 Object Detection & Description

    7/20

    www.utem.edu.my

    5/4/12

    Object Detection

    Remove the noise using morphology method in order tomake the image clearer

    >> A=imread('ball.jpg');>> b=im2bw(rgb2gray(A));>>P=3000;>> BW2 = bwareaopen(b,P);>>BW3 = bwmorph(BW2,'dilate');

    >>imshow(BW3)

  • 8/3/2019 Object Detection & Description

    8/20

    www.utem.edu.my

    5/4/12

    Object Detection

    Get the top, bottom, left and right boundary of the object Get the center coordinate

    X=left+(Right-left)/2 Y=top+(down-top)/2

    A=imread('ball.jpg');b=im2bw(rgb2gray(A));P=3000;BW2 = bwareaopen(b,P);BW3 = bwmorph(BW2,'dilate');

    [cx,cy,hh,ww]=findboundary(BW3);imshow(BW3);hold on;plot(cx,cy,'r*');plot(cx,cy-hh/2,'r*');plot(cx,cy+hh/2,'r*');plot(cx+ww/2,cy,'r*');plot(cx-ww/2,cy,'r*');

  • 8/3/2019 Object Detection & Description

    9/20

    www.utem.edu.my

    5/4/12

    Object Detection

    Finally, you can get the region of the object on the original image

    A=imread('ball.jpg');b=im2bw(rgb2gray(A));P=3000;BW2 = bwareaopen(b,P);BW3 = bwmorph(BW2,'dilate');[cx,cy,hh,ww]=findboundary(BW3);imshow(A);rectangle( 'Position',[cx-hh/2,cy-ww/2,hh,ww],'EdgeColor','r', 'LineWidth',2);

  • 8/3/2019 Object Detection & Description

    10/20

    www.utem.edu.my

    Click to edit Master subtitle style

    UNIVERSITY TEKNIKAL MALAYSIA MELAKA

    FACE DETECTION

  • 8/3/2019 Object Detection & Description

    11/20

    www.utem.edu.my

    5/4/12

    Copy face_detection_aruma.zip , unzip it and drag it toMatlab Current Folder

    First Method

  • 8/3/2019 Object Detection & Description

    12/20

    www.utem.edu.my

    5/4/12

    Double click the folder , subfolders and the files will ap-pear as shown.

  • 8/3/2019 Object Detection & Description

    13/20

    www.utem.edu.my

    5/4/12

    Double click at facedetection.m and at the top of the file,edit the input image part.ex:i=imread(face_database/face4.jpg);

    Click run and usually for the first time this window will bepopped up

    Click Change Directory

  • 8/3/2019 Object Detection & Description

    14/20

    www.utem.edu.my

    5/4/12

    For the face4.jpg image, the outputs will be shown asbelow

    First Method Outputs

  • 8/3/2019 Object Detection & Description

    15/20

    www.utem.edu.my

    5/4/12

    Copy FDMver1.0.zip , unzip it and drag it to Matlab Cur-rent Folder

    Second Method

  • 8/3/2019 Object Detection & Description

    16/20

    www.utem.edu.my

    5/4/12

    Under that folder, Double click at ex01.m and run it.

  • 8/3/2019 Object Detection & Description

    17/20

    www.utem.edu.my

    5/4/12

    The output will appear as shown. Try to change the inputto another picture and see the result.

    Second Method Output

  • 8/3/2019 Object Detection & Description

    18/20

    www.utem.edu.my

    Click to edit Master subtitle style

    UNIVERSITY TEKNIKAL MALAYSIA MELAKA

    Description using KEY-

    POINT

  • 8/3/2019 Object Detection & Description

    19/20

    www.utem.edu.my

    5/4/12

    Keypoint

    The important of significant point in and object Used to describe the object Example

    Laplacian of Gaussian (LOG) Harries Corner Susan Corner Gilles Harris Laplace

  • 8/3/2019 Object Detection & Description

    20/20

    www.utem.edu.my

    5/4/12

    keypoint

    Open keypointExtraction folder. Open test.m and run it Change the filename in the test.m with other image file

    and test.