'Track the detected features.'

def track_points(self):

    if (self.features != []):
        self.step()
        self.image = cv2.imread(self.imnames[self.current_frame])
        self.gray = cv2.cvtColor(self.image, cv2.COLOR_BGR2GRAY)
        tmp = float32(self.features).reshape((-1), 1, 2)
        (features, status, track_error) = cv2.calcOpticalFlowPyrLK(self.prev_gray, self.gray, tmp, None, **lk_params)
        self.features = [p for (st, p) in zip(status, features) if st]
        features = array(features).reshape(((-1), 2))
        for (i, f) in enumerate(features):
            self.tracks[i].append(f)
        ndx = [i for (i, st) in enumerate(status) if (not st)]
        ndx.reverse()
        for i in ndx:
            self.tracks.pop(i)
        self.prev_gray = self.gray
