A method for processing image data, the method comprising: identifying a background scene in a background frame of an image; setting each of a plurality of pixel locations in the background frame as a respective background pixel; for each of the pixel locations, determining a respective running mean and a respective running variance based on a brightness component of the background frame at the pixel location; identifying a subsequent frame as a current frame; for each of the pixel locations in the current frame identified as a background pixel: updating the running mean based on one of a plurality of mean weights (WeightM); updating the running variance based one of a plurality of variance weights (WeightV); and for each of the pixel locations in the current frame: identifying if the current pixel location is one of a background pixel and a foreground pixel based on a brightness component of the current pixel location in the current frame, the running mean of the current pixel location, and the running variance of the current pixel location, characterized in that the method further including: using a larger mean weight (WeightM) relative to a nominal mean weight when the current pixel location changed in the current frame from a foreground pixel to a background pixel; and wherein the step of updating the running mean includes: updating the running mean based on the current mean weight (WeightM), according to: RMPixel = 1 − WeightM ∗ PrevRMPixel + WeightM ∗ PixelBC, where: RMPixel is the updated running mean for the current pixel location in the current frame; WeightM is the current mean weight (WeightM) for the current pixel location in the current frame; PrevRMPixel is the running mean of the current pixel location from a previous frame; and PixelBC is the brightness component of the current pixel location in the current frame. identifying a background scene in a background frame of an image; setting each of a plurality of pixel locations in the background frame as a respective background pixel; for each of the pixel locations, determining a respective running mean and a respective running variance based on a brightness component of the background frame at the pixel location; identifying a subsequent frame as a current frame; for each of the pixel locations in the current frame identified as a background pixel: updating the running mean based on one of a plurality of mean weights (WeightM); updating the running variance based one of a plurality of variance weights (WeightV); and updating the running mean based on one of a plurality of mean weights (WeightM); updating the running variance based one of a plurality of variance weights (WeightV); and for each of the pixel locations in the current frame: identifying if the current pixel location is one of a background pixel and a foreground pixel based on a brightness component of the current pixel location in the current frame, the running mean of the current pixel location, and the running variance of the current pixel location, characterized in that the method further including: using a larger mean weight (WeightM) relative to a nominal mean weight when the current pixel location changed in the current frame from a foreground pixel to a background pixel; and wherein the step of updating the running mean includes: updating the running mean based on the current mean weight (WeightM), according to: RMPixel = 1 − WeightM ∗ PrevRMPixel + WeightM ∗ PixelBC, where: RMPixel is the updated running mean for the current pixel location in the current frame; WeightM is the current mean weight (WeightM) for the current pixel location in the current frame; PrevRMPixel is the running mean of the current pixel location from a previous frame; and PixelBC is the brightness component of the current pixel location in the current frame. where: RMPixel is the updated running mean for the current pixel location in the current frame; WeightM is the current mean weight (WeightM) for the current pixel location in the current frame; PrevRMPixel is the running mean of the current pixel location from a previous frame; and PixelBC is the brightness component of the current pixel location in the current frame.