Skip to main content
. 2019 Oct 8;19(19):4344. doi: 10.3390/s19194344
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 τL and τH; initial superpixel classification parameters T1 and T2
3: Trajectory classification based on multi-frame homography model
 a: Calculate the long term trajectory Λ={Λi,i=1,,n} of input video
 b: Estimate the homography matrix set Hmulti={Hk,k=1,,Tt}
 c: for i=1,,n do
  Use Equation (3) to select the corresponding homography matrix set Himulti of trajectory Λi
  Use Equation (4) to estimate the average projection error εi of the trajectory Λi
  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 rti
 g: for t = 1:T do
  Use Equation (8)–(11) to calculate the unary potential Atc(rti) of superpixel rti
  Use Equation (12) and (13) to calculate the pairwise potential Sti,j(rti,rtj) and Tti,j(rti,rt+1j) of superpixel rti
  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