Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
my
Content
www.utem.edu.my
Thresholding Object detection (Basic) Face detection Object description (Feature Extraction)
5/4/12
Thresholding
www.utem.edu.my
Convert image into binary image (Black or White) Ex: if pixel >150 -->255, pixel <=150 0
5/4/12
Thresholding
www.utem.edu.my
Auto thresholding using Otsu thresholding Optimum division between foreground and background
5/4/12
Thresholding
www.utem.edu.my
Auto thresholding using Otsu thresholding Optimum division between foreground and background
5/4/12
Object Detection
www.utem.edu.my
5/4/12
Object Detection
www.utem.edu.my
Remove the noise using morphology method in order to make the image clearer
>> A=imread('ball.jpg'); >> b=im2bw(rgb2gray(A)); >>P=3000; >> BW2 = bwareaopen(b,P); >>BW3 = bwmorph(BW2,'dilate'); >>imshow(BW3)
5/4/12
Object Detection
www.utem.edu.my
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*');
5/4/12
Object Detection
www.utem.edu.my
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);
5/4/12
www.utem.edu.my
FACE DETECTION
First Method
www.utem.edu.my
5/4/12
www.utem.edu.my
Double click the folder , subfolders and the files will appear as shown.
5/4/12
www.utem.edu.my
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 be popped up Click Change Directory
5/4/12
5/4/12
Second Method
www.utem.edu.my
5/4/12
www.utem.edu.my
5/4/12
The output will appear as shown. Try to change the input to another picture and see the result.
5/4/12
www.utem.edu.my
Keypoint
www.utem.edu.my
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
5/4/12
keypoint
www.utem.edu.my
Open keypointExtraction folder. Open test.m and run it Change the filename in the test.m with other image file and test.
5/4/12