Blogger Widgets

Search This Blog

Tuesday, 1 May 2012

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

No comments:

Post a Comment

Blogger Widgets