起亚k2轮胎能换宽的吗:我有个MATLAB程序看不懂,谁能帮我看一下?

来源:百度文库 编辑:神马品牌网 时间:2024/05/09 19:16:08
毕业设计急需,哪位好心人能帮我解释下?最好把注释写在每一行下面!
这是个视频车辆检测的程序:
%function [PSNR_e]=luck_MSE_SQ(c)
%Log 4 Search combined with smoothness of Motion Vector
%Load the image
clear all;
close all;
sequence.name='cheh21';
name=sequence.name;
M=aviread(name);
currentFrame=M(340).cdata;
currentY(:,:,1)=0.3*double(currentFrame(:,:,1))+0.59*double(currentFrame(:,:,2))+0.11*double(currentFrame(:,:,3));
currentFrame=M(310).cdata;
currentY(:,:,2)=0.3*double(currentFrame(:,:,1))+0.59*double(currentFrame(:,:,2))+0.11*double(currentFrame(:,:,3));
%Z=imsubtract(I,M);
frame1_Y=currentY(:,:,1);
frame2_Y=currentY(:,:,2);
figure;
colormap(gray(256));
%subplot(2,2,1);
imagesc(frame1_Y);
axis image;
title('Current Frame');
%subplot(2,2,2);
figure;
colormap(gray(256));
imagesc(frame2_Y);
axis image;
title('background Frame');
%subplot(2,2,3);
figure;
colormap(gray(256));
X=imsubtract(frame1_Y,frame2_Y);
X1=im2bw(X,0.8);
imagesc(X1);
axis image;
title('imsubtract');

X2=bwmorph(X1,'open');
figure,imshow(X2);
axis image;
title('open');
X3=bwmorph(X2,'close');
figure,imshow(X3);
axis image;
title('close');
X4=~X3;
figure,imshow(X4);
axis image;
title('inverse');

X6=uint8(frame1_Y);
I16=uint8(X4);
X5=immultiply(X6,I16);
figure,imshow(X5);
axis image;
title('close');
X6=uint8(frame2_Y);
%X5
for i=1:239;
for j=1:319;
while (X5(i,j)==0);
X5(i,j)=X6(i,j);
end
end
end

%X7=uint8(X3);
%X8=immultiply(X5,X7);
figure,imshow(X5);
axis image;
title('close');