35 FILE* fp = fopen(filename,
"w");
37 fprintf(stderr,
"Error: Cannot open file [%s]\n", filename);
40 printf(
"%s\n", filename);
44 void dump_depth(FILE *fp,
void *data,
unsigned int width,
unsigned int height)
46 fprintf(fp,
"P5 %u %u 65535\n", width, height);
47 fwrite(data, width * height * 2, 1, fp);
50 void dump_rgb(FILE *fp,
void *data,
unsigned int width,
unsigned int height)
52 fprintf(fp,
"P6 %u %u 255\n", width, height);
53 fwrite(data, width * height * 3, 1, fp);
58 fprintf(stderr,
"Error: Kinect not connected?\n");
74 fp =
open_dump(
"registration_test_rgb.ppm");
82 fp =
open_dump(
"registration_test_depth_raw.pgm");
90 fp =
open_dump(
"registration_test_depth_registered.pgm");
98 fp =
open_dump(
"registration_test_depth_mm.pgm");
int freenect_sync_get_depth(void **depth, uint32_t *timestamp, int index, freenect_depth_format fmt)
FILE * open_dump(const char *filename)
void no_kinect_quit(void)
void dump_rgb(FILE *fp, void *data, unsigned int width, unsigned int height)
void dump_depth(FILE *fp, void *data, unsigned int width, unsigned int height)
int freenect_sync_get_video(void **video, uint32_t *timestamp, int index, freenect_video_format fmt)