time.sleep(1) print( "\n\nPlease remove the items that you normally take away. The camera will take a picture" ) print( "Don't worry if you forget something. The system will learn over the next week!" ) input = raw_input("Press Enter to continue...") return_value, image = camera.read() cv2.imwrite("img2.jpg", image) return_value, image = camera.read() cv2.imwrite("img2.jpg", image) del (camera) # Send to learn x = imgProc.find("img1.jpg", "img2.jpg") try: os.remove("data.jpg") except: pass os.rename("1.jpg", "data.jpg") res = recog.doRequest() print(res) twi.sendSMS("+1 647-486-9484", "Trained!") #db.storeObject(res, -1, -1, True) while True: # First Picture Cal print("\n\ndebug1") input = raw_input("Press Enter to continue...") camera_port = 1 camera = cv2.VideoCapture(camera_port)
else: print("Unexpected error. Check your internet connection and make sure your camera is connected.") input= raw_input("Press Enter to exit...") sys.exit() input= raw_input("Emulate exit detection. Press any key to send leave command...") # Take second picture if (cam.pullImage("img2.jpg") == 0): print("Picture 2 taken") else: print("Unexpected error. Check your internet connection and make sure your camera is connected.") input= raw_input("Press Enter to exit...") sys.exit() # Call Detection list_gone = imgProc.find("img1.jpg", "img2.jpg") os.remove("data.jpg") os.rename("1.jpg", "data.jpg") taken = [] should_get = db.getListShouldTake() forgot = [] # Item processing for i in range(list_gone): x = db.getObjectsInArea(list[i][0], list[i][1], list[i][2], list[i][3]) if len(x) == 1: for item in x: taken.append(str(item)) else: x = recognize.doRequest() taken.append(x) #Check if all items taken
sys.exit() input = raw_input( "Emulate exit detection. Press any key to send leave command...") # Take second picture if (cam.pullImage("img2.jpg") == 0): print("Picture 2 taken") else: print( "Unexpected error. Check your internet connection and make sure your camera is connected." ) input = raw_input("Press Enter to exit...") sys.exit() # Call Detection list_gone = imgProc.find("img1.jpg", "img2.jpg") os.remove("data.jpg") os.rename("1.jpg", "data.jpg") taken = [] should_get = db.getListShouldTake() forgot = [] # Item processing for i in range(list_gone): x = db.getObjectsInArea(list[i][0], list[i][1], list[i][2], list[i][3]) if len(x) == 1: for item in x: taken.append(str(item)) else: x = recognize.doRequest() taken.append(x) #Check if all items taken
camera_port = 1 camera = cv2.VideoCapture(camera_port) camera.set(3,1920) camera.set(4,1080) time.sleep(1) print("\n\nPlease remove the items that you normally take away. The camera will take a picture") print("Don't worry if you forget something. The system will learn over the next week!") input= raw_input("Press Enter to continue...") return_value, image = camera.read() cv2.imwrite("img2.jpg", image) return_value, image = camera.read() cv2.imwrite("img2.jpg", image) del(camera) # Send to learn x = imgProc.find("img1.jpg", "img2.jpg") try: os.remove("data.jpg") except: pass os.rename("1.jpg", "data.jpg") res = recog.doRequest() print(res) twi.sendSMS("+1 647-486-9484", "Trained!") #db.storeObject(res, -1, -1, True) while True: # First Picture Cal print("\n\ndebug1") input= raw_input("Press Enter to continue...") camera_port = 1 camera = cv2.VideoCapture(camera_port)