SHARE
TWEET

Untitled

a guest Dec 1st, 2010 817 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Be sure to link with -lfreenect_sync
  2. #include <opencv/cv.h>
  3. #include <opencv/highgui.h>
  4. #include <libfreenect/libfreenect_sync.h>
  5.  
  6. freenect_context *f_ctx;
  7. freenect_device *f_dev;
  8.  
  9. int main(int argc, char **argv)
  10. {  
  11.     IplImage *image = cvCreateImageHeader(cvSize(640,480), 8, 3);
  12.     while (cvWaitKey(10) < 0) {
  13.       char *data;
  14.       unsigned int timestamp;
  15.       freenect_sync_get_rgb(&data, &timestamp);
  16.       cvSetData(image, data, 640*3);
  17.       cvCvtColor(image, image, CV_RGB2BGR);
  18.       cvShowImage("RGB", image);
  19.       free(data);
  20.     }
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top