Ejemplo n.º 1
0
def main():
    import argparse
    parser = argparse.ArgumentParser(
        description="generate a depth filter file")
    parser.add_argument('--device-num',
                        default=0,
                        type=int,
                        help='the device number of the sensor')
    args = parser.parse_args()

    logging.basicConfig(level=logging.INFO,
                        format='%(asctime)s %(levelname)s: %(message)s')

    kinect = kinectcore.KinectStreamer()
    kinect.start()

    try:
        kinect.initialized.wait()
        if kinect.num_devices == 0:
            logging.error("no kinect devices")
        else:
            sensor = MotionSensor(kinect, args.device_num)
            sensor.debug = True
            sensor.run()
    finally:
        kinect.stop()
Ejemplo n.º 2
0
    def __init__(self):
        self.kinect = kinectcore.KinectStreamer()
        self.motion = motion.MotionSensor(self.kinect)
        self.web = web.WebServer(self, self.kinect)
        self.sounder = sounder.AudioSounder()
        self.lock = threading.Lock()

        self.threads = [self.kinect, self.motion, self.web]

        self.states = [
            "disarmed", "arming", "armed", "prealarm", "notify", "alarm",
            "silenced"
        ]
Ejemplo n.º 3
0
def main():
    parser = argparse.ArgumentParser(
        description="generate a depth filter file")
    parser.add_argument('--device-num',
                        default=0,
                        type=int,
                        help='the device number of the sensor')
    args = parser.parse_args()

    kinect = kinectcore.KinectStreamer()
    kinect.start()

    try:
        run(kinect, args.device_num)
    finally:
        kinect.stop()
Ejemplo n.º 4
0
                if cv2.waitKey(10) == 27:
                    return

            if not self.keep_running:
                return

    def start(self):
        if self.is_alive():
            return
        logging.info("Motion detection started")
        self.keep_running = True
        threading.Thread.start(self)

    def stop(self):
        if not self.is_alive():
            return
        self.keep_running = False
        self.join()
        logging.info("Motion detection stopped")


if __name__ == "__main__":
    kinect = kinectcore.KinectStreamer()
    kinect.start()
    try:
        motion = MotionSensor(kinect)
        motion.debug = True
        motion.run()
    finally:
        kinect.stop()