From 07700cb3f56a06917a7bd80484b1b88811250f42 Mon Sep 17 00:00:00 2001 From: Dzhoshkun Ismail Shakir Date: Tue, 13 Nov 2018 14:12:46 +0000 Subject: [PATCH] Issue #18: implemented update method of StereoFrameChecker --- src/tests/utils.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/tests/utils.py b/src/tests/utils.py index ae4e70ed..9e1b722f 100644 --- a/src/tests/utils.py +++ b/src/tests/utils.py @@ -22,7 +22,22 @@ def __init__(self): self.stereo_frames_consistencies = [] def update(self, frame): - pass # TODO + self.stereo_frames_consistencies.append(True) + frames_consistent = True + for index in range(frame.stereo_count() - 1): + this_data = frame.data(False, index) + next_data = frame.data(False, index + 1) + if this_data.size == 0: + frames_consistent = False + break + if this_data.shape != next_data.shape: + frames_consistent = False + break + if np.array_equal(this_data, next_data): + frames_consistent = False + break + if not frames_consistent: + self.stereo_frames_consistencies[-1] = False def __bool__(self): if not self.stereo_frames_consistencies: