/// <summary> /// Learns the background statisitics for one more frame. /// </summary> /// <param name="image">Image to be accumulated for learning background statistics.</param> public void AccumulateBackground(Image <Gray, Single> image) { if (!first) { avg.Acc(image); CvInvoke.cvAbsDiff(image.Ptr, prev.Ptr, tmp1.Ptr); diff.Acc(tmp1); Count++; } first = false; prev = image.Copy(); }