Cycle trough masks back and forth

This commit is contained in:
esimov
2019-08-23 13:51:03 +03:00
parent e9fb798fcc
commit 7fbd9ca8fb

View File

@@ -145,6 +145,10 @@ while(True):
img_idx += 1 img_idx += 1
if img_idx > len(source_imgs)-1: if img_idx > len(source_imgs)-1:
img_idx = 0 img_idx = 0
elif key & 0xFF == ord('r'):
img_idx -= 1
if img_idx < 0:
img_idx = len(source_imgs)-1
cap.release() cap.release()
cv2.destroyAllWindows() cv2.destroyAllWindows()