Ejemplo n.º 1
0
 def exit(self, arg):
     print("exit")
     self.active = False
     for thread in [self.kinect, self.proc_contours, self.proc_shapes]:
         thread.active = False
     freenect.sync_set_led(freenect.LED_OFF, 0)
     freenect.sync_stop()
Ejemplo n.º 2
0
 def exit(self, arg):
     print('exit')
     self.active = False
     for thread in [self.kinect, self.proc_contours, self.proc_shapes]:
         thread.active = False
     freenect.sync_set_led(freenect.LED_OFF, 0)
     freenect.sync_stop()
Ejemplo n.º 3
0
 def loop(self):
     print ("starting kinect thread")
     while self.active:
         self.loops += 1
         status = freenect.sync_get_depth(ctypes.byref(self.pointer), 0, 0, freenect.FREENECT_DEPTH_11BIT)
         Klock.acquire()  # seems safe even without locking?
         cv.SetData(OCVThread1.DEPTH16RAW, self.pointer, 640 * 2)
         Klock.release()
     freenect.sync_set_led(freenect.LED_OFF, 0)
     freenect.sync_stop()
     print ("exit kinect thread", self.loops)
Ejemplo n.º 4
0
 def loop(self):
     print('starting kinect thread')
     while self.active:
         self.loops += 1
         status = freenect.sync_get_depth(ctypes.byref(self.pointer), 0, 0,
                                          freenect.FREENECT_DEPTH_11BIT)
         Klock.acquire()  # seems safe even without locking?
         cv.SetData(OCVThread1.DEPTH16RAW, self.pointer, 640 * 2)
         Klock.release()
     freenect.sync_set_led(freenect.LED_OFF, 0)
     freenect.sync_stop()
     print('exit kinect thread', self.loops)
Ejemplo n.º 5
0
    def loop(self, lock):
        self.active = True
        self.loops = 0

        print("starting thread - freenect sync")
        while self.active:
            self.loops += 1
            status = freenect.sync_get_depth(ctypes.byref(self.pointer), 0, 0, freenect.FREENECT_DEPTH_11BIT)
            lock.acquire()
            print("data set...")
            cv.SetData(Kinect.DEPTH16RAW, self.pointer, 640 * 2)
            print("...data set done")
            lock.release()
        freenect.sync_set_led(freenect.LED_OFF, 0)
        freenect.sync_stop()
        print("exit thread - freenect sync", self.loops)
Ejemplo n.º 6
0
    def loop(self, lock):
        self.active = True
        self.loops = 0

        print('starting thread - freenect sync')
        while self.active:
            self.loops += 1
            status = freenect.sync_get_depth(ctypes.byref(self.pointer), 0, 0,
                                             freenect.FREENECT_DEPTH_11BIT)
            lock.acquire()
            print('data set...')
            cv.SetData(Kinect.DEPTH16RAW, self.pointer, 640 * 2)
            print('...data set done')
            lock.release()
        freenect.sync_set_led(freenect.LED_OFF, 0)
        freenect.sync_stop()
        print('exit thread - freenect sync', self.loops)