A computer-implemented method for image analysis of image frames in a video sequence, the method (100, 200) comprising: applying a first algorithm to the image frames to: define a background model of the video sequence, wherein the background model defines, for each spatial area of a plurality of spatial areas in the image frames, whether that spatial area belongs to a background or a foreground in the video sequence, wherein a detected significant change in image data in a spatial area in an image frame relative to image data in said spatial area in a preceding image frame is indicative of said spatial area belonging to the foreground, wherein the detected significant change is a difference between a pixel value or a number of pixel values in the spatial area in the image frame and a pixel value or a number of pixel values at a corresponding position in the preceding image frame that is more than a threshold value, and wherein the first algorithm comprises a plurality of timers, each timer associated with a spatial area of the plurality of spatial areas; define a spatial area as an idle area in the background model if no significant change has occurred in image data of the spatial area of an image frame relative to image data of said spatial area of a preceding image frame before a predetermined time limit; and to indicate that an idle area of the defined foreground areas is to be transitioned from the foreground to the background; the method further comprising: applying, after the indication, a second algorithm to image data at least partly corresponding to the idle area to determine whether the idle area is to be transitioned or not based on whether a foreground object is located in the image data, wherein the applying of the second algorithm comprises applying an image segmentation algorithm to the image data of the image frame at least partly corresponding to the idle area to locate an object in the image data, said object at least partly extending into the idle area, wherein the segmentation algorithm is adapted to perform detection of pre-registered objects; maintaining the idle area as a foreground area in the background model upon determining that the idle area comprises a foreground object; and transitioning the idle area to the background in the background model, upon determining that the idle area is not comprising a foreground object. define a background model of the video sequence, wherein the background model defines, for each spatial area of a plurality of spatial areas in the image frames, whether that spatial area belongs to a background or a foreground in the video sequence, wherein a detected significant change in image data in a spatial area in an image frame relative to image data in said spatial area in a preceding image frame is indicative of said spatial area belonging to the foreground, wherein the detected significant change is a difference between a pixel value or a number of pixel values in the spatial area in the image frame and a pixel value or a number of pixel values at a corresponding position in the preceding image frame that is more than a threshold value, and wherein the first algorithm comprises a plurality of timers, each timer associated with a spatial area of the plurality of spatial areas; define a spatial area as an idle area in the background model if no significant change has occurred in image data of the spatial area of an image frame relative to image data of said spatial area of a preceding image frame before a predetermined time limit; and to indicate that an idle area of the defined foreground areas is to be transitioned from the foreground to the background; the method further comprising: applying, after the indication, a second algorithm to image data at least partly corresponding to the idle area to determine whether the idle area is to be transitioned or not based on whether a foreground object is located in the image data, wherein the applying of the second algorithm comprises applying an image segmentation algorithm to the image data of the image frame at least partly corresponding to the idle area to locate an object in the image data, said object at least partly extending into the idle area, wherein the segmentation algorithm is adapted to perform detection of pre-registered objects; maintaining the idle area as a foreground area in the background model upon determining that the idle area comprises a foreground object; and applying, after the indication, a second algorithm to image data at least partly corresponding to the idle area to determine whether the idle area is to be transitioned or not based on whether a foreground object is located in the image data, wherein the applying of the second algorithm comprises applying an image segmentation algorithm to the image data of the image frame at least partly corresponding to the idle area to locate an object in the image data, said object at least partly extending into the idle area, wherein the segmentation algorithm is adapted to perform detection of pre-registered objects; maintaining the idle area as a foreground area in the background model upon determining that the idle area comprises a foreground object; and