Blogger Widgets

Search This Blog

Tuesday, 1 May 2012

MATLAB PROGRAM FOR OBJECT DETECTION USING COLOUR INFORMATION

    Here for object detection we uses the color of the object.Using this method we can identify the object more accurately than correlation method. Here also the Background intensity cause some problem for accurate detection

 clc
vid=videoinput('winvideo',1,'YUY2_640x480');
preview(vid)
pause(5)
q=getsnapshot(vid);
a=ycbcr2rgb(q);

MATLAB PROGRAM FOR OBJECT DETECTION USING CORRELATION FUNCTION

             It is a simple Matlab program for object detection using color information .But the code has some problem when the background conditions are varying.In my program it produces correlation .5 or above when the image is detected.So using this correlation value we can decide the object.

q=imread('a.jpg');
r=rgb2gray(q);
size{128*488)
vid=videoinput('winvideo',1, 'YUY2_1024x768')
p=getsnapshot(vid)
s=rgb2gray(p)
for {i=1:1:128}
    for {j=1:1:488}
        c=s(i:i+60;j:j+100}
        corr2(r,c)
    end
end
Blogger Widgets