The invention provides a natural background video sectional drawing method. The method comprises the steps that 1) the method automatically selects a
key frame, specifically the method automatically selects the
key frame in a video by calculating inter-
frame difference; 2) a
key frame Trimap map is generated, specifically a user us allowed to provide useful information through a small amount of manual interaction and a
GrabCut segmentation
algorithm and a
Gaussian blur method are used to semi-automatically generate the Trimap map on the key frame; 3) a middle frame Trimap map is generated, specifically bidirectional
optical flow propagation is used to generate the Trimap map of each middle frame, and color, gradient and other information are used to correct errors generated by
optical flow propagation; and 4) according to the Trimap maps of all video frames and a Bayesian sectional drawing
algorithm with added three-dimensional space-time optimization, the alpha
mask map of each frame of the video is calculated, and the alpha
mask map and a new background are synthesized to acquire a new synthesized video. According to the invention, the method has the advantages of
fast speed and less user interaction, and the finally acquired new synthesized video has the advantages of good time coherence, high reality and the like.