📄 backgrounddrift.m
字号:
for t = 1:num_frames
% Drift the Background at the rate driftx and difty (in pixels/second) and add in the vibration:
xshift = driftx*delt*t+levarmx*vibx(t,1);
yshift = drifty*delt*t+levarmy*viby(t,1);
% Interpolate the 2D image using the MATLAB function interp2:
[xgrid ygrid] = meshgrid(1:backsize);
[xindex yindex] = meshgrid(xshift:1:xshift+backsize,yshift:1:yshift+backsize);
outtemp = interp2(xgrid,ygrid,background,xindex,yindex);
% Truncate the drifted image down from backsize to framesize:
out(:,:,t) = outtemp(xoff:xoff+framesize-1,xoff:xoff+framesize-1);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -