23 #include <fvutils/writers/jpeg.h>
24 #include <fvutils/readers/fvraw.h>
25 #include <fvutils/color/conversions.h>
27 #include <fvstereo/triclops.h>
33 #include <sys/types.h>
39 using namespace fawkes;
40 using namespace firevision;
43 main(
int argc,
char **argv)
47 printf(
"Usage: %s <image> <triclops_context>\n", argv[0]);
51 const char *file = argv[1];
52 const char *context_file = argv[2];
55 asprintf(&outfile,
"%s.jpg", file);
66 printf(
"Can only operate on RAW16 images!\n");
72 printf(
"Calculating disparity for %s to %s\n", file, outfile);
73 printf(
"Using Triclops context file %s\n", context_file);
75 unsigned char *raw16 = malloc_buffer(RAW16, width, height);
76 unsigned char *yuv422_planar = malloc_buffer(YUV422_PLANAR, width, height);
89 memset(yuv422_planar + width * height, 128, width * height);
91 jpeg->
set_buffer(YUV422_PLANAR, yuv422_planar);