2 #include <opencv/highgui.h> 8 static IplImage *image = 0;
9 if (!image) image = cvCreateImage(cvSize(640,480), 8, 3);
10 unsigned char *
depth_mid = (
unsigned char*)(image->imageData);
12 for (i = 0; i < 640*480; i++) {
13 int lb = ((
short *)depth->imageData)[i] % 256;
14 int ub = ((
short *)depth->imageData)[i] / 256;
17 depth_mid[3*i+2] = 255;
18 depth_mid[3*i+1] = 255-lb;
19 depth_mid[3*i+0] = 255-lb;
22 depth_mid[3*i+2] = 255;
23 depth_mid[3*i+1] = lb;
27 depth_mid[3*i+2] = 255-lb;
28 depth_mid[3*i+1] = 255;
33 depth_mid[3*i+1] = 255;
34 depth_mid[3*i+0] = lb;
38 depth_mid[3*i+1] = 255-lb;
39 depth_mid[3*i+0] = 255;
44 depth_mid[3*i+0] = 255-lb;
56 int main(
int argc,
char **argv)
58 while (cvWaitKey(10) < 0) {
61 printf(
"Error: Kinect not connected?\n");
64 cvCvtColor(image, image, CV_RGB2BGR);
67 printf(
"Error: Kinect not connected?\n");
70 cvShowImage(
"RGB", image);
IplImage * freenect_sync_get_rgb_cv(int index)
IplImage * freenect_sync_get_depth_cv(int index)
int main(int argc, char **argv)
IplImage * GlViewColor(IplImage *depth)