INTRODUCTION Overview Download and Install Quick Start Documentation Publications NONFRAMEWORK CODE Driver Interfaces Drivers Libraries Utilities FRAMEWORK CODE Interfaces Components Libraries Utilities Full Software Listings DEVELOPER Tutorials Examples Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
multicamerawriter.h00001 // /* 00002 // * Orca-Robotics Project: Components for robotics 00003 // * http://orca-robotics.sf.net/ 00004 // * Copyright (c) 2004-2009 Alex Brooks, Alexei Makarenko, Tobias Kaupp, Alen Alempijevic, Michael Waren 00005 // * 00006 // * This copy of Orca is licensed to you under the terms described in 00007 // * the LICENSE file included in this distribution. 00008 // * 00009 // */ 00010 00011 #ifndef ORCA_ORCALOGFACTORY_MULTICAMERA_WRITER_H 00012 #define ORCA_ORCALOGFACTORY_MULTICAMERA_WRITER_H 00013 00014 #include <orcaice/context.h> 00015 #include <orca/multicamera.h> 00016 #include <orcalog/logwriter.h> 00017 #include <vector> 00018 #include "logstringutils.h" 00019 #ifdef OPENCV_FOUND 00020 #include <cv.h> 00021 #include <highgui.h> 00022 #endif 00023 00024 #define FOURCC_RAWRGB 0x00000000 00025 00026 namespace orcalogfactory 00027 { 00028 00029 class MultiCameraWriter 00030 { 00031 public: 00032 MultiCameraWriter(); 00033 virtual ~MultiCameraWriter(); 00034 00035 //initialize the image logger, allocate memory for the OpenCV image 00036 void initMultiImageLogWriter(const orca::MultiCameraDescriptionPtr &descr); 00037 00038 //initialize the video logger, allocate OpenCV video writers 00039 void initVideoLogWriter(const orca::MultiCameraDescriptionPtr &descr); 00040 00041 void init(const orca::MultiCameraDescriptionPtr &descr, const std::string &format); 00042 00043 //Create directory to log the data 00044 void createLogDirectory(const std::string & filename); 00045 00046 //log description 00047 void logToFile( std::ofstream *file, const std::string &format, orcaice::Context context, const orca::MultiCameraDescriptionPtr &obj); 00048 00049 //log data 00050 void logToFile( std::ofstream *file, const std::string &format, orcaice::Context context, const orca::MultiCameraDataPtr &obj); 00051 00052 private: 00053 00061 std::vector<bool> isPadded_; 00062 00065 std::vector<int32_t> orcaByteWidth_; 00066 00067 00068 #ifdef OPENCV_FOUND 00069 // Use OpenCV to store image data for writing to disk 00070 std::vector<IplImage*> cvImage_; 00071 std::vector<IplImage*> cvBayer_; 00072 // use OpenCV to write to video 00073 std::vector<CvVideoWriter*> cvVideoWriters; 00074 #endif 00075 00076 //Write JPEG's 00077 void writeCameraDataAsJpeg( const orca::MultiCameraDataPtr& data); 00078 // Write video's 00079 void writeCameraDataAsVideo( const orca::MultiCameraDataPtr& data); 00080 //Count the succesive images logged 00081 int dataCounter_; 00082 //Directory prefix where images will be saved 00083 std::string directoryPrefix_; 00084 }; 00085 } // namespace 00086 00087 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)