1. A method for use in extraction of foreground objects in an image stream, the method comprising: providing input image data of a region of interest; providing a background model of said region of interest; utilizing said background model and processing each image in said input image data, said processing comprising: determining a background gradient map for pixels in said background model and an image gradient map for pixels in the image; defining a predetermined number of one or more segments in said image and corresponding one or more segments in the background model; for each image segment, determining an edge density factor being a first relation between the image and background gradient maps for said segment, and calculating a foreground detection threshold based on said certain relation, thereby enabling use of said foreground detection threshold for classifying each pixel in the segment as being a foreground or background pixel.