Skip to content

Commit

Permalink
Issue #18: implemented update method of StereoFrameChecker
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhoshkun committed Nov 13, 2018
1 parent 1f6b46e commit 07700cb
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/tests/utils.py
Original file line number Diff line number Diff line change
@@ -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:

0 comments on commit 07700cb

Please sign in to comment.