greenUpper = (64, 255, 255) # set video resolution resWidth = 320 resLength = 240 if not args.get("video", False): #test vs = VideoStream(usePiCamera=True, awb_mode='sunlight', resolution=(resWidth, resLength)) vs.start() # awb_mode=sunlight works well for tracking green object print("cam warming up") time.sleep(1) tracker1 = ColorTracker(vs.mainQueue) tracker1.start() # tracker2 = ColorTracker(vs.mainQueue).start() # hud = Hud() # hud.start(tracker.cnts) # time.sleep(1) df1 = DisplayFrame(tracker1.xyDoneQueue) df1.start() # df2 = DisplayFrame(tracker2.xyDoneQueue).start() vs.join() tracker1.join() df1.join() # vs.release() ## close all windows
# ball in the HSV color space, then initialize the list of tracked points greenLower = (29, 86, 6) greenUpper = (64, 255, 255) #set video resolution resWidth = 320 resLength = 240 if not args.get("video", False): vs = VideoStream(usePiCamera=True, awb_mode='sunlight', resolution=(resWidth, resLength)).start() # awb_mode=sunlight works well for tracking green object print("cam warming up") time.sleep(1) df = DisplayFrame(vs.mainQueue) df.start() tracker = ColorTracker(vs.mainQueue) tracker.start() hud = Hud() hud.start(tracker.cnts) time.sleep(1) while True: #vs.release() ## close all windows #cv2.destroyAllWindows()