|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
24 # include <WIN_camera.h>
67 if (!prop.
check(
"pixelType")) {
79 if (!os_device->open(prop)) {
84 os_device->view(deviceRgb);
85 os_device->view(deviceRaw);
86 os_device->view(deviceControls);
87 os_device->view(deviceTimed);
88 os_device->view(deviceRgbVisualParam);
90 if (deviceRaw !=
nullptr) {
91 _width = deviceRaw->width();
92 _height = deviceRaw->height();
95 if (deviceRgb !=
nullptr) {
96 _width = deviceRgb->width();
97 _height = deviceRgb->height();
112 if (deviceRaw !=
nullptr) {
113 return deviceRaw->width();
115 if (deviceRgb !=
nullptr) {
116 return deviceRgb->width();
124 if (deviceRaw !=
nullptr) {
125 return deviceRaw->height();
127 if (deviceRgb !=
nullptr) {
128 return deviceRgb->height();
152 if (deviceTimed !=
nullptr) {
153 return deviceTimed->getLastInputStamp();
161 if (deviceRgbVisualParam !=
nullptr) {
162 return deviceRgbVisualParam->getRgbHeight();
169 if (deviceRgbVisualParam !=
nullptr) {
170 return deviceRgbVisualParam->getRgbWidth();
178 if (deviceRgbVisualParam !=
nullptr) {
179 return deviceRgbVisualParam->getRgbSupportedConfigurations(configurations);
186 if (deviceRgbVisualParam !=
nullptr) {
187 return deviceRgbVisualParam->getRgbResolution(width, height);
194 if (width <= 0 || height <= 0) {
198 if (deviceRgbVisualParam !=
nullptr) {
201 return deviceRgbVisualParam->setRgbResolution(width, height);
208 if (deviceRgbVisualParam !=
nullptr) {
209 return deviceRgbVisualParam->getRgbFOV(horizontalFov, verticalFov);
216 if (deviceRgbVisualParam !=
nullptr) {
217 return deviceRgbVisualParam->setRgbFOV(horizontalFov, verticalFov);
224 if (deviceRgbVisualParam !=
nullptr) {
225 return deviceRgbVisualParam->getRgbIntrinsicParam(intrinsic);
232 if (deviceRgbVisualParam !=
nullptr) {
233 return deviceRgbVisualParam->getRgbMirroring(mirror);
240 if (deviceRgbVisualParam !=
nullptr) {
241 return deviceRgbVisualParam->setRgbMirroring(mirror);
262 if ((image.width() !=
_width) || (image.height() !=
_height)) {
271 if ((image.width() !=
_width) || (image.height() !=
_height)) {
304 if ((image.width() !=
_width) || (image.height() !=
_height)) {
bool setRgbResolution(int width, int height) override
Set the resolution of the rgb image from the camera.
void put(const std::string &key, const std::string &value)
Associate the given key with the given string.
~USBCameraDriverRaw() override
virtual bool getActive(int feature, bool *isActive)=0
Get the current status of the feature, on or off.
bool getImage(yarp::sig::ImageOf< yarp::sig::PixelRgb > &image) override
FrameGrabber image interface, returns the last acquired frame as an rgb image.
A base class for nested structures that can be searched.
yarp::dev::IFrameGrabber * deviceRaw
bool getRawBuffer(unsigned char *buffer) override
Implements FrameGrabber basic interface.
~USBCameraDriverRgb() override
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
bool setRgbFOV(double horizontalFov, double verticalFov) override
Set the field of view (FOV) of the rgb camera.
usbCamera: YARP device driver implementation for acquiring images from USB cameras.
void fromString(const std::string &txt, bool wipe=true)
Interprets a string as a list of properties.
virtual bool hasFeature(int feature, bool *hasFeature)=0
Check if camera has the requested feature (saturation, brightness ...
virtual bool getCameraDescription(CameraDescriptor *camera)=0
Get a basic description of the camera hw.
Interface implemented by all device drivers.
bool hasOnOff(int feature, bool *HasOnOff) override
Check if the camera has the ability to turn on/off the requested feature.
bool getRgbResolution(int &width, int &height) override
Get the resolution of the rgb image from the camera.
An interface for the device drivers.
virtual bool setFeature(int feature, double value)=0
Set the requested feature to a value (saturation, brightness ...
bool getRgbFOV(double &horizontalFov, double &verticalFov) override
Get the field of view (FOV) of the rgb camera.
bool getMode(int feature, FeatureMode *mode) override
Get the current mode for the feature.
virtual bool getRgbBuffer(unsigned char *buffer)=0
Get a rgb buffer from the frame grabber, if required demosaicking/color reconstruction is applied.
bool open(yarp::os::Searchable &config) override
Open the device driver.
int height() const override
Return the height of each frame.
int getRgbWidth() override
Return the width of each frame.
bool getRgbSupportedConfigurations(yarp::sig::VectorOf< yarp::dev::CameraConfig > &configurations) override
Get the possible configurations of the camera.
virtual bool setMode(int feature, FeatureMode mode)=0
Set the requested mode for the feature.
yarp::os::Stamp getLastInputStamp() override
Implements the IPreciselyTimed interface.
yarp::dev::IFrameGrabberRgb * deviceRgb
bool getImage(yarp::sig::ImageOf< yarp::sig::PixelMono > &image) override
FrameGrabber image interface, returns the last acquired frame as an rgb image.
virtual bool hasManual(int feature, bool *hasManual)=0
Check if the requested feature has the 'manual' mode.
bool setFeature(int feature, double value) override
Set the requested feature to a value (saturation, brightness ...
bool getActive(int feature, bool *isActive) override
Get the current status of the feature, on or off.
virtual bool getFeature(int feature, double *value)=0
Get the current value for the requested feature.
bool getRgbIntrinsicParam(yarp::os::Property &intrinsic) override
Get the intrinsic parameters of the rgb camera.
virtual bool getRawBuffer(unsigned char *buffer)=0
Get the raw buffer from the frame grabber.
virtual bool hasAuto(int feature, bool *hasAuto)=0
Check if the requested feature has the 'auto' mode.
int getRgbHeight() override
Return the height of each frame.
bool check(const std::string &key) const override
Check if there exists a property of the given name.
bool setOnePush(int feature) override
Set the requested feature to a value (saturation, brightness ...
bool hasManual(int feature, bool *hasManual) override
Check if the requested feature has the 'manual' mode.
bool getRgbMirroring(bool &mirror) override
Get the mirroring setting of the sensor.
int width() const override
Return the width of each frame.
define common interfaces to discover remote camera capabilities
bool hasAuto(int feature, bool *hasAuto) override
Check if the requested feature has the 'auto' mode.
bool hasFeature(int feature, bool *hasFeature) override
Check if camera has the requested feature (saturation, brightness ...
virtual bool getMode(int feature, FeatureMode *mode)=0
Get the current mode for the feature.
int getRawBufferSize() override
Implements the Frame grabber basic interface.
An abstraction for a time stamp and/or sequence number.
#define yCError(component,...)
bool close() override
Closes the device driver.
bool setActive(int feature, bool onoff) override
Set the requested feature on or off.
An interface to the operating system, including Port based communication.
bool hasOnePush(int feature, bool *hasOnePush) override
Check if the requested feature has the 'onePush' mode.
int height() const override
Return the height of each frame.
USBCameraDriver()
Constructor.
const yarp::os::LogComponent & USBCAMERA()
~USBCameraDriver() override
Destructor.
bool getFeature(int feature, double *value) override
Get the current value for the requested feature.
virtual bool hasOnePush(int feature, bool *hasOnePush)=0
Check if the requested feature has the 'onePush' mode.
int width() const override
Implements FrameGrabber basic interface.
int height() const override
Implements FrameGrabber basic interface.
virtual bool setOnePush(int feature)=0
Set the requested feature to a value (saturation, brightness ...
int width() const override
Return the width of each frame.
#define yCTrace(component,...)
yarp::dev::IFrameGrabberControls * deviceControls
bool setRgbMirroring(bool mirror) override
Set the mirroring setting of the sensor.
bool getCameraDescription(CameraDescriptor *camera) override
Implementation of IFrameGrabberControls2 interface.
bool getRgbBuffer(unsigned char *buffer) override
FrameGrabber bgr interface, returns the last acquired frame as a buffer of bgr triplets.
virtual bool hasOnOff(int feature, bool *HasOnOff)=0
Check if the camera has the ability to turn on/off the requested feature.
virtual bool setActive(int feature, bool onoff)=0
Set the requested feature on or off.
bool setMode(int feature, FeatureMode mode) override
Set the requested mode for the feature.
A class for storing options and configuration information.