A generic interface for cameras that have both color camera as well as depth camera sensor, like kinect device. More...
#include <yarp/dev/IRGBDSensor.h>
Public Types | |
enum | RGBDSensor_status { RGBD_SENSOR_NOT_READY = 0, RGBD_SENSOR_OK_STANBY = 1, RGBD_SENSOR_OK_IN_USE = 2, RGB_SENSOR_ERROR = 3, DEPTH_SENSOR_ERROR = 4, RGBD_SENSOR_GENERIC_ERROR = 5, RGBD_SENSOR_TIMEOUT = 6 } |
Public Member Functions | |
virtual | ~IRGBDSensor () |
int | getRgbHeight () override=0 |
Return the height of each frame. More... | |
int | getRgbWidth () override=0 |
Return the width of each frame. More... | |
bool | getRgbSupportedConfigurations (yarp::sig::VectorOf< CameraConfig > &configurations) override |
Get the possible configurations of the camera. More... | |
bool | getRgbResolution (int &width, int &height) override |
Get the resolution of the rgb image from the camera. More... | |
bool | setRgbResolution (int width, int height) override=0 |
Set the resolution of the rgb image from the camera. More... | |
bool | getRgbFOV (double &horizontalFov, double &verticalFov) override=0 |
Get the field of view (FOV) of the rgb camera. More... | |
bool | setRgbFOV (double horizontalFov, double verticalFov) override=0 |
Set the field of view (FOV) of the rgb camera. More... | |
bool | getRgbIntrinsicParam (yarp::os::Property &intrinsic) override=0 |
Get the intrinsic parameters of the rgb camera. More... | |
int | getDepthHeight () override=0 |
Return the height of each frame. More... | |
int | getDepthWidth () override=0 |
Return the height of each frame. More... | |
bool | setDepthResolution (int width, int height) override=0 |
Set the resolution of the depth image from the camera. More... | |
bool | getDepthFOV (double &horizontalFov, double &verticalFov) override=0 |
Get the field of view (FOV) of the depth camera. More... | |
bool | setDepthFOV (double horizontalFov, double verticalFov) override=0 |
Set the field of view (FOV) of the depth camera. More... | |
double | getDepthAccuracy () override=0 |
Get the minimum detectable variation in distance [meter]. More... | |
bool | setDepthAccuracy (double accuracy) override=0 |
Set the minimum detectable variation in distance [meter] when possible. More... | |
bool | getDepthClipPlanes (double &nearPlane, double &farPlane) override=0 |
Get the clipping planes of the sensor. More... | |
bool | setDepthClipPlanes (double nearPlane, double farPlane) override=0 |
Set the clipping planes of the sensor. More... | |
bool | getDepthIntrinsicParam (yarp::os::Property &intrinsic) override=0 |
Get the intrinsic parameters of the depth camera. More... | |
virtual bool | getExtrinsicParam (yarp::sig::Matrix &extrinsic)=0 |
Get the extrinsic parameters from the device. More... | |
virtual std::string | getLastErrorMsg (yarp::os::Stamp *timeStamp=NULL)=0 |
Return an error message in case of error. More... | |
virtual bool | getRgbImage (yarp::sig::FlexImage &rgbImage, yarp::os::Stamp *timeStamp=NULL)=0 |
Get the rgb frame from the device. More... | |
virtual bool | getDepthImage (yarp::sig::ImageOf< yarp::sig::PixelFloat > &depthImage, yarp::os::Stamp *timeStamp=NULL)=0 |
Get the depth frame from the device. More... | |
virtual bool | getImages (yarp::sig::FlexImage &colorFrame, yarp::sig::ImageOf< yarp::sig::PixelFloat > &depthFrame, yarp::os::Stamp *colorStamp=NULL, yarp::os::Stamp *depthStamp=NULL)=0 |
Get the both the color and depth frame in a single call. More... | |
virtual RGBDSensor_status | getSensorStatus ()=0 |
Get the surrent status of the sensor, using enum type. More... | |
Public Member Functions inherited from yarp::dev::IRgbVisualParams | |
virtual | ~IRgbVisualParams () |
virtual bool | getRgbMirroring (bool &mirror)=0 |
Get the mirroring setting of the sensor. More... | |
virtual bool | setRgbMirroring (bool mirror)=0 |
Set the mirroring setting of the sensor. More... | |
Public Member Functions inherited from yarp::dev::IDepthVisualParams | |
virtual | ~IDepthVisualParams () |
virtual bool | getDepthMirroring (bool &mirror)=0 |
Get the mirroring setting of the sensor. More... | |
virtual bool | setDepthMirroring (bool mirror)=0 |
Set the mirroring setting of the sensor. More... | |
A generic interface for cameras that have both color camera as well as depth camera sensor, like kinect device.
This interface uses the existing IRgbVisualParams and IDepthVisualParams interfaces to retrieve the information about the cameras. This device extends the functionality by adding methods for getting extrinsic parameters and to actually retrieve the images. The images can be synchronized on client side by using the PortSynchronizer object. How the synch policy is implemented depends on the client device, custom policy can be used.
Definition at line 53 of file IRGBDSensor.h.
Enumerator | |
---|---|
RGBD_SENSOR_NOT_READY | |
RGBD_SENSOR_OK_STANBY | |
RGBD_SENSOR_OK_IN_USE | |
RGB_SENSOR_ERROR | |
DEPTH_SENSOR_ERROR | |
RGBD_SENSOR_GENERIC_ERROR | |
RGBD_SENSOR_TIMEOUT |
Definition at line 62 of file IRGBDSensor.h.
|
virtualdefault |
|
overridepure virtual |
Get the minimum detectable variation in distance [meter].
Implements yarp::dev::IDepthVisualParams.
Implemented in RGBDSensorFromRosTopic, RGBDSensorClient, fakeDepthCameraDriver, and depthCameraDriver.
|
overridepure virtual |
Get the clipping planes of the sensor.
nearPlane | minimum distance at which the sensor start measuring. Object closer than this distance will not be detected. |
farPlane | maximum distance beyond which the sensor stop measuring. Object farther than this distance will not be detected. |
Implements yarp::dev::IDepthVisualParams.
Implemented in RGBDSensorFromRosTopic, fakeDepthCameraDriver, depthCameraDriver, and RGBDSensorClient.
|
overridepure virtual |
Get the field of view (FOV) of the depth camera.
horizontalFov | will return the value of the horizontal fov in degrees |
verticalFov | will return the value of the vertical fov in degrees |
Implements yarp::dev::IDepthVisualParams.
Implemented in RGBDSensorFromRosTopic, RGBDSensorClient, fakeDepthCameraDriver, and depthCameraDriver.
|
overridepure virtual |
Return the height of each frame.
Implements yarp::dev::IDepthVisualParams.
Implemented in RGBDSensorFromRosTopic, RGBDSensorClient, fakeDepthCameraDriver, and depthCameraDriver.
|
pure virtual |
Get the depth frame from the device.
depthImage | the depth image to be filled, depth measured in meters. |
timeStamp | time in which the image was acquired. Optional, ignored if nullptr. |
Implemented in RGBDSensorClient.
|
overridepure virtual |
Get the intrinsic parameters of the depth camera.
intrinsic | return a Property containing intrinsic parameters of the optical model of the camera. |
The yarp::os::Property describing the intrinsic parameters is expected to be in the form:
Parameter name | SubParameter | Type | Units | Default Value | Required | Description | Notes |
---|---|---|---|---|---|---|---|
physFocalLength | - | double | m | - | Yes | Physical focal length of the lens in meters | |
focalLengthX | - | double | pixel | - | Yes | Horizontal component of the focal length as a multiple of pixel width | |
focalLengthY | - | double | pixel | - | Yes | Vertical component of the focal length as a multiple of pixel height | |
principalPointX | - | double | pixel | - | Yes | X coordinate of the principal point | |
principalPointY | - | double | pixel | - | Yes | Y coordinate of the principal point | |
retificationMatrix | - | 4x4 double matrix | - | - | Yes | Matrix that describes the lens' distortion | |
distortionModel | - | string | - | - | Yes | Reference to group of parameters describing the distortion model of the camera, example 'cameraDistortionModelGroup' | This is another group's name to be searched for in the config file |
cameraDistortionModelGroup | |||||||
name | string | - | - | Yes | Name of the distortion model, see notes | right now only 'plumb_bob' is supported | |
k1 | double | - | - | Yes | Radial distortion coefficient of the lens | ||
k2 | double | - | - | Yes | Radial distortion coefficient of the lens | ||
k3 | double | - | - | Yes | Radial distortion coefficient of the lens | ||
t1 | double | - | - | Yes | Tangential distortion of the lens | ||
t2 | double | - | - | Yes | Tangential distortion of the lens |
Implements yarp::dev::IDepthVisualParams.
Implemented in RGBDSensorClient, RGBDSensorFromRosTopic, fakeDepthCameraDriver, and depthCameraDriver.
|
overridepure virtual |
Return the height of each frame.
Implements yarp::dev::IDepthVisualParams.
Implemented in RGBDSensorFromRosTopic, RGBDSensorClient, fakeDepthCameraDriver, and depthCameraDriver.
|
pure virtual |
Get the extrinsic parameters from the device.
extrinsic | return a rototranslation matrix describing the position of the depth optical frame with respect to the rgb frame |
Implemented in RGBDSensorFromRosTopic, RGBDSensorClient, fakeDepthCameraDriver, and depthCameraDriver.
|
pure virtual |
Get the both the color and depth frame in a single call.
Implementation should assure the best possible synchronization is achieved accordingly to synch policy set by the user. TimeStamps are referred to acquisition time of the corresponding piece of information. If the device is not providing TimeStamps, then 'timeStamp' field should be set to '-1'.
colorFrame | pointer to FlexImage data to hold the color frame from the sensor |
depthFrame | pointer to FlexImage data to hold the depth frame from the sensor |
colorStamp | pointer to memory to hold the Stamp of the color frame |
depthStamp | pointer to memory to hold the Stamp of the depth frame |
Implemented in RGBDSensorClient.
|
pure virtual |
Return an error message in case of error.
For debugging purpose and user notification. Error message will be reset after any successful command
Implemented in RGBDSensorClient, RGBDSensorFromRosTopic, fakeDepthCameraDriver, and depthCameraDriver.
|
overridepure virtual |
Get the field of view (FOV) of the rgb camera.
horizontalFov | will return the value of the horizontal fov in degrees |
verticalFov | will return the value of the vertical fov in degrees |
Implements yarp::dev::IRgbVisualParams.
Implemented in RGBDSensorFromRosTopic, RGBDSensorClient, fakeDepthCameraDriver, and depthCameraDriver.
|
overridepure virtual |
Return the height of each frame.
Implements yarp::dev::IRgbVisualParams.
Implemented in RGBDSensorFromRosTopic, RGBDSensorClient, fakeDepthCameraDriver, and depthCameraDriver.
|
pure virtual |
Get the rgb frame from the device.
The pixel type of the source image will usually be set as a VOCAB_PIXEL_RGB, but the user can call the function with the pixel type of his/her choice. The conversion if possible, will be done automatically on client side (TO BO VERIFIED). Note: this will consume CPU power because it will not use GPU optimization. Use VOCAB_PIXEL_RGB for best performances.
rgbImage | the image to be filled. |
timeStamp | time in which the image was acquired. Optional, ignored if nullptr. |
Implemented in RGBDSensorClient, RGBDSensorFromRosTopic, fakeDepthCameraDriver, and depthCameraDriver.
|
overridepure virtual |
Get the intrinsic parameters of the rgb camera.
intrinsic | return a Property containing intrinsic parameters of the optical model of the camera. |
The yarp::os::Property describing the intrinsic parameters is expected to be in the form:
Parameter name | SubParameter | Type | Units | Default Value | Required | Description | Notes |
---|---|---|---|---|---|---|---|
physFocalLength | - | double | m | - | Yes | Physical focal length of the lens in meters | |
focalLengthX | - | double | pixel | - | Yes | Horizontal component of the focal length as a multiple of pixel width | |
focalLengthY | - | double | pixel | - | Yes | Vertical component of the focal length as a multiple of pixel height | |
principalPointX | - | double | pixel | - | Yes | X coordinate of the principal point | |
principalPointY | - | double | pixel | - | Yes | Y coordinate of the principal point | |
retificationMatrix | - | 4x4 double matrix | - | - | Yes | Matrix that describes the lens' distortion | |
distortionModel | - | string | - | - | Yes | Reference to group of parameters describing the distortion model of the camera, example 'cameraDistortionModelGroup' | This is another group's name to be searched for in the config file |
cameraDistortionModelGroup | |||||||
name | string | - | - | Yes | Name of the distortion model, see notes | right now only 'plumb_bob' is supported | |
k1 | double | - | - | Yes | Radial distortion coefficient of the lens | ||
k2 | double | - | - | Yes | Radial distortion coefficient of the lens | ||
k3 | double | - | - | Yes | Radial distortion coefficient of the lens | ||
t1 | double | - | - | Yes | Tangential distortion of the lens | ||
t2 | double | - | - | Yes | Tangential distortion of the lens |
Implements yarp::dev::IRgbVisualParams.
Implemented in RGBDSensorClient, RGBDSensorFromRosTopic, fakeDepthCameraDriver, and depthCameraDriver.
|
inlineoverridevirtual |
Get the resolution of the rgb image from the camera.
width | image width |
height | image height |
Reimplemented from yarp::dev::IRgbVisualParams.
Reimplemented in RGBDSensorFromRosTopic, RGBDSensorClient, fakeDepthCameraDriver, and depthCameraDriver.
Definition at line 81 of file IRGBDSensor.h.
|
inlineoverridevirtual |
Get the possible configurations of the camera.
configurations | list of camera supported configurations as CameraConfig type |
Reimplemented from yarp::dev::IRgbVisualParams.
Reimplemented in RGBDSensorFromRosTopic, RGBDSensorClient, fakeDepthCameraDriver, and depthCameraDriver.
Definition at line 80 of file IRGBDSensor.h.
|
overridepure virtual |
Return the width of each frame.
Implements yarp::dev::IRgbVisualParams.
Implemented in RGBDSensorFromRosTopic, RGBDSensorClient, fakeDepthCameraDriver, and depthCameraDriver.
|
pure virtual |
Get the surrent status of the sensor, using enum type.
Implemented in RGBDSensorFromRosTopic, RGBDSensorClient, fakeDepthCameraDriver, and depthCameraDriver.
|
overridepure virtual |
Set the minimum detectable variation in distance [meter] when possible.
the | desired resolution in meters. |
Implements yarp::dev::IDepthVisualParams.
Implemented in RGBDSensorFromRosTopic, RGBDSensorClient, fakeDepthCameraDriver, and depthCameraDriver.
|
overridepure virtual |
Set the clipping planes of the sensor.
nearPlane | minimum distance at which the sensor start measuring. Object closer than this distance will not be detected. |
farPlane | maximum distance beyond which the sensor stop measuring. Object farther than this distance will not be detected. |
Implements yarp::dev::IDepthVisualParams.
Implemented in RGBDSensorFromRosTopic, fakeDepthCameraDriver, depthCameraDriver, and RGBDSensorClient.
|
overridepure virtual |
Set the field of view (FOV) of the depth camera.
horizontalFov | will set the value of the horizontal fov in degrees |
verticalFov | will set the value of the vertical fov in degrees |
Implements yarp::dev::IDepthVisualParams.
Implemented in RGBDSensorFromRosTopic, RGBDSensorClient, fakeDepthCameraDriver, and depthCameraDriver.
|
overridepure virtual |
Set the resolution of the depth image from the camera.
width | image width |
height | image height |
Implements yarp::dev::IDepthVisualParams.
Implemented in RGBDSensorFromRosTopic, RGBDSensorClient, fakeDepthCameraDriver, and depthCameraDriver.
|
overridepure virtual |
Set the field of view (FOV) of the rgb camera.
horizontalFov | will set the value of the horizontal fov in degrees |
verticalFov | will set the value of the vertical fov in degrees |
Implements yarp::dev::IRgbVisualParams.
Implemented in RGBDSensorFromRosTopic, RGBDSensorClient, fakeDepthCameraDriver, and depthCameraDriver.
|
overridepure virtual |
Set the resolution of the rgb image from the camera.
width | image width |
height | image height |
Implements yarp::dev::IRgbVisualParams.
Implemented in RGBDSensorFromRosTopic, RGBDSensorClient, fakeDepthCameraDriver, and depthCameraDriver.