23#include <fvstereo/triclops.h>
24#include <fvutils/color/conversions.h>
25#include <fvutils/readers/fvraw.h>
26#include <fvutils/writers/jpeg.h>
38using namespace firevision;
41main(
int argc,
char **argv)
44 printf(
"Usage: %s <image> <triclops_context>\n", argv[0]);
48 const char *file = argv[1];
49 const char *context_file = argv[2];
52 asprintf(&outfile,
"%s.jpg", file);
63 printf(
"Can only operate on RAW16 images!\n");
69 printf(
"Calculating disparity for %s to %s\n", file, outfile);
70 printf(
"Using Triclops context file %s\n", context_file);
72 unsigned char *raw16 = malloc_buffer(RAW16, width, height);
73 unsigned char *yuv422_planar = malloc_buffer(YUV422_PLANAR, width, height);
86 memset(yuv422_planar + width * height, 128, width * height);
88 jpeg->
set_buffer(YUV422_PLANAR, yuv422_planar);
Base class for exceptions in Fawkes.
void print_trace() noexcept
Prints trace to stderr.
FvRaw image reader implementation.
virtual void read()
Read data from file.
virtual unsigned int pixel_width()
Get width of read image in pixels.
virtual colorspace_t colorspace()
Get colorspace from the just read image.
virtual void set_buffer(unsigned char *yuv422planar_buffer)
Set buffer that the read image should be written to.
virtual unsigned int pixel_height()
Get height of read image in pixels.
virtual void write()
Write to file.
virtual void set_buffer(colorspace_t cspace, unsigned char *buffer)
Set image buffer.
Stereo processing using PGR Triclops SDK.
virtual void preprocess_stereo()
Do any pre-processing needed.
virtual void calculate_disparity(ROI *roi=0)
Caculate disparity images.
virtual void set_raw_buffer(unsigned char *raw16_buffer)
Set raw buffer.
virtual unsigned char * disparity_buffer()
Get the disparity image buffer.
virtual void set_dimensions(unsigned int width, unsigned int height)
Set dimensions of image in pixels.
Fawkes library namespace.