func (c *Motion) findTemporalAverage(frameAvg *[]motionVector, frameHistory *[][]motionVector, currFrame *[]motionVector) {
	var mV mVhelper

	if len(*frameHistory) >= c.NumInspectFrames {
		for i := 0; i < len(*currFrame); i++ {
			for j := 0; j < c.NumInspectFrames; j++ {
				mV.add((*frameHistory)[j][i])
			}
			(*frameAvg)[i] = mV.getAvg()
			mV.reset()
		}
		*frameHistory = (*frameHistory)[1:] // slice off oldest frame
	}
	var f2 = make([]motionVector, len(*currFrame))
	copy(f2, *currFrame)
	*frameHistory = append(*frameHistory, f2)
}
// findTemporalAverage examines the past numFrames and stores the average to frameAvg
findTemporalAverage examines the past numFrames and stores the average to frameAvg
// findTemporalAverage examines the past numFrames and stores the average to frameAvg
func (c *Motion) findTemporalAverage(frameAvg *[]motionVector, frameHistory *[][]motionVector, currFrame *[]motionVector) {
	var mV mVhelper
	if len(*frameHistory) >= c.NumInspectFrames {
		for i := 0; i < len(*currFrame); i++ {
			for j := 0; j < c.NumInspectFrames; j++ {
				mV.add((*frameHistory)[j][i])
			}
			(*frameAvg)[i] = mV.getAvg()
			mV.reset()
		}
		*frameHistory = (*frameHistory)[1:] 
	}
	var f2 = make([]motionVector, len(*currFrame))
	copy(f2, *currFrame)
	*frameHistory = append(*frameHistory, f2)
}
func ( c * Motion ) findTemporalAverage ( frameAvg * [ ] motionVector , frameHistory * [ ] [ ] motionVector , currFrame * [ ] motionVector ) { var mV mVhelper if len ( * frameHistory ) >= c . NumInspectFrames { for i := 0 ; i < len ( * currFrame ) ; i ++ { for j := 0 ; j < c . NumInspectFrames ; j ++ { mV . add ( ( * frameHistory ) [ j ] [ i ] ) } ( * frameAvg ) [ i ] = mV . getAvg ( ) mV . reset ( ) } * frameHistory = ( * frameHistory ) [ 1 : ] } var f2 = make ( [ ] motionVector , len ( * currFrame ) ) copy ( f2 , * currFrame ) * frameHistory = append ( * frameHistory , f2 ) }
findTemporalAverage examines the past numFrames and stores the average to frameAvg
findTemporalAverage examines the past numFrames and stores the average to frameAvg
// slice off oldest frame