Visual Servoing Platform
version 3.0.0
|
#include <visp3/core/vpImageTools.h>
Public Member Functions | |
template<> | |
void | binarise (vpImage< unsigned char > &I, unsigned char threshold1, unsigned char threshold2, unsigned char value1, unsigned char value2, unsigned char value3, const bool useLUT) |
Static Public Member Functions | |
template<class Type > | |
static void | createSubImage (const vpImage< Type > &I, unsigned int i_sub, unsigned int j_sub, unsigned int nrow_sub, unsigned int ncol_sub, vpImage< Type > &S) |
template<class Type > | |
static void | createSubImage (const vpImage< Type > &I, const vpRect &rect, vpImage< Type > &S) |
template<class Type > | |
static void | binarise (vpImage< Type > &I, Type threshold1, Type threshold2, Type value1, Type value2, Type value3, const bool useLUT=false) |
static void | changeLUT (vpImage< unsigned char > &I, unsigned char A, unsigned char newA, unsigned char B, unsigned char newB) |
template<class Type > | |
static void | undistort (const vpImage< Type > &I, const vpCameraParameters &cam, vpImage< Type > &newI) |
template<class Type > | |
static void | flip (const vpImage< Type > &I, vpImage< Type > &newI) |
template<class Type > | |
static void | flip (vpImage< Type > &I) |
static void | imageDifference (const vpImage< unsigned char > &I1, const vpImage< unsigned char > &I2, vpImage< unsigned char > &Idiff) |
static void | imageDifferenceAbsolute (const vpImage< unsigned char > &I1, const vpImage< unsigned char > &I2, vpImage< unsigned char > &Idiff) |
Various image tools; sub-image extraction, modification of the look up table, binarisation...
Definition at line 75 of file vpImageTools.h.
|
inlinestatic |
Binarise an image.
Definition at line 222 of file vpImageTools.h.
References vpImage< Type >::bitmap, vpImage< Type >::getHeight(), and vpImage< Type >::getWidth().
|
inline |
Binarise an image.
Definition at line 254 of file vpImageTools.h.
References vpImage< Type >::bitmap, vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), and vpImage< Type >::performLut().
|
static |
Change the look up table (LUT) of an image. Considering pixel gray level values in the range , this method allows to rescale these values in by linear interpolation:
I | : Image to process. |
A | : Low gray level value of the range to consider. |
A_star | : New gray level value to attribute to pixel who's value was A |
B | : Height gray level value of the range to consider. |
B_star | : New gray level value to attribute to pixel who's value was B |
vpImageException::incorrectInitializationError | If . |
As shown in the example below, this method can be used to binarize an image. For an unsigned char image (in the range 0-255), thresholding this image at level 127 can be done by:
Definition at line 98 of file vpImageTools.cpp.
References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpImageException::incorrectInitializationError, and vpERROR_TRACE.
|
static |
Extract a sub part of an image
I | : Input image from which a sub image will be extracted. |
i_sub,j_sub | : coordinates of the upper left point of the sub image |
nrow_sub,ncol_sub | : number of row, column of the sub image |
S | : Sub-image. |
Definition at line 132 of file vpImageTools.h.
References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), and vpImage< Type >::resize().
Referenced by vpKeyPointSurf::buildReference(), vpFernClassifier::buildReference(), vpDisplayGTK::displayImageROI(), vpDisplayOpenCV::displayImageROI(), vpPlanarObjectDetector::matchPoint(), vpKeyPointSurf::matchPoint(), vpFernClassifier::matchPoint(), and vpMeNurbs::seekExtremitiesCanny().
|
static |
Extract a sub part of an image
I | : Input image from which a sub image will be extracted. |
rect | : Rectangle area in the image I corresponding to the sub part of the image to extract. |
S | : Sub-image. |
Definition at line 171 of file vpImageTools.h.
References vpRect::getBottom(), vpImage< Type >::getHeight(), vpRect::getLeft(), vpRect::getRight(), vpRect::getTop(), vpImage< Type >::getWidth(), and vpImage< Type >::resize().
|
static |
Flip vertically the input image and give the result in the output image.
I | : Input image to flip. |
newI | : Output image which is the flipped input image. |
Definition at line 577 of file vpImageTools.h.
References vpImage< Type >::bitmap, vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), and vpImage< Type >::resize().
|
static |
Flip vertically the input image.
I | : Input image which is flipped and modified in output. |
The following example shows how to use this function:
Definition at line 625 of file vpImageTools.h.
References vpImage< Type >::bitmap, vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), and vpImage< Type >::resize().
|
static |
Compute the signed difference between the two images I1 and I2 for visualization issue : Idiff = I1-I2
I1 | : The first image. |
I2 | : The second image. |
Idiff | : The result of the difference. |
Definition at line 139 of file vpImageTools.cpp.
References vpImage< Type >::bitmap, vpException::dimensionError, vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpMath::maximum(), vpMath::minimum(), and vpImage< Type >::resize().
|
static |
Compute the difference between the two images I1 and I2
I1 | : The first image. |
I2 | : The second image. |
Idiff | : The result of the difference. |
Definition at line 173 of file vpImageTools.cpp.
References vpImage< Type >::bitmap, vpException::dimensionError, vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), and vpImage< Type >::resize().
|
static |
Undistort an image
I | : Input image to undistort. |
cam | : Parameters of the camera causing distortion. |
undistI | : Undistorted output image. The size of this image will be the same than the input image I. If the distortion parameter is null (see cam.get_kd_mp()), undistI is just a copy of I. |
Definition at line 406 of file vpImageTools.h.
References vpImage< Type >::bitmap, vpCameraParameters::get_kud(), vpCameraParameters::get_px(), vpCameraParameters::get_py(), vpCameraParameters::get_u0(), vpCameraParameters::get_v0(), vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpImage< Type >::resize(), and vpMath::sqr().