- Aldebaran documentation |
- C++ Libraries |
- index

libalvision 2.8.7.4

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Friends Macros Pages
alvisionextractor.h
Go to the documentation of this file.
1
7 #ifndef ALVISIONEXTRACTOR_H
8 #define ALVISIONEXTRACTOR_H
9
10 #include <alvision/alvisiondefinitions.h>
11 #include <alvision/alimage.h>
12 #include <alcommon/albroker.h>
13 #include <alextractor/alextractor.h>
14 #include <qi/macro.hpp>
15
16 namespace AL {
17
18 class ALValue;
19 class ALVideoDeviceProxy;
20 class ALVisionExtractorPrivate;
21
37 class ALVisionExtractor : public ALExtractor {
38
39 public:
53 ALVisionExtractor(boost::shared_ptr<ALBroker> pBroker,
54 const std::string& pName,
55 int resolution=kQVGA, int colorspace=kBGRColorSpace,
56 int framerate=30, int activecamera=-1);
57
58 virtual ~ALVisionExtractor();
59
65 virtual bool setColorSpace(const int& colorSpace);
66
72 virtual bool setFrameRate(const int& framerate);
73 virtual bool setFrameRate(const std::string &pSubscribedName,
74 const int& framerate);
75
81 virtual bool setResolution(const int& resolution);
82
88 virtual bool setActiveCamera(const int& cameraId);
89
90 boost::shared_ptr<AL::ALVideoDeviceProxy> getVideoDeviceProxy();
91
92 int getColorSpace();
93
94 int getFrameRate();
95
96 int getResolution();
97
98 int getActiveCamera();
99
100 bool isPaused();
101 bool isProcessing();
102
103
110 QI_API_DEPRECATED void setParameter(const std::string& paramName,
111 const ALValue& paramValue);
112
116 virtual void start() = 0;
117
123 virtual void process(ALImage* img) = 0;
124
129 void pause(const bool& paused);
130
134 virtual void stop() = 0;
135
136 // Fix warning "hides overloaded virtual function"
137 // hidden overloaded virtual function 'AL::ALModule::stop'
138 // declared here: different number of parameters (1 vs 0)
139 using AL::ALModule::stop;
140
150 int getDefaultPeriod();
151
152
160 int getMinimumPeriod();
161
169 int getMaximumPeriod();
170
171
172 protected:
173 void xUpdateParameters(const int pPeriod, const float pPrecision);
174 void setSubscriptionParameters(const std::vector< std::pair<int, int> >& parameters);
175
176 private:
177
178 //intentionnally undefined.
179 ALVisionExtractor(const ALVisionExtractor& extractor);
180 //intentionnally undefined.
181 ALVisionExtractor& operator =(const ALVisionExtractor& extractor);
182
183 void xStartDetection(const int pPeriod, const float pPrecision);
184 void xStopDetection();
185
186 void xRun();
187
188 ALVisionExtractorPrivate* _pImpl;
189 };
190
191 } // namespace AL.
192
193 #endif // ALVISIONEXTRACTOR_H
AL::ALVisionExtractor::setResolution
virtual bool setResolution(const int &resolution)
Sets processed image resolution on the fly.
AL::ALVisionExtractor::isProcessing
bool isProcessing()
AL::ALImage
Definition: alimage.h:28
AL::ALVisionExtractor::getFrameRate
int getFrameRate()
alextractor.h
AL::kBGRColorSpace
const int kBGRColorSpace
Definition: alvisiondefinitions.h:91
AL::ALVisionExtractor::getActiveCamera
int getActiveCamera()
AL::ALVisionExtractor::xUpdateParameters
void xUpdateParameters(const int pPeriod, const float pPrecision)
AL::ALVisionExtractor::ALVisionExtractor
ALVisionExtractor(boost::shared_ptr< ALBroker > pBroker, const std::string &pName, int resolution=kQVGA, int colorspace=kBGRColorSpace, int framerate=30, int activecamera=-1)
Create a generic vision extractor.
alvisiondefinitions.h
vision defines
AL::ALVisionExtractor::getMinimumPeriod
int getMinimumPeriod()
This method overrides the method inherited from ALExtractor. It computes the minimum period from the ...
AL::kQVGA
const int kQVGA
Definition: alvisiondefinitions.h:53
AL::ALVisionExtractor::getColorSpace
int getColorSpace()
AL::ALVisionExtractor
ALVisionExtractor is a generic vision extractor.
Definition: alvisionextractor.h:37
AL::ALVisionExtractor::start
virtual void start()=0
Method which will be called before each subscription to the extractor.
alimage.h
handle image
AL::ALVisionExtractor::setSubscriptionParameters
void setSubscriptionParameters(const std::vector< std::pair< int, int > > &parameters)
AL::ALVisionExtractor::process
virtual void process(ALImage *img)=0
Method which will be called each time the extractor gets an image.
AL::ALVisionExtractor::~ALVisionExtractor
virtual ~ALVisionExtractor()
AL::ALVisionExtractor::getDefaultPeriod
int getDefaultPeriod()
This method overrides the method inherited from ALExtractor. It computes the default period from the ...
AL::ALVisionExtractor::setParameter
QI_API_DEPRECATED void setParameter(const std::string &paramName, const ALValue &paramValue)
Set parameter value for resolution and pause.
AL::ALVisionExtractor::setActiveCamera
virtual bool setActiveCamera(const int &cameraId)
Sets the camera from which the image is taken.
AL::ALVisionExtractor::setFrameRate
virtual bool setFrameRate(const int &framerate)
Sets extractor framerate on the fly.
AL::ALVisionExtractor::setColorSpace
virtual bool setColorSpace(const int &colorSpace)
Sets processed image colorspace on the fly.
AL::ALVisionExtractor::getMaximumPeriod
int getMaximumPeriod()
This method overrides the method inherited from ALExtractor. It computes the maximum period from the ...
AL::ALVisionExtractor::getResolution
int getResolution()
AL::ALVisionExtractor::pause
void pause(const bool &paused)
Pause the extractor, without calling the stop method.
AL::ALVisionExtractor::getVideoDeviceProxy
boost::shared_ptr< AL::ALVideoDeviceProxy > getVideoDeviceProxy()
AL::ALVisionExtractor::isPaused
bool isPaused()
AL::ALExtractor
AL::ALVisionExtractor::stop
virtual void stop()=0
Method which will be called when the module is unsubscribed.