ALVisionExtractor is a generic vision extractor. More...
#include <alvision/alvisionextractor.h>
Public Member Functions | |
ALVisionExtractor (boost::shared_ptr< ALBroker > pBroker, const std::string &pName, int resolution=kQVGA, int colorspace=kBGRColorSpace, int framerate=30) | |
Create a generic vision extractor. | |
bool | setColorSpace (const int &colorSpace) |
Sets processed image colorspace on the fly. | |
bool | setFrameRate (const int &framerate) |
Sets extractor framerate on the fly. | |
bool | setResolution (const int &resolution) |
Sets processed image resolution on the fly. | |
bool | setActiveCamera (const int &cameraId) |
Sets the camera from which the image is taken. | |
int | getColorSpace () |
int | getFrameRate () |
int | getResolution () |
int | getActiveCamera () |
bool | isPaused () |
bool | isProcessing () |
QI_API_DEPRECATED void | setParameter (const std::string ¶mName, const ALValue ¶mValue) |
Set parameter value for resolution and pause. | |
virtual void | start ()=0 |
Method which will be called before each subscription to the extractor. | |
virtual void | process (ALImage *img)=0 |
Method which will be called each time the extractor gets an image. | |
void | pause (const bool &paused) |
Pause the extractor, without calling the stop method. | |
virtual void | stop ()=0 |
Method which will be called when the module is unsubscribed. |
ALVisionExtractor is a generic vision extractor.
ALVisionExtractor is an extractor dedicated to vision processing. It retrieves images from one of NAO's cameras, and gives them as input to a callback method process(). This method will be called each time an image is retrieved.
The parameters concerning the image retrieval (resolution, colorspace, camera and framerate) can be set either at the construction (which is recommended) if you do not have to change them, or on the fly using dedicated method.
Definition at line 36 of file alvisionextractor.h.
AL::ALVisionExtractor::ALVisionExtractor | ( | boost::shared_ptr< ALBroker > | pBroker, |
const std::string & | pName, | ||
int | resolution = kQVGA , |
||
int | colorspace = kBGRColorSpace , |
||
int | framerate = 30 |
||
) |
Create a generic vision extractor.
resolution | Resolution of the images the extractor will process at module startup. Default value is 1 (QVGA resolution). |
colorspace | Colorspace of the images the extractor will process at module startup. Default value is BGR colorspace. |
framerate | Framerate of the images the extractor will process at module startup. Default value is 30. |
void AL::ALVisionExtractor::pause | ( | const bool & | paused | ) |
Pause the extractor, without calling the stop method.
paused | true if the extractor must be paused, false else. |
virtual void AL::ALVisionExtractor::process | ( | ALImage * | img | ) | [pure virtual] |
Method which will be called each time the extractor gets an image.
img | Pointer to the image class, which is retrieved according to the extractor parameters (colorspace, framerate, resolution, camera). |
bool AL::ALVisionExtractor::setActiveCamera | ( | const int & | cameraId | ) |
Sets the camera from which the image is taken.
resolution | Desired camera ID. |
bool AL::ALVisionExtractor::setColorSpace | ( | const int & | colorSpace | ) |
Sets processed image colorspace on the fly.
colorspace | Desired colorspace. |
bool AL::ALVisionExtractor::setFrameRate | ( | const int & | framerate | ) |
Sets extractor framerate on the fly.
framerate | Desired extractor framerate. |
QI_API_DEPRECATED void AL::ALVisionExtractor::setParameter | ( | const std::string & | paramName, |
const ALValue & | paramValue | ||
) |
Set parameter value for resolution and pause.
paramName | Name of the parameter to set ("resolution" or "pause") |
paramValue | ALValue array of the value to be set. |
bool AL::ALVisionExtractor::setResolution | ( | const int & | resolution | ) |
Sets processed image resolution on the fly.
resolution | Desired resolution. |