| Algorithm 1 Video segmentation algorithm based on multi-frame homography constraints |
| 1: Input: video sequence 2: Initialize: frames number T; temporal window interval t; trajectory classification thresholdand and ; initial superpixel classification parameters T1 and T2 |
| 3: Trajectory classification based on multi-frame homography model |
| a: Calculate the long term trajectory of input video |
| b: Estimate the homography matrix set |
| c: for do |
| Use Equation (3) to select the corresponding homography matrix set of trajectory |
| Use Equation (4) to estimate the average projection error of the trajectory |
| end for |
| d: Use Equation (5) to classify the motion trajectory. e: Use motion boundary to refine the spatial accuracy of trajectory classification. |
| 4: Pixel labeling based on Markov Random Fields model
f: Oversegment the input video to get the superpixel set g: for t = 1:T do Use Equation (8)–(11) to calculate the unary potential of superpixel Use Equation (12) and (13) to calculate the pairwise potential and of superpixel end for |
| h: Use graph cut algorithm to solve the energy function minimization problem |
| 5: Output: Pixel level object segmentation result for each frame of input video |