[83caed]: / calcSpeed.m

Download this file

10 lines (7 with data), 270 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
function [mhimage,speed] = calcSpeed(mhimage,fgBBox,tmhi)
%updating motion history image(mhimg)
mhimage = max(zeros(size(mhimage)),mhimage-1);
mhimage(fgBBox==true) = tmhi;
%co-effecient of mhi for speed
speed = sum(sum(mhimage))/(sum(sum(fgBBox))*tmhi);
end