Abstract:
The present invention provides a method and apparatus for processing a video frame in a video file, the method comprising: for each predetermined numerical value of one or more predetermined numerical values, comparing the video frame with a video frame spaced prior to the video frame by the predetermined numerical value of frames to obtain a first inter-frame difference; comparing the video frame with a video frame spaced after the video frame by the predetermined numerical value of frames to obtain a second inter-frame difference; and for each pixel of the video frame, obtaining a confidence map associating the video frame by the predetermined numerical value based on a smaller value of the first inter-frame difference and the second inter-frame difference; and determining, at least based on a value of each pixel in one or more of the confidence maps associated with a corresponding predetermined numerical value, whether the pixel belongs to a foreground.