![]() |
Visual Servoing Platform version 3.7.0
|
#include <vpImageTools.h>
Public Types | |
| enum | vpImageInterpolationType { INTERPOLATION_NEAREST , INTERPOLATION_LINEAR , INTERPOLATION_CUBIC , INTERPOLATION_AREA } |
Public Member Functions | |
| template<class Type> | |
| void | createSubImage (const vpImage< Type > &I, unsigned int roi_top, unsigned int roi_left, unsigned int roi_height, unsigned int roi_width, vpImage< Type > &crop) |
| template<class Type> | |
| void | createSubImage (const vpImage< Type > &I, const vpRect &roi, vpImage< Type > &crop) |
| template<> | |
| void | binarise (vpImage< unsigned char > &I, unsigned char threshold1, unsigned char threshold2, unsigned char value1, unsigned char value2, unsigned char value3, bool useLUT) |
| template<> | |
| void | resizeBicubic (const vpImage< vpRGBa > &I, vpImage< vpRGBa > &Ires, unsigned int i, unsigned int j, float u, float v, float xFrac, float yFrac) |
| template<> | |
| void | resizeBilinear (const vpImage< vpRGBa > &I, vpImage< vpRGBa > &Ires, unsigned int i, unsigned int j, float u, float v, float xFrac, float yFrac) |
| template<> | |
| void | resize (const vpImage< unsigned char > &I, vpImage< unsigned char > &Ires, const vpImageInterpolationType &method, unsigned int) |
| template<> | |
| void | resize (const vpImage< vpRGBa > &I, vpImage< vpRGBa > &Ires, const vpImageInterpolationType &method, unsigned int) |
| template<> | |
| void | warpLinear (const vpImage< vpRGBa > &src, const vpMatrix &T, vpImage< vpRGBa > &dst, bool affine, bool centerCorner, bool fixedPoint) |
Static Public Member Functions | |
| template<class Type> | |
| static void | binarise (vpImage< Type > &I, Type threshold1, Type threshold2, Type value1, Type value2, Type value3, bool useLUT=true) |
| static void | changeLUT (vpImage< unsigned char > &I, unsigned char A, unsigned char newA, unsigned char B, unsigned char newB) |
| template<class Type> | |
| static void | crop (const vpImage< Type > &I, double roi_top, double roi_left, unsigned int roi_height, unsigned int roi_width, vpImage< Type > &crop, unsigned int v_scale=1, unsigned int h_scale=1) |
| static void | columnMean (const vpImage< double > &I, vpRowVector &result) |
| template<class Type> | |
| static void | crop (const vpImage< Type > &I, const vpImagePoint &topLeft, unsigned int roi_height, unsigned int roi_width, vpImage< Type > &crop, unsigned int v_scale=1, unsigned int h_scale=1) |
| template<class Type> | |
| static void | crop (const vpImage< Type > &I, const vpRect &roi, vpImage< Type > &crop, unsigned int v_scale=1, unsigned int h_scale=1) |
| template<class Type> | |
| static void | crop (const unsigned char *bitmap, unsigned int width, unsigned int height, const vpRect &roi, vpImage< Type > &crop, unsigned int v_scale=1, unsigned int h_scale=1) |
| static void | extract (const vpImage< unsigned char > &src, vpImage< unsigned char > &dst, const vpRectOriented &r) |
| static void | extract (const vpImage< unsigned char > &src, vpImage< double > &dst, const vpRectOriented &r) |
| 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 | imageDifference (const vpImage< vpRGBa > &I1, const vpImage< vpRGBa > &I2, vpImage< vpRGBa > &Idiff) |
| static void | imageDifferenceAbsolute (const vpImage< unsigned char > &I1, const vpImage< unsigned char > &I2, vpImage< unsigned char > &Idiff) |
| static void | imageDifferenceAbsolute (const vpImage< double > &I1, const vpImage< double > &I2, vpImage< double > &Idiff) |
| static void | imageDifferenceAbsolute (const vpImage< vpRGBa > &I1, const vpImage< vpRGBa > &I2, vpImage< vpRGBa > &Idiff) |
| static void | imageAdd (const vpImage< unsigned char > &I1, const vpImage< unsigned char > &I2, vpImage< unsigned char > &Ires, bool saturate=false) |
| static void | imageSubtract (const vpImage< unsigned char > &I1, const vpImage< unsigned char > &I2, vpImage< unsigned char > &Ires, bool saturate=false) |
| static int | inMask (const vpImage< vpRGBa > &I, const vpImage< bool > &mask, vpImage< vpRGBa > &I_mask) |
| static int | inMask (const vpImage< vpRGBa > &I, const vpImage< unsigned char > &mask, vpImage< vpRGBa > &I_mask) |
| static int | inMask (const vpImage< unsigned char > &I, const vpImage< bool > &mask, vpImage< unsigned char > &I_mask) |
| static int | inMask (const vpImage< unsigned char > &I, const vpImage< unsigned char > &mask, vpImage< unsigned char > &I_mask) |
| template<typename ArithmeticType, bool useFullScale> | |
| static int | inMask (const vpImage< vpHSV< ArithmeticType, useFullScale > > &I, const vpImage< bool > &mask, vpImage< vpHSV< ArithmeticType, useFullScale > > &I_mask) |
| template<typename ArithmeticType, bool useFullScale> | |
| static int | inMask (const vpImage< vpHSV< ArithmeticType, useFullScale > > &I, const vpImage< unsigned char > &mask, vpImage< vpHSV< ArithmeticType, useFullScale > > &I_mask) |
| static int | inRange (const unsigned char *hue, const unsigned char *saturation, const unsigned char *value, const vpColVector &hsv_range, unsigned char *mask, unsigned int size) |
| static int | inRange (const unsigned char *hue, const unsigned char *saturation, const unsigned char *value, const std::vector< int > &hsv_range, unsigned char *mask, unsigned int size) |
| template<typename ArithmeticType, bool useFullScale, typename RangeType> | |
| static int | inRange (const vpImage< vpHSV< ArithmeticType, useFullScale > > &Iin, const std::vector< RangeType > &hsv_range, vpImage< bool > &out) |
| template<typename ArithmeticType, bool useFullScale, typename RangeType> | |
| static int | inRange (const vpImage< vpHSV< ArithmeticType, useFullScale > > &Iin, const std::vector< RangeType > &hsv_range, vpImage< unsigned char > &out) |
| template<typename ArithmeticType, bool useFullScale> | |
| static int | inRange (const vpImage< vpHSV< ArithmeticType, useFullScale > > &Iin, const vpColVector &hsv_range, vpImage< bool > &out) |
| template<typename ArithmeticType, bool useFullScale> | |
| static int | inRange (const vpImage< vpHSV< ArithmeticType, useFullScale > > &Iin, const vpColVector &hsv_range, vpImage< unsigned char > &out) |
| static void | initUndistortMap (const vpCameraParameters &cam, unsigned int width, unsigned int height, vpArray2D< int > &mapU, vpArray2D< int > &mapV, vpArray2D< float > &mapDu, vpArray2D< float > &mapDv) |
| static double | interpolate (const vpImage< unsigned char > &I, const vpImagePoint &point, const vpImageInterpolationType &method=INTERPOLATION_NEAREST) |
| static void | integralImage (const vpImage< unsigned char > &I, vpImage< double > &II, vpImage< double > &IIsq) |
| static double | normalizedCorrelation (const vpImage< double > &I1, const vpImage< double > &I2, bool useOptimized=true) |
| static void | normalize (vpImage< double > &I) |
| static void | remap (const vpImage< unsigned char > &I, const vpArray2D< int > &mapU, const vpArray2D< int > &mapV, const vpArray2D< float > &mapDu, const vpArray2D< float > &mapDv, vpImage< unsigned char > &Iundist) |
| static void | remap (const vpImage< vpRGBa > &I, const vpArray2D< int > &mapU, const vpArray2D< int > &mapV, const vpArray2D< float > &mapDu, const vpArray2D< float > &mapDv, vpImage< vpRGBa > &Iundist) |
| template<class Type> | |
| static void | resize (const vpImage< Type > &I, vpImage< Type > &Ires, unsigned int width, unsigned int height, const vpImageInterpolationType &method=INTERPOLATION_NEAREST, unsigned int nThreads=0) |
| template<class Type> | |
| static void | resize (const vpImage< Type > &I, vpImage< Type > &Ires, const vpImageInterpolationType &method=INTERPOLATION_NEAREST, unsigned int nThreads=0) |
| static void | templateMatching (const vpImage< unsigned char > &I, const vpImage< unsigned char > &I_tpl, vpImage< double > &I_score, unsigned int step_u, unsigned int step_v, bool useOptimized=true) |
| template<class Type> | |
| static void | undistort (const vpImage< Type > &I, const vpCameraParameters &cam, vpImage< Type > &newI, unsigned int nThreads=2) |
| template<class Type> | |
| static void | undistort (const vpImage< Type > &I, vpArray2D< int > mapU, vpArray2D< int > mapV, vpArray2D< float > mapDu, vpArray2D< float > mapDv, vpImage< Type > &newI) |
| template<class Type> | |
| static void | warpImage (const vpImage< Type > &src, const vpMatrix &T, vpImage< Type > &dst, const vpImageInterpolationType &interpolation=INTERPOLATION_NEAREST, bool fixedPointArithmetic=true, bool pixelCenter=false) |
Deprecated functions | |
| template<class Type> | |
| static VP_DEPRECATED 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 VP_DEPRECATED void | createSubImage (const vpImage< Type > &I, const vpRect &rect, vpImage< Type > &S) |
Various image tools; sub-image extraction, modification of the look up table, binarisation...
Definition at line 76 of file vpImageTools.h.
Definition at line 79 of file vpImageTools.h.
|
inlinestatic |
Binarise an image.
Definition at line 763 of file vpImageTools.h.
Referenced by VISP_NAMESPACE_NAME::autoThreshold().
|
inline |
Binarise an image.
Definition at line 798 of file vpImageTools.h.
|
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 |
| B | : Height gray level value of the range to consider. |
| B_star | : New gray level value |
| 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 103 of file vpImageTools.cpp.
References vpImageException::incorrectInitializationError.
|
static |
Compute the column-wise mean intensities.
| I | : The image. |
| V | : The result vector. |
Definition at line 590 of file vpImageTools.cpp.
References vpRowVector::resize().
|
static |
References inRange(), normalizedCorrelation(), and vpImageException::notInitializedError.
| void vpImageTools::createSubImage | ( | const vpImage< Type > & | I, |
| const vpRect & | roi, | ||
| vpImage< Type > & | crop ) |
Crop an image region of interest.
| I | : Input image from which a sub image will be extracted. |
| roi | : Region of interest in image I corresponding to the cropped part of the image. |
| crop | : Cropped image. |
Definition at line 575 of file vpImageTools.h.
References crop().
|
static |
| void vpImageTools::createSubImage | ( | const vpImage< Type > & | I, |
| unsigned int | roi_top, | ||
| unsigned int | roi_left, | ||
| unsigned int | roi_height, | ||
| unsigned int | roi_width, | ||
| vpImage< Type > & | crop ) |
Crop a region of interest (ROI) in an image.
| I | : Input image from which a sub image will be extracted. |
| roi_top | : ROI vertical position of the upper/left corner in the input image. |
| roi_left | : ROI horizontal position of the upper/left corner in the input image. |
| roi_height | : Cropped image height corresponding to the ROI height. |
| roi_width | : Cropped image width corresponding to the ROI height. |
| crop | : Cropped image. |
Definition at line 554 of file vpImageTools.h.
References crop().
|
static |
Crop a region of interest (ROI) in an image. The ROI coordinates and dimension are defined in the original image.
Setting v_scale and h_scale to values different from 1 allows also to subsample the cropped image.
| [in] | bitmap | : Pointer to the input image from which a sub image will be extracted. |
| [in] | width | : Width of the input image. |
| [in] | height | : Height of the input image. |
| [in] | roi | : Region of interest corresponding to the cropped part of the image. |
| [out] | crop | : Cropped image. |
| [in] | v_scale | [in] : Vertical subsampling factor applied to the ROI. |
| [in] | h_scale | [in] : Horizontal subsampling factor applied to the ROI. |
Definition at line 710 of file vpImageTools.h.
References crop(), vpRect::getHeight(), vpRect::getLeft(), vpRect::getTop(), and vpRect::getWidth().
|
static |
Crop a region of interest (ROI) in an image. The ROI coordinates and dimension are defined in the original image.
Setting v_scale and h_scale to values different from 1 allows also to subsample the cropped image.
| I | : Input image from which a sub image will be extracted. |
| topLeft | : ROI position of the upper/left corner in the input image. |
| roi_height | : Cropped image height corresponding to the ROI height. |
| roi_width | : Cropped image width corresponding to the ROI height. |
| crop | : Cropped image. |
| v_scale | [in] : Vertical subsampling factor applied to the ROI. |
| h_scale | [in] : Horizontal subsampling factor applied to the ROI. |
Definition at line 662 of file vpImageTools.h.
References crop(), vpImagePoint::get_i(), and vpImagePoint::get_j().
|
static |
Crop a region of interest (ROI) in an image. The ROI coordinates and dimension are defined in the original image.
Setting v_scale and h_scale to values different from 1 allows also to subsample the cropped image.
| I | : Input image from which a sub image will be extracted. |
| roi | : Region of interest in image I corresponding to the cropped part of the image. |
| crop | : Cropped image. |
| v_scale | [in] : Vertical subsampling factor applied to the ROI. |
| h_scale | [in] : Horizontal subsampling factor applied to the ROI. |
Definition at line 685 of file vpImageTools.h.
References crop(), vpRect::getHeight(), vpRect::getLeft(), vpRect::getTop(), and vpRect::getWidth().
|
static |
Crop a region of interest (ROI) in an image. The ROI coordinates and dimension are defined in the original image.
Setting v_scale and h_scale to values different from 1 allows also to subsample the cropped image.
| [in] | I | : Input image from which a sub image will be extracted. |
| [in] | roi_top | : ROI vertical position of the upper/left corner in the input image. |
| [in] | roi_left | : ROI horizontal position of the upper/left corner in the input image. |
| [in] | roi_height | : Cropped image height corresponding to the ROI height. |
| [in] | roi_width | : Cropped image width corresponding to the ROI height. |
| [out] | crop | : Cropped image. |
| [in] | v_scale | : Vertical subsampling factor applied to the ROI. |
| [in] | h_scale | : Horizontal subsampling factor applied to the ROI. |
Definition at line 605 of file vpImageTools.h.
References crop().
Referenced by vpV4l2Grabber::acquire(), vpV4l2Grabber::acquire(), createSubImage(), createSubImage(), crop(), crop(), crop(), crop(), vpDisplayGTK::displayImageROI(), vpDisplayGTK::displayImageROI(), vpMeNurbs::seekExtremitiesCanny(), and templateMatching().
|
static |
Extract a rectangular region from an image.
| src | : The source image. |
| dst | : The resulting image. |
| r | : The rectangle area. |
Definition at line 709 of file vpImageTools.cpp.
References interpolate(), INTERPOLATION_LINEAR, vpImage< Type >::resize(), and vpMath::round().
|
static |
Extract a rectangular region from an image.
| src | : The source image. |
| dst | : The resulting image. |
| r | : The rectangle area. |
Definition at line 682 of file vpImageTools.cpp.
References interpolate(), INTERPOLATION_LINEAR, vpImage< Type >::resize(), and vpMath::round().
|
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 1121 of file vpImageTools.h.
References vpImage< Type >::bitmap, 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 1166 of file vpImageTools.h.
References vpImage< Type >::bitmap, and vpImage< Type >::resize().
|
static |
Compute the image addition:
.
| I1 | : The first image. |
| I2 | : The second image. |
| Ires | : |
| saturate | : If true, saturate the result to [0 ; 255] using vpMath::saturate, otherwise overflow may occur. |
Definition at line 315 of file vpImageTools.cpp.
References vpImage< Type >::bitmap, vpException::dimensionError, vpImage< Type >::getHeight(), vpImage< Type >::getSize(), vpImage< Type >::getWidth(), vpImage< Type >::resize(), and vpMath::saturate().
Referenced by VISP_NAMESPACE_NAME::fillHoles().
|
static |
Compute the signed difference between the two images I1 and I2 for visualization purpose: Idiff = I1-I2
| I1 | : The first image. |
| I2 | : The second image. |
| Idiff | : The result of the difference. |
Definition at line 145 of file vpImageTools.cpp.
References vpImage< Type >::bitmap, vpException::dimensionError, vpImage< Type >::getHeight(), vpImage< Type >::getSize(), vpImage< Type >::getWidth(), and vpImage< Type >::resize().
|
static |
Compute the signed difference between the two images I1 and I2 RGB components for visualization purpose: Idiff = I1-I2. The fourth component named A is not compared. It is set to 0 in the resulting difference image.
| I1 | : The first image. |
| I2 | : The second image. |
| Idiff | : The result of the difference between RGB components. |
Definition at line 181 of file vpImageTools.cpp.
References vpImage< Type >::bitmap, vpException::dimensionError, vpImage< Type >::getHeight(), vpImage< Type >::getSize(), 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 249 of file vpImageTools.cpp.
References vpMath::abs(), vpImage< Type >::bitmap, vpException::dimensionError, vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), 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 224 of file vpImageTools.cpp.
References vpMath::abs(), vpImage< Type >::bitmap, vpException::dimensionError, vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), and vpImage< Type >::resize().
|
static |
Compute the difference between the two images I1 and I2 RGB components. The fourth component named A is not compared. It is set to 0 in the resulting difference image.
| I1 | : The first image. |
| I2 | : The second image. |
| Idiff | : The result of the difference between RGB components. |
Definition at line 278 of file vpImageTools.cpp.
References vpMath::abs(), vpImage< Type >::bitmap, vpException::dimensionError, vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), and vpImage< Type >::resize().
|
static |
Compute the image addition:
.
| I1 | : The first image. |
| I2 | : The second image. |
| Ires | : |
| saturate | : If true, saturate the result to [0 ; 255] using vpMath::saturate, otherwise overflow may occur. |
Definition at line 358 of file vpImageTools.cpp.
References vpImage< Type >::bitmap, vpException::dimensionError, vpImage< Type >::getHeight(), vpImage< Type >::getSize(), vpImage< Type >::getWidth(), vpImage< Type >::resize(), and vpMath::saturate().
Referenced by VISP_NAMESPACE_NAME::fillHoles().
|
static |
Compute the undistortion transformation map.
| cam | : Camera intrinsic parameters with distortion coefficients. |
| width | : Image width. |
| height | : Image height. |
| mapU | : 2D array that contains at each coordinate the u-coordinate in the distorted image. |
| mapV | : 2D array that contains at each coordinate the v-coordinate in the distorted image. |
| mapDu | : 2D array that contains at each coordinate the |
| mapDv | : 2D array that contains at each coordinate the |
Definition at line 401 of file vpImageTools.cpp.
References vpCameraParameters::ProjWithKannalaBrandtDistortion, vpArray2D< Type >::resize(), and vpMath::sqr().
|
inlinestatic |
Keep the part of an image that is in the mask.
| [in] | I | : Input image. |
| [in] | mask | : Mask where pixels to consider have value equal to true. |
| [out] | I_mask | : Resulting image where pixels that are in the mask are kept. |
Definition at line 172 of file vpImageTools.h.
References inMask().
|
inlinestatic |
Keep the part of an image that is in the mask.
| [in] | I | : Input image. |
| [in] | mask | : Mask where pixels to consider have values that differ from 0. |
| [out] | I_mask | : Resulting image where pixels that are in the mask are kept. |
Definition at line 187 of file vpImageTools.h.
References inMask().
|
inlinestatic |
Keep the part of an image that is in the mask.
| [in] | I | : Input image. |
| [in] | mask | : Mask where pixels to consider have value equal to true. |
| [out] | I_mask | : Resulting image where pixels that are in the mask are kept. |
Definition at line 205 of file vpImageTools.h.
References inMask().
|
inlinestatic |
Keep the part of an image that is in the mask.
| [in] | I | : Input image. |
| [in] | mask | : Mask where pixels to consider have values that differ from 0. |
| [out] | I_mask | : Resulting image where pixels that are in the mask are kept. |
Definition at line 222 of file vpImageTools.h.
References inMask().
|
inlinestatic |
Keep the part of an image that is in the mask.
| [in] | I | : Input image. |
| [in] | mask | : Mask where pixels to consider have value equal to true. |
| [out] | I_mask | : Resulting image where pixels that are in the mask are kept. |
Definition at line 141 of file vpImageTools.h.
References inMask().
Referenced by inMask(), inMask(), inMask(), inMask(), inMask(), and inMask().
|
inlinestatic |
Keep the part of an image that is in the mask.
| [in] | I | : Input image. |
| [in] | mask | : Mask where pixels to consider have values that differ from 0. |
| [out] | I_mask | : Resulting image where pixels that are in the mask are kept. |
Definition at line 156 of file vpImageTools.h.
References inMask().
|
static |
Create binary mask by checking if HSV (hue, saturation, value) channels lie between low and high HSV thresholds.
| [in] | hue | : Pointer to an array of hue values. Its dimension is equal to the size parameter. |
| [in] | saturation | : Pointer to an array of saturation values. Its dimension is equal to the size parameter. |
| [in] | value | : Pointer to an array of values. Its dimension is equal to the size parameter. |
| [in] | hsv_range | : 6-dim vector that contains the low/high range values for each HSV channel respectively. Each element of this vector should be in [0,255] range. Note that there is also tutorial-hsv-tuner.cpp that may help to determine low/high HSV values. |
| [out] | mask | : Pointer to a resulting mask of dimension size. When HSV value is in the boundaries, the mask element is set to 255, otherwise to 0. The mask should be allocated prior calling this function. Its dimension is equal to the size parameter. |
| [in] | size | : Size of hue, saturation, value and mask arrays. |
Definition at line 1132 of file vpImageTools.cpp.
References vpImageException::notInitializedError.
|
static |
Create binary mask by checking if HSV (hue, saturation, value) channels lie between low and high HSV thresholds.
| [in] | hue | : Pointer to an array of hue values. Its dimension is equal to the size parameter. |
| [in] | saturation | : Pointer to an array of saturation values. Its dimension is equal to the size parameter. |
| [in] | value | : Pointer to an array of values. Its dimension is equal to the size parameter. |
| [in] | hsv_range | : 6-dim vector that contains the low/high range values for each HSV channel respectively. Each element of this vector should be in [0,255] range. Note that there is also tutorial-hsv-tuner.cpp that may help to determine low/high HSV values. |
| [out] | mask | : Pointer to a resulting mask of dimension size. When HSV value is in the boundaries, the mask element is set to 255, otherwise to 0. The mask should be allocated prior calling this function. Its dimension is equal to the size parameter. |
| [in] | size | : Size of hue, saturation, value and mask arrays. |
Definition at line 1068 of file vpImageTools.cpp.
References vpImageException::notInitializedError, and vpArray2D< Type >::size().
Referenced by createSubImage(), inRange(), inRange(), inRange(), and inRange().
|
inlinestatic |
Create binary mask by checking if HSV (hue, saturation, value) channels lie between low and high HSV thresholds.
| ArithmeticType | The arithmetic type used to encode the Hue, Saturation and Value channels. |
| useFullScale | If ArithmeticType is unsigned char, true means that Hue is encoded on the full range [0;255] and false means it is encoded in a limited range as defined in the vpHSV documentation. |
| RangeType | The arithmetic type used to encode the ranges. Be careful that the validity of the range values is not checked. |
| [in] | Iin | The input image. |
| [in] | hsv_range | 6-dim vector that contains the low/high range values for each HSV channel respectively. Each element of this vector should be in the range defined by the ArithmeticType and useFullRange template parameters. Note that there is also tutorial-hsv-tuner.cpp that may help to determine low/high HSV values. |
| [in] | out | The output mask encoded as booleans. True means that the pixel is in range and false that it is not in range. |
Definition at line 255 of file vpImageTools.h.
References inRange().
|
inlinestatic |
Create binary mask by checking if HSV (hue, saturation, value) channels lie between low and high HSV thresholds.
| ArithmeticType | The arithmetic type used to encode the Hue, Saturation and Value channels. |
| useFullScale | If ArithmeticType is unsigned char, true means that Hue is encoded on the full range [0;255] and false means it is encoded in a limited range as defined in the vpHSV documentation. |
| RangeType | The arithmetic type used to encode the ranges. Be careful that the validity of the range values is not checked. |
| [in] | Iin | The input image. |
| [in] | hsv_range | 6-dim vector that contains the low/high range values for each HSV channel respectively. Each element of this vector should be in the range defined by the ArithmeticType and useFullRange template parameters. Note that there is also tutorial-hsv-tuner.cpp that may help to determine low/high HSV values. |
| [in] | out | The output mask encoded as unsigned char. 255 means that the pixel is in range and 0 that it is not in range. |
Definition at line 281 of file vpImageTools.h.
References inRange().
|
inlinestatic |
Create binary mask by checking if HSV (hue, saturation, value) channels lie between low and high HSV thresholds.
| ArithmeticType | The arithmetic type used to encode the Hue, Saturation and Value channels. |
| useFullScale | If ArithmeticType is unsigned char, true means that Hue is encoded on the full range [0;255] and false means it is encoded in a limited range as defined in the vpHSV documentation. |
| [in] | Iin | The input image. |
| [in] | hsv_range | 6-dim vector that contains the low/high range values for each HSV channel respectively. Each element of this vector should be in the range defined by the ArithmeticType and useFullRange template parameters. Note that there is also tutorial-hsv-tuner.cpp that may help to determine low/high HSV values. |
| [in] | out | The output mask encoded as booleans. True means that the pixel is in range and false that it is not in range. |
Definition at line 307 of file vpImageTools.h.
References vpArray2D< Type >::getRows(), and inRange().
|
inlinestatic |
Create binary mask by checking if HSV (hue, saturation, value) channels lie between low and high HSV thresholds.
| ArithmeticType | The arithmetic type used to encode the Hue, Saturation and Value channels. |
| useFullScale | If ArithmeticType is unsigned char, true means that Hue is encoded on the full range [0;255] and false means it is encoded in a limited range as defined in the vpHSV documentation. |
| [in] | Iin | The input image. |
| [in] | hsv_range | 6-dim vector that contains the low/high range values for each HSV channel respectively. Each element of this vector should be in the range defined by the ArithmeticType and useFullRange template parameters. Note that there is also tutorial-hsv-tuner.cpp that may help to determine low/high HSV values. |
| [in] | out | The output mask encoded as unsigned char. 255 means that the pixel is in range and 0 that it is not in range. |
Definition at line 337 of file vpImageTools.h.
References vpArray2D< Type >::getRows(), and inRange().
|
static |
Compute the integral images:
![]()
.
| I | : Input image. |
| II | : Integral image II. |
| IIsq | : Integral image IIsq. |
Definition at line 526 of file vpImageTools.cpp.
References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpImage< Type >::resize(), and vpMath::sqr().
Referenced by templateMatching().
|
static |
Get the interpolated value at a given location.
| I | : The image to perform intepolation in. |
| point | : The image point. |
| method | : The interpolation method (only interpolation with vpImageTools::INTERPOLATION_NEAREST and vpImageTools::INTERPOLATION_LINEAR are implemented). |
Definition at line 657 of file vpImageTools.cpp.
References vpImagePoint::get_i(), vpImagePoint::get_j(), INTERPOLATION_CUBIC, INTERPOLATION_LINEAR, INTERPOLATION_NEAREST, vpException::notImplementedError, and vpMath::round().
|
static |
Normalize the image intensities.
| I | : The image to normalize. |
Definition at line 609 of file vpImageTools.cpp.
|
static |
Compute a correlation between 2 images.
| I1 | : The first image. |
| I2 | : The second image. |
| useOptimized | : Use SSE if true and available. |
Definition at line 553 of file vpImageTools.cpp.
References vpImage< Type >::bitmap, vpException::dimensionError, vpImage< Type >::getHeight(), vpImage< Type >::getMeanValue(), vpImage< Type >::getSize(), vpImage< Type >::getWidth(), and vpMath::sqr().
Referenced by createSubImage(), and templateMatching().
|
static |
Apply the transformation map to the image.
| I | : Input grayscale image. |
| mapU | : Map that contains at each destination coordinate the u-coordinate in the source image. |
| mapV | : Map that contains at each destination coordinate the v-coordinate in the source image. |
| mapDu | : Map that contains at each destination coordinate the |
| mapDv | : Map that contains at each destination coordinate the |
| Iundist | : Output transformed grayscale image. |
Definition at line 897 of file vpImageTools.cpp.
References vpImage< Type >::resize().
Referenced by undistort().
|
static |
Apply the transformation map to the image.
| I | : Input color image. |
| mapU | : Map that contains at each destination coordinate the u-coordinate in the source image. |
| mapV | : Map that contains at each destination coordinate the v-coordinate in the source image. |
| mapDu | : Map that contains at each destination coordinate the |
| mapDv | : Map that contains at each destination coordinate the |
| Iundist | : Output transformed color image. |
Definition at line 943 of file vpImageTools.cpp.
References vpImage< Type >::bitmap, vpArray2D< Type >::data, and vpImage< Type >::resize().
|
static |
Resize the image using one interpolation method (by default it uses the nearest neighbor interpolation).
| I | : Input image. |
| Ires | : Output image resized (you have to init the image Ires at the desired size). |
| method | : Interpolation method. |
| nThreads | : Number of threads to use if OpenMP is available (zero will let OpenMP uses the optimal number of threads). Unused if OpenMP is not enabled. |
Definition at line 1384 of file vpImageTools.h.
References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), INTERPOLATION_AREA, INTERPOLATION_CUBIC, INTERPOLATION_LINEAR, and INTERPOLATION_NEAREST.
|
static |
Resize the image using one interpolation method (by default it uses the nearest neighbor interpolation).
| I | : Input image. |
| Ires | : Output image resized to width, height. |
| width | : Resized width. |
| height | : Resized height. |
| method | : Interpolation method. |
| nThreads | : Number of threads to use if OpenMP is available (zero will let OpenMP uses the optimal number of threads). |
Definition at line 1358 of file vpImageTools.h.
References vpImage< Type >::resize(), and resize().
Referenced by VISP_NAMESPACE_NAME::gammaCorrectionSpatialBased(), VISP_NAMESPACE_NAME::gammaCorrectionSpatialBased(), and resize().
|
inline |
Definition at line 1437 of file vpImageTools.h.
References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), INTERPOLATION_AREA, INTERPOLATION_CUBIC, INTERPOLATION_LINEAR, and INTERPOLATION_NEAREST.
|
inline |
Definition at line 1490 of file vpImageTools.h.
References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), INTERPOLATION_AREA, INTERPOLATION_CUBIC, INTERPOLATION_LINEAR, and INTERPOLATION_NEAREST.
|
inline |
Definition at line 1230 of file vpImageTools.h.
References vpMath::saturate().
|
inline |
Definition at line 1305 of file vpImageTools.h.
References vpMath::saturate().
|
static |
Match a template image into another image using zero-mean normalized cross-correlation:
| I | : Input image. |
| I_tpl | : Template image. |
| I_score | : Output template matching score. |
| step_u | : Step in u-direction to speed-up the computation. |
| step_v | : Step in v-direction to speed-up the computation. |
| useOptimized | : Use optimized version (SSE, OpenMP, integral images, ...) if true and available. |
Definition at line 744 of file vpImageTools.cpp.
References vpImage< Type >::bitmap, vpImageConvert::convert(), crop(), vpImage< Type >::getHeight(), vpImage< Type >::getSize(), vpImage< Type >::getWidth(), integralImage(), normalizedCorrelation(), 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 |
| nThreads | : Number of threads to use if pthreads library is available. |
Since this function is time consuming, if you want to undistort multiple images, you should rather call initUndistortMap() once and then remap() to undistort the images. This will be less time consuming.
Definition at line 956 of file vpImageTools.h.
References vpImage< Type >::bitmap, and vpImage< Type >::resize().
|
static |
Undistort an image.
| I | : Input image to undistort. |
| mapU | : Map that contains at each destination coordinate the u-coordinate in the source image. |
| mapV | : Map that contains at each destination coordinate the v-coordinate in the source image. |
| mapDu | : Map that contains at each destination coordinate the |
| mapDv | : Map that contains at each destination coordinate the |
| newI | : Undistorted output image. The size of this image will be the same as the input image I. |
Definition at line 1109 of file vpImageTools.h.
References remap().
|
static |
Apply a warping (affine or perspective) transformation to an image.
| src | : Input image. |
| T | : Transformation / warping matrix, a 2x3 matrix for an affine transformation or a 3x3 matrix for a perspective transformation (homography). |
| dst | : Output image, if empty it will be of the same size than src and zero-initialized. |
| interpolation | : Interpolation method (only INTERPOLATION_NEAREST and INTERPOLATION_LINEAR are accepted, if INTERPOLATION_CUBIC is passed, INTERPOLATION_NEAREST will be used instead). |
| fixedPointArithmetic | : If true and if pixelCenter is false, fixed-point arithmetic is used if possible. Otherwise (e.g. the input image is too big) it fallbacks to the default implementation. |
| pixelCenter | : If true, pixel coordinates are at (0.5, 0.5), otherwise at (0,0). Fixed-point arithmetic cannot be used with pixelCenter option. |
Definition at line 55 of file vpImageTools_warp.h.
References vpArray2D< Type >::getCols(), vpImage< Type >::getHeight(), vpArray2D< Type >::getRows(), vpImage< Type >::getSize(), vpImage< Type >::getWidth(), INTERPOLATION_CUBIC, INTERPOLATION_NEAREST, vpMatrix::inverseByLU(), vpMath::nul(), and vpImage< Type >::resize().
|
inline |
Definition at line 642 of file vpImageTools_warp.h.
References vpRGBa::B, vpRGBa::G, vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpRGBa::R, and vpMath::saturate().