orca-robotics


INTRODUCTION
Overview
Download and Install
Quick Start
Documentation
Publications

REPOSITORY
Interfaces
Components
Libraries
Utilities
Software Map

DEVELOPER
Tutorials
Examples
Dev Guide
Dashboard
Wiki
login/pass: orca/orca

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

cvgrabber.h

00001 /*
00002  * Orca-Robotics Project: Components for robotics 
00003  *               http://orca-robotics.sf.net/
00004  * Copyright (c) 2004-2008 Alex Brooks, Ben Upcroft
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 #ifndef ORCA_CV_GRABBER_H
00011 #define ORCA_CV_GRABBER_H
00012 
00013 #include "imagegrabber.h"
00014 #include <cv.h>
00015 #include <highgui.h>
00016 
00017 namespace orcaimage {
00018 
00019 /*
00020 @brief OpenCv implementation for grabbing images. 
00021 
00022 @author Ben Upcroft b.upcroft at cas.edu.au
00023 */
00024 
00025     class CvGrabber : public ImageGrabber
00026     {
00027         
00028     public:
00029         CvGrabber( int cameraIndex, const orcaice::Context& context );
00030         virtual ~CvGrabber();
00031 
00032         // grabs frame from camera 
00033         virtual int grabFrame();
00034         // load the raw image data grabbed from grabFrame() into a byte array 
00035         virtual char* retrieveFrame();
00036         // grabFrame() and retrieveFrame() in one. You should normally call
00037         // this function rather than the other two directly.
00038         virtual char* queryFrame();
00039 
00040         // get and set properties that can be called for an opencv capture frame
00041         virtual int format() const;
00042         virtual void setFormat( int format );
00043         virtual int mode() const;
00044         virtual void setMode( int mode );
00045         virtual double fps() const; // frames per second
00046         virtual void setFps( double fps );
00047 
00048         // these set functions work for both v4l and dc_1394 but the
00049         // get functions only work for v4l
00050         virtual double brightness() const;
00051         virtual void setBrightness( double brightness );
00052         virtual double contrast() const;
00053         virtual void setContrast( double contrast );
00054         virtual double saturation() const;
00055         virtual void setSaturation( double saturation );
00056         virtual double hue() const;
00057         virtual void setHue( double hue );
00058         virtual double gain() const;
00059         virtual void setGain( double gain );
00060 
00061         // implemented inefficient workarounds to get these to work
00062         virtual int width() const;
00063         virtual void setWidth( int width );
00064         virtual int height() const;
00065         virtual void setHeight( int height );
00066         // image size in bytes
00067         virtual int size() const;
00068 
00069         // Things that aren't implemented in opencv yet.  Probably
00070         // could take the implementations of these functions from
00071         // libcamera.
00072         virtual double zoom() const { return -1.0; };
00073         virtual void setZoom( double zoom ) {};
00074         virtual double minZoom() const { return -1.0; };
00075         virtual double maxZoom() const { return -1.0; };
00076 
00077         virtual double focus() const { return -1.0; };
00078         virtual void setFocus( double zoom ) {};
00079         virtual double minFocus() const { return -1.0; };
00080         virtual double maxFocus() const { return -1.0; };
00081 
00082         virtual double shutter() const { return -1.0; };
00083         virtual void setShutter( double zoom ) {};
00084         virtual double minShutter() const { return -1.0; };
00085         virtual double maxShutter() { return -1.0; };
00086 
00087     private:
00088         // Video capturing structure
00089         CvCapture* capture_;
00090 
00091     };
00092 
00093 }
00094 
00095 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5