ret, frame = camera.read() input = Input() out1.write(frame) #Check if the next camera read is not null if ret: #track hand by motion (dynamically) detection = HandDetection() frame, previousFrame = detection.traceHand(frame,previousFrame) # get defects defect = FrameDefects() defects = defect.getDefects() if defects is not None: #draw the defects defect.drawDefects(frame,defects) # show some windows interface = UI() interface.showBasicWindows(frame) else: print("Video Finished") close = False while not close: close = input.getKey() break close = False close = input.getKey() if close: print("Bye") break camera.release() cv2.destroyAllWindows()