A method, comprising the steps of:
- selecting a current image X of multiple pixels;
- determining a reference image R of multiple pixels;
- for each pixel j of multiple pixels of the current image X:
- classifying a region of pixels around the pixel j in the current image X, into one of at least a first type and a second type of region, depending on the uniformity of a property of the pixels among the pixels in the region of pixels;
- when the region is of the first type, first determining whether change in the property of pixel j indicates a change in lighting or movement of an object depending on a first function;
- and
- when the region is of the second type, second determining whether the change in the property of pixel j indicates a change in lighting or movement of an object depending on a second function, the second determining is different than the first determining, the difference including that the second function is different than the first function.