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> 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);
virtual void set_buffer(colorspace_t cspace, unsigned char *buffer)
Set image buffer.
virtual void set_buffer(unsigned char *yuv422planar_buffer)
Set buffer that the read image should be written to.
Fawkes library namespace.
virtual void read()
Read data from file.
virtual unsigned char * disparity_buffer()
Get the disparity image buffer.
virtual void write()
Write to file.
Base class for exceptions in Fawkes.
virtual unsigned int pixel_width()
Get width of read image in pixels.
Stereo processing using PGR Triclops SDK.
void print_trace()
Prints trace to stderr.
virtual colorspace_t colorspace()
Get colorspace from the just read image.
virtual void calculate_disparity(ROI *roi=0)
Caculate disparity images.
virtual void set_raw_buffer(unsigned char *raw16_buffer)
Set raw buffer.
virtual unsigned int pixel_height()
Get height of read image in pixels.
virtual void set_dimensions(unsigned int width, unsigned int height)
Set dimensions of image in pixels.
virtual void preprocess_stereo()
Do any pre-processing needed.
FvRaw image reader implementation.