@@ -0,0 +1,1302 @@
+#!/usr/bin/python2%0Aimport sys%0Aimport cv2 %0Afrom cv2 import cv%0Aimport numpy as np%0Aimport freenect%0Afrom imgproc import *%0Afrom Kinect import Kinect%0A%0Asys.path.append('lib')%0A%0Aimgproc = Imgproc(-1)%0A%0Ax_pos = 100%0Ay_pos = 100%0Adef update_x(value):%0A    global x_pos%0A    x_pos = value%0Adef update_y(value):%0A    global y_pos%0A    y_pos = value%0Acv2.namedWindow('Depth and RGB')%0Acv.CreateTrackbar(%22X%22, 'Depth and RGB', x_pos, 632, update_x)%0Acv.CreateTrackbar(%22Y%22, 'Depth and RGB', y_pos, 479, update_y)%0A%0Akinect = Kinect()%0A%0Awhile True:%0A%0A    rgb,_ = freenect.sync_get_video()%0A    depth = kinect.get_depth()%0A    %0A    bgr = kinect.get_video()%0A    rects, rects_img = imgproc.doImgProc(bgr)%0A    %0A    max_rect = imgproc.getMaxRect(rects)%0A    if max_rect:%0A        print max_rect.x, max_rect.y%0A        x_pos = max_rect.x%0A        y_pos = max_rect.y%0A    else:%0A        print %22No Taget Found!%22%0A    %0A    cv2.circle(rgb, (x_pos, y_pos), 2, (255,255,0), 5)   %0A    %0A    distance = kinect.get_depth_at(x_pos, y_pos)%0A    print distance * 100 / 2.54# meters-%3Efeet-%3Ein%0A    %0A    # Build a two panel color image%0A    d3 = np.dstack((depth,depth,depth)).astype(np.uint8)%0A    da = np.hstack((d3,rgb))%0A    %0A    cv2.imshow('Depth and RGB',np.array(da%5B::2,::2,::-1%5D))%0A    cv2.imshow('RGB Mods', rects_img)%0A    if cv2.waitKey(5) == 27:%0A        break%0A

work in main