def main(): global color_flag path = "/home/pi/Pictures/vilib/color_detection/" Vilib.camera_start(vflip=True, hflip=True) Vilib.display(local=True, web=True) time.sleep(2) print(manual) while True: try: key = input().lower() if key in ['0', '1', '2', '3', '4', '5', '6']: color_flag = color_list[int(key)] color_detect(color_flag) elif key == "s": show_info() elif key == 'q': _time = time.strftime("%y-%m-%d_%H-%M-%S", time.localtime()) Vilib.take_photo(photo_name=str(_time), path=path) print("The photo save as %s%s.jpg" % (path, _time)) elif key == "g": Vilib.camera_close() break except KeyboardInterrupt: Vilib.camera_close() break
def main(): Vilib.camera_start(vflip=True, hflip=True) Vilib.display(local=True, web=True) path = "/home/pi/Pictures/vilib/continuous_shooting" print(manual) while True: key = readchar().lower() servo_control(key) if key == 'q': continuous_shooting(path, interval_ms=50, number=10) elif key == 'g': Vilib.camera_close() break sleep(0.01)
def main(): Vilib.camera_start(vflip=True, hflip=True) Vilib.display(local=True, web=True) sleep(2) print(manual) while True: key = readchar().lower() # rec control rec_control(key) # servo control servo_control(key) # esc if key == 'g': Vilib.camera_close() break sleep(0.1)
def main(): global key Vilib.camera_start(vflip=True, hflip=True) Vilib.display(local=True, web=True) sleep(2) print(manual) sleep(0.2) t = threading.Thread(target=keyboard_scan) t.setDaemon(True) t.start() path = "/home/pi/Videos/vilib/time_lapse" check_dir(path) while True: servo_control(key) # time-lapse photography if key == 'q': # check path output = path + '/' + strftime("%Y-%m-%d-%H-%M-%S", localtime()) check_dir(output) # take a picture every 3 seconds for 3600 seconds continuous_shooting(output, interval_s=3, duration_s=3600) # video_synthesis name = strftime("%Y-%m-%d-%H-%M-%S", localtime()) video_synthesis(name=name, output=output, path=path, fps=30, format='.jpg', datetime=True) # esc if key == 'g': Vilib.camera_close() global breakout_flag breakout_flag = True sleep(0.1) print('The program ends, please press CTRL+C to exit.') break sleep(0.01)
def main(): path = "/home/pi/Pictures/vilib/panorama" Vilib.camera_start(vflip=True, hflip=True) Vilib.display(local=True, web=True) sleep(2) print(manual) while True: key = readchar() # take photo if key == 'q': print("panorama shooting ...") panorama_shooting(path) # esc if key == 'g': print('Quit') Vilib.camera_close() break sleep(0.01)
def main(): path = "/home/pi/Pictures/vilib/" Vilib.camera_start(vflip=True, hflip=True) Vilib.display(local=True, web=True) time.sleep(2) print(manual) while True: try: key = input().lower() if key == "q": _time = time.strftime("%y-%m-%d_%H-%M-%S", time.localtime()) Vilib.take_photo(photo_name=str(_time), path=path) print("The photo save as %s%s.jpg" % (path, _time)) elif key == "g": Vilib.camera_close() break except KeyboardInterrupt: Vilib.camera_close() break