% Mean value of last f frames temporal pooling method
% omtp = temppool_mean(om)
% om vector of objective metric scores for each frame
% f number of last frames
% Simple average of last f frames' scores. All frames are equally weighted.
function omtp = temppool_meanlastf(om, f)
    if ~isvector(om)
        error('Input om must be a vector')
    end
    if ~isscalar(f) || f <= 0 || f > length(om)
        error('Input f must be a positive scalar smaller or equal than length(om)');
    end
    lastf = om(end-f+1:end);
    omtp = mean(lastf);