private static FloatImage Compare(FloatImage currentImg, FloatImage oldImg, float thres, int cnt, string channel, MetriLog log) { if (null != oldImg) { FloatImage diff = oldImg - currentImg; float sad = diff.Abs().Sum(); log.Debug("SAD = " + sad); if (sad < thres) { log.ErrorFormat("Image {0}{1}: SAD ({2}) was below the threshold of {3}.", cnt, channel, sad, thres); return(null); } } oldImg = currentImg; return(oldImg); }