#include #include #include #include #include #include "pgr_registers.h" #include "pgr_stereocam.h" class stereoCam { public: stereoCam(); ~stereoCam(); #ifdef OPENCV void doStereoFrame(IplImage *frame, IplImage *disparity, FILE *out); #else void doStereoFrame(FILE *out); #endif private: dc1394camera_t* camera; dc1394error_t err; dc1394_t * d; dc1394camera_list_t * list; unsigned int nThisCam; PGRStereoCamera_t stereoCamera; // Allocate all the buffers. // Unfortunately color processing is a bit inefficient // because of the number of // data copies. Color data needs to be // - de-interleaved into separate bayer tile images // - color processed into RGB images // - de-interleaved to extract the green channel // for stereo (or other mono conversion) // size of buffer for all images at mono8 unsigned int nBufferSize; // allocate a buffer to hold the de-interleaved images unsigned char* pucDeInterlacedBuffer; unsigned char* pucRGBBuffer; unsigned char* pucGreenBuffer; TriclopsInput input; TriclopsError e; TriclopsContext triclops; unsigned char* pucRightRGB; unsigned char* pucLeftRGB; unsigned char* pucCenterRGB; TriclopsImage image; TriclopsImage16 image16; void cleanup_and_exit( dc1394camera_t* camera ); /* Routine from Triclops manual to print an error message */ void printTriclopsError(TriclopsError e); };