YARP
Yet Another Robot Platform
yarp::sig::utils Namespace Reference

Classes

struct  PCL_ROI
 

Enumerations

enum class  OrganizationType {
  Organized ,
  Unorganized
}
 

Functions

bool vertSplit (const yarp::sig::Image &inImg, yarp::sig::Image &outImgL, yarp::sig::Image &outImgR)
 Split vertically an image in two images of the same size. More...
 
bool horzSplit (const yarp::sig::Image &inImg, yarp::sig::Image &outImgUp, yarp::sig::Image &outImgDown)
 Split horizontally an image in two images of the same size. More...
 
bool horzConcat (const yarp::sig::Image &inImgL, const yarp::sig::Image &inImgR, yarp::sig::Image &outImg)
 Concatenate horizontally two images of the same size in one with double width. More...
 
bool vertConcat (const yarp::sig::Image &inImgUp, const yarp::sig::Image &inImgDown, yarp::sig::Image &outImg)
 Concatenate vertically two images of the same size in one with double height. More...
 
bool cropRect (const yarp::sig::Image &inImg, const std::pair< unsigned int, unsigned int > &vertex1, const std::pair< unsigned int, unsigned int > &vertex2, yarp::sig::Image &outImg)
 Crop a rectangle area out of an image given two opposite vertices. More...
 
yarp::sig::PointCloud< yarp::sig::DataXYZdepthToPC (const yarp::sig::ImageOf< yarp::sig::PixelFloat > &depth, const yarp::sig::IntrinsicParams &intrinsic)
 depthToPC, compute the PointCloud given depth image and the intrinsic parameters of the camera. More...
 
yarp::sig::PointCloud< yarp::sig::DataXYZdepthToPC (const yarp::sig::ImageOf< yarp::sig::PixelFloat > &depth, const yarp::sig::IntrinsicParams &intrinsic, const yarp::sig::utils::PCL_ROI &roi, size_t step_x, size_t step_y)
 depthToPC, compute the PointCloud given depth image, the intrinsic parameters of the camera and a Region Of Interest. More...
 
template<typename T1 , typename T2 >
yarp::sig::PointCloud< T1 > depthRgbToPC (const yarp::sig::ImageOf< yarp::sig::PixelFloat > &depth, const yarp::sig::ImageOf< T2 > &color, const yarp::sig::IntrinsicParams &intrinsic, const yarp::sig::utils::OrganizationType organizationType=yarp::sig::utils::OrganizationType::Organized)
 depthRgbToPC, compute the colored PointCloud given depth image, color image and the intrinsic parameters of the camera. More...
 

Enumeration Type Documentation

◆ OrganizationType

Enumerator
Organized 
Unorganized 

Definition at line 15 of file PointCloudUtils.h.

Function Documentation

◆ cropRect()

bool yarp::sig::utils::cropRect ( const yarp::sig::Image inImg,
const std::pair< unsigned int, unsigned int > &  vertex1,
const std::pair< unsigned int, unsigned int > &  vertex2,
yarp::sig::Image outImg 
)

Crop a rectangle area out of an image given two opposite vertices.

Parameters
[in]inImginput image.
[in]vertex1first vertex of the crop rectangle area.
[in]vertex2second vertex of the crop rectangle area.
[out]outImgresult of cropping the input image.
Note
Input and output images must have same pixel type and the crop area must lay within the input image. Vertices needn't be passed in the usual top-left, bottom-right order. The output image is resized to match the crop dimensions.
Returns
true on success, false otherwise.

Definition at line 113 of file ImageUtils.cpp.

◆ depthRgbToPC()

template<typename T1 , typename T2 >
yarp::sig::PointCloud< T1 > yarp::sig::utils::depthRgbToPC ( const yarp::sig::ImageOf< yarp::sig::PixelFloat > &  depth,
const yarp::sig::ImageOf< T2 > &  color,
const yarp::sig::IntrinsicParams intrinsic,
const yarp::sig::utils::OrganizationType  organizationType = yarp::sig::utils::OrganizationType::Organized 
)

depthRgbToPC, compute the colored PointCloud given depth image, color image and the intrinsic parameters of the camera.

Parameters
[in]depth,theinput depth image.
[in]color,theinput color image.
[in]intrinsic,intrinsicparameter of the camera.
Note
the intrinsic parameters are the one of the depth sensor if the depth frame IS NOT aligned with the colored one. On the other hand use the intrinsic parameters of the RGB camera if the frames are aligned.
Returns
the pointcloud obtained by the de-projection.

Definition at line 65 of file PointCloudUtils-inl.h.

◆ depthToPC() [1/2]

PointCloud< DataXYZ > yarp::sig::utils::depthToPC ( const yarp::sig::ImageOf< yarp::sig::PixelFloat > &  depth,
const yarp::sig::IntrinsicParams intrinsic 
)

depthToPC, compute the PointCloud given depth image and the intrinsic parameters of the camera.

Parameters
[in]depth,theinput depth image.
[in]intrinsic,intrinsicparameter of the camera.
Note
the intrinsic parameters are the one of the depth sensor if the depth frame IS NOT aligned with the colored one. On the other hand use the intrinsic parameters of the RGB camera if the frames are aligned.
Returns
the pointcloud obtained by the de-projection.

Definition at line 16 of file PointCloudUtils.cpp.

◆ depthToPC() [2/2]

PointCloud< DataXYZ > yarp::sig::utils::depthToPC ( const yarp::sig::ImageOf< yarp::sig::PixelFloat > &  depth,
const yarp::sig::IntrinsicParams intrinsic,
const yarp::sig::utils::PCL_ROI roi,
size_t  step_x,
size_t  step_y 
)

depthToPC, compute the PointCloud given depth image, the intrinsic parameters of the camera and a Region Of Interest.

Parameters
[in]depth,theinput depth image.
[in]intrinsic,intrinsicparameter of the camera.
[in]roi,theRegion Of Interest intrinsic of the depth image that we want to convert.
[in]step_x,thedepth image size can be decimated, by selecting a column every step_x;
[in]step_t,thedepth image size can be decimated, by selecting a row every step_y;
Note
the intrinsic parameters are the one of the depth sensor if the depth frame IS NOT aligned with the colored one. On the other hand use the intrinsic parameters of the RGB camera if the frames are aligned.
Returns
the pointcloud obtained by the de-projection.

Definition at line 40 of file PointCloudUtils.cpp.

◆ horzConcat()

bool yarp::sig::utils::horzConcat ( const yarp::sig::Image inImgL,
const yarp::sig::Image inImgR,
yarp::sig::Image outImg 
)

Concatenate horizontally two images of the same size in one with double width.

Parameters
[in]inImgLinput left image.
[in]inImgRinput right image.
[out]outImgresult of the horizontal concatenation.
Note
The input images must have same dimensions and pixel type, and the output image must have same height and double width.
Returns
true on success, false otherwise.

Definition at line 67 of file ImageUtils.cpp.

◆ horzSplit()

bool yarp::sig::utils::horzSplit ( const yarp::sig::Image inImg,
yarp::sig::Image outImgUp,
yarp::sig::Image outImgDown 
)

Split horizontally an image in two images of the same size.

Parameters
[in]inImgimage to be horizontally split.
[out]outImgUptop half of inImg.
[out]outImgDownbottom half of inImg.
Note
The input image must have same height, double width of the output images and same pixel type.
Returns
true on success, false otherwise.

Definition at line 50 of file ImageUtils.cpp.

◆ vertConcat()

bool yarp::sig::utils::vertConcat ( const yarp::sig::Image inImgUp,
const yarp::sig::Image inImgDown,
yarp::sig::Image outImg 
)

Concatenate vertically two images of the same size in one with double height.

Parameters
[in]inImgUpinput top image.
[in]inImgDowninput bottom image.
[out]outImgresult of the horizontal concatenation.
Note
The input images must have same dimensions and pixel type, and the output image must have same width and double height.
Returns
true on success, false otherwise.

Definition at line 98 of file ImageUtils.cpp.

◆ vertSplit()

bool yarp::sig::utils::vertSplit ( const yarp::sig::Image inImg,
yarp::sig::Image outImgL,
yarp::sig::Image outImgR 
)

Split vertically an image in two images of the same size.

Parameters
[in]inImgimage to be vertically split.
[out]outImgLleft half of inImg.
[out]outImgRright half of inImg.
Note
The input image must have same height, double width of the output images and same pixel type.
Returns
true on success, false otherwise.

Definition at line 23 of file ImageUtils.cpp.