1. A method for detecting at least one object in an environment by a monitoring system, the method comprising: taking at least one image of the environment by means of an image capturing device in the monitoring system; generating at least one background image of the environment based on the at least one image, the background image comprises a plurality of pixels; dividing the background image into a plurality of pixel blocks, wherein each of the pixel blocks includes more than one of the plurality of pixels in the background image; forming at least one data cluster of each pixel block based on at least one feature of background pixels in the pixel block, wherein the at least one cluster is modeled as a data distribution having a mean value and a standard deviation from the mean value; taking a subsequent image of the environment; comparing each pixel of the subsequent image with the at least one data cluster of the pixel block of the background image corresponding to said pixel to generate a first discrepancy value; comparing said pixel of the subsequent image with the at least one data cluster of each of the pixel blocks of the background image defined within a local search window to generate a second discrepancy value, wherein the size of the local search window is determined based on an estimated rate of movement of a background object in the background image, and wherein the direction of movement of the local search window is determined based on an estimated direction of movement of the background object; determining whether said pixel of the subsequent image is a background pixel or a foreground pixel based on the first discrepancy value and the second discrepancy value; generating a binary map of the subsequent image based on the determined background pixels and the foreground pixels; and marking connected pixels in the binary map corresponding to the foreground pixels to form at least one foreground object, wherein the at least one foreground object is the at least one object detected in the environment.