libfreenect_cv.c
Go to the documentation of this file.
1 #include "libfreenect.h"
2 #include "libfreenect_sync.h"
3 #include "libfreenect_cv.h"
4 
5 IplImage *freenect_sync_get_depth_cv(int index)
6 {
7  static IplImage *image = 0;
8  static char *data = 0;
9  if (!image) image = cvCreateImageHeader(cvSize(640,480), 16, 1);
10  unsigned int timestamp;
11  if (freenect_sync_get_depth((void**)&data, &timestamp, index, FREENECT_DEPTH_11BIT))
12  return NULL;
13  cvSetData(image, data, 640*2);
14  return image;
15 }
16 
17 IplImage *freenect_sync_get_rgb_cv(int index)
18 {
19  static IplImage *image = 0;
20  static char *data = 0;
21  if (!image) image = cvCreateImageHeader(cvSize(640,480), 8, 3);
22  unsigned int timestamp;
23  if (freenect_sync_get_video((void**)&data, &timestamp, index, FREENECT_VIDEO_RGB))
24  return NULL;
25  cvSetData(image, data, 640*3);
26  return image;
27 }
int freenect_sync_get_depth(void **depth, uint32_t *timestamp, int index, freenect_depth_format fmt)
IplImage * freenect_sync_get_rgb_cv(int index)
IplImage * freenect_sync_get_depth_cv(int index)
Definition: libfreenect_cv.c:5
int freenect_sync_get_video(void **video, uint32_t *timestamp, int index, freenect_video_format fmt)


libfreenect
Author(s): Hector Martin, Josh Blake, Kyle Machulis, OpenKinect community
autogenerated on Mon Jun 10 2019 13:46:42