11 # include <WIN_camera.h>
53 if (!prop.
check(
"pixelType")) {
65 if (!os_device->open(prop)) {
70 os_device->view(frameGrabberImage);
71 os_device->view(frameGrabberImageRaw);
72 os_device->view(deviceControls);
73 os_device->view(deviceTimed);
74 os_device->view(deviceRgbVisualParam);
76 if (frameGrabberImage !=
nullptr) {
77 _width = frameGrabberImage->width();
78 _height = frameGrabberImage->height();
81 if (frameGrabberImageRaw !=
nullptr) {
82 _width = frameGrabberImageRaw->width();
83 _height = frameGrabberImageRaw->height();
98 if (frameGrabberImage !=
nullptr) {
99 return frameGrabberImage->width();
101 if (frameGrabberImageRaw !=
nullptr) {
102 return frameGrabberImageRaw->width();
110 if (frameGrabberImage !=
nullptr) {
111 return frameGrabberImage->height();
113 if (frameGrabberImageRaw !=
nullptr) {
114 return frameGrabberImageRaw->height();
122 if (deviceTimed !=
nullptr) {
123 return deviceTimed->getLastInputStamp();
131 if (deviceRgbVisualParam !=
nullptr) {
132 return deviceRgbVisualParam->getRgbHeight();
139 if (deviceRgbVisualParam !=
nullptr) {
140 return deviceRgbVisualParam->getRgbWidth();
148 if (deviceRgbVisualParam !=
nullptr) {
149 return deviceRgbVisualParam->getRgbSupportedConfigurations(configurations);
156 if (deviceRgbVisualParam !=
nullptr) {
157 return deviceRgbVisualParam->getRgbResolution(width, height);
164 if (width <= 0 || height <= 0) {
168 if (deviceRgbVisualParam !=
nullptr) {
171 return deviceRgbVisualParam->setRgbResolution(width, height);
178 if (deviceRgbVisualParam !=
nullptr) {
179 return deviceRgbVisualParam->getRgbFOV(horizontalFov, verticalFov);
186 if (deviceRgbVisualParam !=
nullptr) {
187 return deviceRgbVisualParam->setRgbFOV(horizontalFov, verticalFov);
194 if (deviceRgbVisualParam !=
nullptr) {
195 return deviceRgbVisualParam->getRgbIntrinsicParam(intrinsic);
202 if (deviceRgbVisualParam !=
nullptr) {
203 return deviceRgbVisualParam->getRgbMirroring(mirror);
210 if (deviceRgbVisualParam !=
nullptr) {
211 return deviceRgbVisualParam->setRgbMirroring(mirror);
const yarp::os::LogComponent & USBCAMERA()
int height() const override
Return the height of each frame.
~USBCameraDriverRaw() override
int width() const override
Return the width of each frame.
bool getImage(yarp::sig::ImageOf< yarp::sig::PixelMono > &image) override
FrameGrabber image interface, returns the last acquired frame as an rgb image.
int height() const override
Return the height of each frame.
bool getImage(yarp::sig::ImageOf< yarp::sig::PixelRgb > &image) override
FrameGrabber image interface, returns the last acquired frame as an rgb image.
~USBCameraDriverRgb() override
int width() const override
Return the width of each frame.
usbCamera: YARP device driver implementation for acquiring images from USB cameras.
bool setFeature(int feature, double value) override
Set the requested feature to a value (saturation, brightness ...
bool getRgbResolution(int &width, int &height) override
Get the resolution of the rgb image from the camera.
yarp::dev::IFrameGrabberImage * frameGrabberImage
int getRgbWidth() override
Return the width of each frame.
bool hasOnePush(int feature, bool *hasOnePush) override
Check if the requested feature has the 'onePush' mode.
USBCameraDriver()
Constructor.
bool getFeature(int feature, double *value) override
Get the current value for the requested feature.
int getRgbHeight() override
Return the height of each frame.
bool hasOnOff(int feature, bool *HasOnOff) override
Check if the camera has the ability to turn on/off the requested feature.
bool setRgbMirroring(bool mirror) override
Set the mirroring setting of the sensor.
~USBCameraDriver() override
Destructor.
bool close() override
Closes the device driver.
bool hasAuto(int feature, bool *hasAuto) override
Check if the requested feature has the 'auto' mode.
bool getActive(int feature, bool *isActive) override
Get the current status of the feature, on or off.
bool open(yarp::os::Searchable &config) override
Open the device driver.
bool getRgbMirroring(bool &mirror) override
Get the mirroring setting of the sensor.
bool setRgbResolution(int width, int height) override
Set the resolution of the rgb image from the camera.
bool getMode(int feature, FeatureMode *mode) override
Get the current mode for the feature.
bool getRgbSupportedConfigurations(yarp::sig::VectorOf< yarp::dev::CameraConfig > &configurations) override
Get the possible configurations of the camera.
bool hasFeature(int feature, bool *hasFeature) override
Check if camera has the requested feature (saturation, brightness ...
yarp::dev::IFrameGrabberImageRaw * frameGrabberImageRaw
bool setMode(int feature, FeatureMode mode) override
Set the requested mode for the feature.
bool getRgbIntrinsicParam(yarp::os::Property &intrinsic) override
Get the intrinsic parameters of the rgb camera.
bool setOnePush(int feature) override
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 hasManual(int feature, bool *hasManual) override
Check if the requested feature has the 'manual' mode.
yarp::os::Stamp getLastInputStamp() override
Implements the IPreciselyTimed interface.
bool setActive(int feature, bool onoff) override
Set the requested feature on or off.
bool getCameraDescription(CameraDescriptor *camera) override
Implementation of IFrameGrabberControls2 interface.
yarp::dev::IFrameGrabberControls * deviceControls
bool setRgbFOV(double horizontalFov, double verticalFov) override
Set the field of view (FOV) of the rgb camera.
Interface implemented by all device drivers.
virtual bool setFeature(int feature, double value)=0
Set the requested feature to a value (saturation, brightness ...
virtual bool setOnePush(int feature)=0
Set the requested feature to a value (saturation, brightness ...
virtual bool getFeature(int feature, double *value)=0
Get the current value for the requested feature.
virtual bool hasManual(int feature, bool *hasManual)=0
Check if the requested feature has the 'manual' mode.
virtual bool setMode(int feature, FeatureMode mode)=0
Set the requested mode for the feature.
virtual bool hasOnOff(int feature, bool *HasOnOff)=0
Check if the camera has the ability to turn on/off the requested feature.
virtual bool hasAuto(int feature, bool *hasAuto)=0
Check if the requested feature has the 'auto' mode.
virtual bool getMode(int feature, FeatureMode *mode)=0
Get the current mode for the feature.
virtual bool getCameraDescription(CameraDescriptor *camera)=0
Get a basic description of the camera hw.
virtual bool getActive(int feature, bool *isActive)=0
Get the current status of the feature, on or off.
virtual bool setActive(int feature, bool onoff)=0
Set the requested feature on or off.
virtual bool hasFeature(int feature, bool *hasFeature)=0
Check if camera has the requested feature (saturation, brightness ...
virtual bool hasOnePush(int feature, bool *hasOnePush)=0
Check if the requested feature has the 'onePush' mode.
virtual bool getImage(ImageType &image)=0
Get an image from the frame grabber.
A class for storing options and configuration information.
void fromString(const std::string &txt, bool wipe=true)
Interprets a string as a list of properties.
void put(const std::string &key, const std::string &value)
Associate the given key with the given string.
bool check(const std::string &key) const override
Check if there exists a property of the given name.
A base class for nested structures that can be searched.
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
An abstraction for a time stamp and/or sequence number.
#define yCError(component,...)
#define yCTrace(component,...)
An interface for the device drivers.
An interface to the operating system, including Port based communication.