登录论坛

查看完整版本 : 【求助】支持向量机的运动物体监测


桃花猪
2007-07-26, 09:56
老师让我用SVM(向量机)和template convolution做运动物体监测。
其中要包括一段诸如:
f=imread('image_0,tif');
% applying averaging
function ave=ave(f,winsize);
f1=zeros(f);
[irows,icols]=size(f1);
[wrows,wcols]=size(winsize);
wrhalf=floor(wrows/2);
wchalf=floor(wcols/2);
for x=ichalf:icols-half-1
for y=irhalf:irows-half-1
sum=0;
for iwin=1:winsize
for jwin=1:winsize
sum=sum+image(y+iwin-half,x+jwin-half)
f(x,y)=floor(sum/(winsize*winsize)
end
end
f(x,y)=sum;
end
end
%estimate of background
f=imread('image_0,tif');
inshow(f);
se=stre('disk'5);
afterOpening=imopen(f,se);
figure(1);
inshow(f);
figure(2);
inshow(afterOpening,[]);
surf(x,y,z)
background=imopen(f,strel('disk'15)
fp=imsubtract(f,background)
imshow(f)
figure(3);
imshow(fp,[])
的程序。
麻烦各位以及版主一定帮忙,希望可以得到matlab代码,先感谢先。