def motion_mongo_record(self, data, imagename): try: "add Motion Data captured to database" motion_id = mongoLABhelper.addMotionData(self.MotionCollection, data, imagename) print motion_id except: print "Error"
def motion_mongo_record(self, data, imagename): try: motion_id = mongoLABhelper.addMotionData(self.collection, data, imagename) print motion_id # print collection.find_one(motion_id) except: print "Error"
def AlertSaveImage(AlertCollection, MotionCollection, date, frame): if mongoLABhelper.alertQuery(AlertCollection, date) == True: ImageName = "AlertMotionDetected"+datetime.datetime.now().strftime("%b %d, %H:%M:%S")+".jpg" cv2.imwrite(ImageName, frame) motion_id = mongoLABhelper.addMotionData(MotionCollection, ImageName, ImageName) print "Saved Image from second angle" return datetime.datetime.utcnow()