def key_handler(self): """ Handle keystrokes, as set at the bottom of __init__() A plotting or camera frame window must have focus for keypresses to be detected. """ self.pressed = waitKey(10) & 255 # wait for keypress for 10 ms if self.pressed == ord("z"): send_cmd("b'bpm_over'") self.flag = 1 if self.pressed == 27: # exit program on 'esc' time.sleep(1) print("Exiting") for cam in self.cameras: cam.cam.release() if self.send_serial: self.serial.close() exit() print("exit heat rate tracking") for key in self.key_controls.keys(): if chr(self.pressed) == key: self.key_controls[key]()
def key_handler(self): """ Handle keystrokes, as set at the bottom of __init__() A plotting or camera frame window must have focus for keypresses to be detected. """ pressed = waitKey(10) & 255 #wait for keypress for 10 ms if pressed == 27: #exit program on 'esc' quit() for key in self.key_controls.keys(): if chr(pressed) == key: self.key_controls[key]()
def key_handler(self): self.pressed = waitKey(10) & 255 # wait for keypress for 10 ms if self.pressed == 27: # exit program on 'esc' print("Exiting") for cam in self.cameras: cam.cam.release() if self.send_serial: self.serial.close() sys.exit() for key in self.key_controls.keys(): if chr(self.pressed) == key: self.key_controls[key]()
def key_handler(self): """ Handle keystrokes, as set at the bottom of __init__() A plotting or camera frame window must have focus for keypresses to be detected. """ self.pressed = waitKey(10) & 255 # wait for keypress for 10 ms if self.pressed == 27: # exit program on 'esc' print "Exiting" for cam in self.cameras: cam.cam.release() if self.send_serial: self.serial.close() sys.exit()
def key_handler(self): """ Handle keystrokes, as set at the bottom of __init__() A plotting or camera frame window must have focus for keypresses to be detected. """ self.pressed = waitKey(10) & 255 # wait for keypress for 10 ms if self.pressed == 27: # exit program on 'esc' # TODO enable btn2/3 after Esc print("Exiting") sys.exit() for key in self.key_controls.keys(): if chr(self.pressed) == key: self.key_controls[key]()
def key_handler(self): """ Handle keystrokes, as set at the bottom of __init__() A plotting or camera frame window must have focus for keypresses to be detected. """ self.pressed = waitKey(10) & 255 # wait for keypress for 10 ms if self.pressed == 27: # exit program on 'esc' print("Exiting") self.vidcap.release() cv2.destroyAllWindows() sys.exit() for key in self.key_controls.keys(): if chr(self.pressed) == key: self.key_controls[key]()
def key_handler(self): """ Handle keystrokes, as set at the bottom of __init__() A plotting or camera frame window must have focus for keypresses to be detected. """ self.pressed = waitKey(1) & 0xFF # wait for keypress for 10 ms if self.pressed == 27: # exit program on 'esc' print "exiting..." self.cap.release() self.out.release() self.camera.cam.release() exit() for key in self.key_controls.keys(): if chr(self.pressed) == key: self.key_controls[key]()
def key_handler(self): """ Handle keystrokes, as set at the bottom of __init__() A plotting or camera frame window must have focus for keypresses to be detected. """ self.pressed = waitKey(1) & 255 # wait for keypress for 10 ms if self.pressed == 27: # exit program on 'esc' print "Exiting" # for cam in self.cameras: # cam.cam.release() # if self.send_serial: # self.serial.close() # sys.exit() for key in self.key_controls.keys(): if chr(self.pressed) == key: self.key_controls[key]()
def key_handler(self): """ Handle keystrokes, as set at the bottom of __init__() A plotting or camera frame window must have focus for keypresses to be detected. """ global line2 self.pressed = waitKey(10) & 255 #wait for keypress for 10 ms if self.pressed == 27 and self.processor.fft.ready == True: #exit program on 'esc' print "exiting..." self.camera.cam.release() #a = sum(self.processor.fft.samples)/float(len(self.processor.fft.samples)) print >> f, str(self.processor.show_bpm_text.bpm) print >> f, str(line2) #f.write(str(a) + "\n") #f.write(str(line2) + "\n") exit() for key in self.key_controls.keys(): if chr(self.pressed) == key: self.key_controls[key]()
def key_handler(self): """ Handle keystrokes, as set at the bottom of __init__() A plotting or camera frame window must have focus for keypresses to be detected. """ global line2 self.pressed = waitKey(10) & 255 #wait for keypress for 10 ms if self.pressed == 27 and self.processor.fft.ready == True: #exit program on 'esc' print "exiting..." self.camera.cam.release() #a = sum(self.processor.fft.samples)/float(len(self.processor.fft.samples)) print >>f, str(self.processor.show_bpm_text.bpm) print >>f, str(line2) #f.write(str(a) + "\n") #f.write(str(line2) + "\n") exit() for key in self.key_controls.keys(): if chr(self.pressed) == key: self.key_controls[key]()
def key_handler(self): self.pressed = waitKey(10) & 255 # wait for keypress for 10 ms for key in self.key_controls.keys(): if chr(self.pressed) == key: self.key_controls[key]()