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

SourceForge.net Logo
Project
Download
Mailing lists

 

         

camerawriter.h

00001 // /*
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
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_CAMERA_WRITER_H
00012 #define ORCA_ORCALOGFACTORY_CAMERA_WRITER_H
00013 
00014 #include <orcaice/context.h>
00015 #include <orca/camera.h>
00016 #include <orcalog/logwriter.h>
00017 #include "logstringutils.h"
00018 #ifdef OPENCV_FOUND
00019     #include <cv.h>
00020 #endif
00021 
00022 namespace orcalogfactory
00023 {
00024 
00025 class CameraWriter
00026 {
00027 public:
00028     CameraWriter();
00029     virtual ~CameraWriter();
00030 
00031     //initialize the JPEG logger, allocate memory for the OpenCV image
00032     void initJpegLogWriter(const orca::CameraDescriptionPtr &descr);
00033 
00034     //Create directory to log the data
00035     void createLogDirectory(const std::string & filename);
00036 
00037     //log description
00038     void logToFile( std::ofstream *file, const std::string &format, orcaice::Context context, const orca::CameraDescriptionPtr &obj);
00039 
00040     //log data
00041     void logToFile( std::ofstream *file, const std::string &format, orcaice::Context context, const orca::ImageDataPtr &obj);
00042     
00043 private:
00044 
00045     // use opencv to convert to jpg
00046    #ifdef OPENCV_FOUND
00047         IplImage* cvImage_;
00048     #endif
00049 
00050     //Write JPEG's    
00051     void writeCameraDataAsJpeg( const orca::ImageDataPtr& data, const std::string & filename );
00052 
00053     //Count the succesive images logged
00054     int dataCounter_;
00055     //Image Size as specified by camera description
00056     int imageSize_;
00057     //Directory prefix where images will be saved
00058     std::string directoryPrefix_;
00059 
00060 };
00061 } // namespace
00062 
00063 #endif
 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5