图像匹配 算法 急啊!!!!!!!!!!!!
来源:百度知道 编辑:UC知道 时间:2024/07/03 12:47:27
%全搜索块匹配法
%image(240x320),区域(搜索窗)个数(u,v)=(4,5),大小(x,y)=(60,64)
%块大小b(16x16)
clear all
%load mov; %q.avi
%read the AVI movie filename into the MATLAB movie structure mov,mov has two fields, cdata and colormap
mov=aviread('v2.avi');
g=[];
for t=50:80
mov(t).cdata=rgb2gray(mov(t).cdata);
%imshow(mov(t).cdata);% displays the intensity image .
g=cat(3,g,mov(t).cdata);
end
%image(240x320),区域(搜索窗)个数(u?v),大小(x?y)
%u=4;v=5;
x=60;y=64;
%块大小b(16x16)
b=16;
vectorv=[];
vectorh=[];
gr=[];
gr=cat(3,gr,g(:,:,1));
referenceframe=g(:,:,1);
imshow(g(:,:,1));
original(1)=getframe;
after(1)=getframe;
for t=2:30
t
% profile on
imshow(g(:,:,t))
original(t)=getframe;
currentframe=g(:,:,t);
mad=zeros(x-b,y-b);
vh=[]; vv=[];
j1=[];i1=[]