![]() |
Visual Servoing Platform version 3.7.0
|
#include <vpImageFilter.h>
Public Types | |
| enum | vpCannyBackendType { CANNY_OPENCV_BACKEND = 0 , CANNY_VISP_BACKEND = 1 , CANNY_COUNT_BACKEND = 2 } |
| enum | vpCannyFilteringAndGradientType { CANNY_GBLUR_SOBEL_FILTERING = 0 , CANNY_GBLUR_SCHARR_FILTERING = 1 , CANNY_COUNT_FILTERING = 2 } |
| typedef enum vpImageFilter::vpCannyBackendType | vpCannyBackendType |
| typedef enum vpImageFilter::vpCannyFilteringAndGradientType | vpCannyFilteringAndGradientType |
Static Public Member Functions | |
| static std::string | vpCannyBackendTypeList (const std::string &pref="<", const std::string &sep=" , ", const std::string &suf=">") |
| static std::string | vpCannyBackendTypeToString (const vpCannyBackendType &type) |
| static vpCannyBackendType | vpCannyBackendTypeFromString (const std::string &name) |
| static std::string | vpGetCannyFiltAndGradTypes (const std::string &pref="<", const std::string &sep=" , ", const std::string &suf=">") |
| static std::string | vpCannyFiltAndGradTypeToStr (const vpCannyFilteringAndGradientType &type) |
| static vpCannyFilteringAndGradientType | vpCannyFiltAndGradTypeFromStr (const std::string &name) |
| static void | canny (const vpImage< unsigned char > &I, vpImage< unsigned char > &Ic, const unsigned int &gaussianFilterSize, const float &thresholdCanny, const unsigned int &apertureSobel) |
| static void | canny (const vpImage< unsigned char > &I, vpImage< unsigned char > &Ic, const unsigned int &gaussianFilterSize, const float &lowerThresholdCanny, const float &higherThresholdCanny, const unsigned int &apertureSobel) |
| static void | canny (const vpImage< unsigned char > &I, vpImage< unsigned char > &Ic, const unsigned int &gaussianFilterSize, const float &lowerThresholdCanny, const float &higherThresholdCanny, const unsigned int &apertureSobel, const float &gaussianStdev, const float &lowerThresholdRatio, const float &upperThresholdRatio, const bool &normalizeGradients, const vpCannyBackendType &cannyBackend, const vpCannyFilteringAndGradientType &cannyFilteringSteps, const vpImage< bool > *p_mask=nullptr) |
| static float | computeCannyThreshold (const cv::Mat &cv_I, const cv::Mat *p_cv_dIx, const cv::Mat *p_cv_dIy, float &lowerThresh, const unsigned int &gaussianKernelSize=5, const float &gaussianStdev=2.f, const unsigned int &apertureGradient=3, const float &lowerThresholdRatio=0.6f, const float &upperThresholdRatio=0.8f, const vpCannyFilteringAndGradientType &filteringType=CANNY_GBLUR_SOBEL_FILTERING) |
| static void | computePartialDerivatives (const cv::Mat &cv_I, cv::Mat &cv_dIx, cv::Mat &cv_dIy, const bool &computeDx=true, const bool &computeDy=true, const bool &normalize=true, const unsigned int &gaussianKernelSize=5, const float &gaussianStdev=2.f, const unsigned int &apertureGradient=3, const vpCannyFilteringAndGradientType &filteringType=CANNY_GBLUR_SOBEL_FILTERING) |
| template<typename ImageType, typename FilterType> | |
| static void | computePartialDerivatives (const vpImage< ImageType > &I, vpImage< FilterType > &dIx, vpImage< FilterType > &dIy, const bool &computeDx=true, const bool &computeDy=true, const bool &normalize=true, const unsigned int &gaussianKernelSize=5, const FilterType &gaussianStdev=2.f, const unsigned int &apertureGradient=3, const vpCannyFilteringAndGradientType &filteringType=CANNY_GBLUR_SOBEL_FILTERING, const vpCannyBackendType &backend=CANNY_VISP_BACKEND, const vpImage< bool > *p_mask=nullptr) |
| template<typename FilterType> | |
| static void | computePartialDerivatives (const vpImage< vpRGBa > &I, vpImage< FilterType > &dIx, vpImage< FilterType > &dIy, const bool &computeDx=true, const bool &computeDy=true, const bool &normalize=true, const unsigned int &gaussianKernelSize=5, const FilterType &gaussianStdev=2.f, const unsigned int &apertureGradient=3, const vpCannyFilteringAndGradientType &filteringType=CANNY_GBLUR_SOBEL_FILTERING, const vpCannyBackendType &backend=CANNY_VISP_BACKEND, const vpImage< bool > *p_mask=nullptr)=delete |
| template<typename ImageType> | |
| static void | computePartialDerivatives (const vpImage< ImageType > &I, vpImage< unsigned char > &dIx, vpImage< unsigned char > &dIy, const bool &computeDx=true, const bool &computeDy=true, const bool &normalize=true, const unsigned int &gaussianKernelSize=5, const unsigned char &gaussianStdev=2.f, const unsigned int &apertureGradient=3, const vpCannyFilteringAndGradientType &filteringType=CANNY_GBLUR_SOBEL_FILTERING, const vpCannyBackendType &backend=CANNY_VISP_BACKEND, const vpImage< bool > *p_mask=nullptr)=delete |
| template<typename ImageType> | |
| static void | computePartialDerivatives (const vpImage< ImageType > &I, vpImage< vpRGBa > &dIx, vpImage< vpRGBa > &dIy, const bool &computeDx=true, const bool &computeDy=true, const bool &normalize=true, const unsigned int gaussianKernelSize=5, const vpRGBa gaussianStdev=vpRGBa(), const unsigned int apertureGradient=3, const vpCannyFilteringAndGradientType &filteringType=CANNY_GBLUR_SOBEL_FILTERING, const vpCannyBackendType &backend=CANNY_VISP_BACKEND, const vpImage< bool > *p_mask=nullptr)=delete |
| template<typename OutType> | |
| static float | computeCannyThreshold (const vpImage< unsigned char > &I, float &lowerThresh, const vpImage< OutType > *p_dIx=nullptr, const vpImage< OutType > *p_dIy=nullptr, const unsigned int &gaussianKernelSize=5, const OutType &gaussianStdev=2.f, const unsigned int &apertureGradient=3, const float &lowerThresholdRatio=0.6f, const float &upperThresholdRatio=0.8f, const vpCannyFilteringAndGradientType &filteringType=CANNY_GBLUR_SOBEL_FILTERING, const vpImage< bool > *p_mask=nullptr) |
| template<typename ArithmeticType, bool useFullScale, typename OutType> | |
| static float | computeCannyThreshold (const vpImage< vpHSV< ArithmeticType, useFullScale > > &I, float &lowerThresh, const vpImage< OutType > *p_dIx=nullptr, const vpImage< OutType > *p_dIy=nullptr, const unsigned int &gaussianKernelSize=5, const OutType &gaussianStdev=2.f, const float &lowerThresholdRatio=0.6f, const float &upperThresholdRatio=0.8f, const vpCannyFilteringAndGradientType &filteringType=CANNY_GBLUR_SOBEL_FILTERING, const vpImage< bool > *p_mask=nullptr) |
| template<class ImageType> | |
| static double | derivativeFilterX (const vpImage< ImageType > &I, unsigned int r, unsigned int c) |
| template<class ImageType> | |
| static double | derivativeFilterY (const vpImage< ImageType > &I, unsigned int r, unsigned int c) |
| template<class ImageType, typename FilterType> | |
| static FilterType | derivativeFilterX (const vpImage< ImageType > &I, unsigned int r, unsigned int c, const FilterType *filter, unsigned int size) |
| template<class ImageType, typename FilterType> | |
| static FilterType | derivativeFilterY (const vpImage< ImageType > &I, unsigned int r, unsigned int c, const FilterType *filter, unsigned int size) |
| template<typename ImageType, typename FilterType> | |
| static void | filter (const vpImage< ImageType > &I, vpImage< FilterType > &If, const vpArray2D< FilterType > &M, bool convolve=false, const vpImage< bool > *p_mask=nullptr) |
| template<typename FilterType> | |
| static FilterType | filter (const vpImage< FilterType > &I, const vpArray2D< FilterType > &M, unsigned int row, unsigned int col) |
| template<typename FilterType> | |
| static void | filter (const vpImage< vpRGBa > &I, vpImage< FilterType > &If, const vpArray2D< FilterType > &M, bool convolve=false)=delete |
| template<typename ImageType, typename FilterType> | |
| static void | filter (const vpImage< ImageType > &I, vpImage< FilterType > &Iu, vpImage< FilterType > &Iv, const vpArray2D< FilterType > &M, bool convolve=false, const vpImage< bool > *p_mask=nullptr) |
| template<typename FilterType> | |
| static void | filter (const vpImage< vpRGBa > &I, vpImage< FilterType > &Iu, vpImage< FilterType > &Iv, const vpArray2D< FilterType > &M, bool convolve)=delete |
| template<typename ImageType> | |
| static void | filter (const vpImage< ImageType > &I, vpImage< ImageType > &Iu, vpImage< ImageType > &Iv, const vpArray2D< vpRGBa > &M, bool convolve)=delete |
| static void | sepFilter (const vpImage< unsigned char > &I, vpImage< double > &If, const vpColVector &kernelH, const vpColVector &kernelV) |
| template<typename ImageType, typename FilterType> | |
| static void | filter (const vpImage< ImageType > &I, vpImage< FilterType > &GI, const FilterType *filter, unsigned int size, const vpImage< bool > *p_mask=nullptr) |
| static unsigned char | filterGaussXPyramidal (const vpImage< unsigned char > &I, unsigned int i, unsigned int j) |
| static unsigned char | filterGaussYPyramidal (const vpImage< unsigned char > &I, unsigned int i, unsigned int j) |
| template<typename ImageType, typename OutputType, typename FilterType> | |
| static void | filterX (const vpImage< ImageType > &I, vpImage< OutputType > &dIx, const FilterType *filter, unsigned int size, const vpImage< bool > *p_mask=nullptr) |
| template<typename ImageType, typename OutputType, typename FilterType> | |
| static std::enable_if< std::is_arithmetic< ImageType >::value, void >::type | filterX (const vpImage< ImageType > &I, OutputType &result, unsigned int r, unsigned int c, const FilterType *filter, unsigned int size) |
| template<typename ImageType, typename OutputType, typename FilterType> | |
| static std::enable_if<!std::is_arithmetic< ImageType >::value, void >::type | filterX (const vpImage< ImageType > &I, OutputType &result, unsigned int r, unsigned int c, const FilterType *filter, unsigned int size) |
| template<typename ImageType, typename OutputType, typename FilterType> | |
| static void | filterY (const vpImage< ImageType > &I, vpImage< OutputType > &dIy, const FilterType *filter, unsigned int size, const vpImage< bool > *p_mask=nullptr) |
| template<typename ImageType, typename OutputType, typename FilterType> | |
| static std::enable_if< std::is_arithmetic< ImageType >::value, void >::type | filterY (const vpImage< ImageType > &I, OutputType &result, unsigned int r, unsigned int c, const FilterType *filter, unsigned int size) |
| template<typename ImageType, typename OutputType, typename FilterType> | |
| static std::enable_if<!std::is_arithmetic< ImageType >::value, void >::type | filterY (const vpImage< ImageType > &I, OutputType &result, unsigned int r, unsigned int c, const FilterType *filter, unsigned int size) |
| template<typename ImageType, typename OutputType, typename FilterType = float> | |
| static void | gaussianBlur (const vpImage< ImageType > &I, vpImage< OutputType > &GI, unsigned int size=7, FilterType sigma=0., bool normalize=true, const vpImage< bool > *p_mask=nullptr) |
| template<class T> | |
| static double | gaussianFilter (const vpImage< T > &fr, unsigned int r, unsigned int c) |
| static void | getGaussPyramidal (const vpImage< unsigned char > &I, vpImage< unsigned char > &GI) |
| static void | getGaussXPyramidal (const vpImage< unsigned char > &I, vpImage< unsigned char > &GI) |
| static void | getGaussYPyramidal (const vpImage< unsigned char > &I, vpImage< unsigned char > &GI) |
| template<typename FilterType> | |
| static void | getGaussianKernel (FilterType *filter, unsigned int size, FilterType sigma=0., bool normalize=true) |
| template<typename FilterType> | |
| static void | getGaussianDerivativeKernel (FilterType *filter, unsigned int size, FilterType sigma=0., bool normalize=true) |
| template<typename FilterType> | |
| static void | getGradX (const vpImage< unsigned char > &I, vpImage< FilterType > &dIx, const vpImage< bool > *p_mask=nullptr) |
| template<typename ImageType, typename FilterType> | |
| static void | getGradX (const vpImage< ImageType > &I, vpImage< FilterType > &dIx, const FilterType *filter, unsigned int size, const vpImage< bool > *p_mask=nullptr) |
| template<typename ImageType, typename FilterType> | |
| static void | getGradXGauss2D (const vpImage< ImageType > &I, vpImage< FilterType > &dIx, const FilterType *gaussianKernel, const FilterType *gaussianDerivativeKernel, unsigned int size, const vpImage< bool > *p_mask=nullptr) |
| template<typename ArithmeticType, typename FilterType, bool useFullScale> | |
| static void | gradientFilterX (const vpImage< vpHSV< ArithmeticType, useFullScale > > &I, vpImage< FilterType > &GIx, const int &nbThread, const vpImage< bool > *p_mask, const vpImageFilter::vpCannyFilteringAndGradientType &type) |
| template<typename FilterType> | |
| static void | getGradY (const vpImage< unsigned char > &I, vpImage< FilterType > &dIy, const vpImage< bool > *p_mask=nullptr) |
| template<typename ImageType, typename FilterType> | |
| static void | getGradY (const vpImage< ImageType > &I, vpImage< FilterType > &dIy, const FilterType *filter, unsigned int size, const vpImage< bool > *p_mask=nullptr) |
| template<typename ImageType, typename FilterType> | |
| static void | getGradYGauss2D (const vpImage< ImageType > &I, vpImage< FilterType > &dIy, const FilterType *gaussianKernel, const FilterType *gaussianDerivativeKernel, unsigned int size, const vpImage< bool > *p_mask=nullptr) |
| template<typename ArithmeticType, typename FilterType, bool useFullScale> | |
| static void | gradientFilterY (const vpImage< vpHSV< ArithmeticType, useFullScale > > &I, vpImage< FilterType > &GIy, const int &nbThread, const vpImage< bool > *p_mask, const vpImageFilter::vpCannyFilteringAndGradientType &type) |
| template<typename FilterType> | |
| static FilterType | getScharrKernelX (FilterType *filter, unsigned int size) |
| template<typename FilterType> | |
| static FilterType | getScharrKernelY (FilterType *filter, unsigned int size) |
| template<typename FilterType> | |
| static FilterType | getSobelKernelX (FilterType *filter, unsigned int size) |
| template<typename FilterType> | |
| static FilterType | getSobelKernelY (FilterType *filter, unsigned int size) |
| static float | median (const cv::Mat &cv_I) |
| static float | median (const vpImage< unsigned char > &Isrc) |
| static std::vector< float > | median (const vpImage< vpRGBa > &Isrc) |
| template<typename ArithmeticType, typename FilterType, bool useFullScale> | |
| static void | gradientFilter (const vpImage< vpHSV< ArithmeticType, useFullScale > > &I, vpImage< FilterType > &GIx, vpImage< FilterType > &GIy, const int &nbThread=-1, const vpImage< bool > *p_mask=nullptr, const vpImageFilter::vpCannyFilteringAndGradientType &type=CANNY_GBLUR_SCHARR_FILTERING) |
Various image filter, convolution, etc...
Tutorials
If you are interested in applying various filters on an image, you may have a look at:
Definition at line 88 of file vpImageFilter.h.
Canny filter backends for the edge detection operations.
| typedef enum vpImageFilter::vpCannyFilteringAndGradientType vpImageFilter::vpCannyFilteringAndGradientType |
Canny filter and gradient operators to apply on the image before the edge detection stage.
Canny filter backends for the edge detection operations.
| Enumerator | |
|---|---|
| CANNY_OPENCV_BACKEND | Use OpenCV. |
| CANNY_VISP_BACKEND | Use ViSP. |
| CANNY_COUNT_BACKEND | |
Definition at line 92 of file vpImageFilter.h.
Canny filter and gradient operators to apply on the image before the edge detection stage.
Definition at line 107 of file vpImageFilter.h.
|
static |
Apply the Canny edge operator on the image Isrc and return the resulting image Ires.
The following example shows how to use the method:
| [in] | Isrc | : Image to apply the Canny edge detector to. |
| [out] | Ires | : Filtered image (255 means an edge, 0 otherwise). |
| [in] | gaussianFilterSize | : The size of the mask of the Gaussian filter to apply (an odd number). |
| [in] | lowerThreshold | : The lower threshold for the Canny operator. Values lower than this value are rejected. If negative, it will be set to one third of the thresholdCanny . |
| [in] | upperThreshold | : The upper threshold for the Canny operator. Only value greater than this value are marked as an edge. If negative, it will be automatically computed, along with the lower threshold. Otherwise, the lower threshold will be set to one third of the thresholdCanny . |
| [in] | apertureSobel | : Size of the mask for the Sobel operator (odd number). |
Definition at line 384 of file vpImageFilter_canny.cpp.
References canny(), CANNY_GBLUR_SOBEL_FILTERING, CANNY_OPENCV_BACKEND, and CANNY_VISP_BACKEND.
|
static |
Apply the Canny edge operator on the image Isrc and return the resulting image Ires.
The following example shows how to use the method:
| [in] | Isrc | : Image to apply the Canny edge detector to. |
| [out] | Ires | : Filtered image (255 means an edge, 0 otherwise). |
| [in] | gaussianFilterSize | : The size of the mask of the Gaussian filter to apply (an odd number). |
| [in] | lowerThreshold | : The lower threshold for the Canny operator. Values lower than this value are rejected. If negative, it will be set to one third of the thresholdCanny. |
| [in] | upperThreshold | : The upper threshold for the Canny operator. Only value greater than this value are marked as an edge. If negative, it will be automatically computed, along with the lower threshold. Otherwise, the lower threshold will be set to one third of the upper threshold. |
| [in] | apertureGradient | : Size of the mask for the gradient (Sobel or Scharr) operator (odd number). |
| [in] | gaussianStdev | : The standard deviation of the Gaussian filter to apply. If it is non-positive, it is computed from kernel size (gaussianKernelSize parameter) as |
| [in] | lowerThresholdRatio | : The ratio of the upper threshold the lower threshold must be equal to. It is used only if the user asks to compute the Canny thresholds. |
| [in] | upperThresholdRatio | : The ratio of pixels whose absolute gradient is lower or equal to define the upper threshold. It is used only if the user asks to compute the Canny thresholds. |
| [in] | normalizeGradients | : Needs to be true if asking to compute the upperThreshold, otherwise it depends on the user application and user-defined thresholds. |
| [in] | cannyBackend | : The backend to use to perform the Canny edge filtering. |
| [in] | cannyFilteringSteps | : The filtering + gradient operators to apply to compute the gradient in the early stage of the Canny algorithm. |
| [in] | p_mask | : Optional image mask that indicates where Canny edge detection has to be computed. |
Definition at line 470 of file vpImageFilter_canny.cpp.
References vpException::badValue, CANNY_OPENCV_BACKEND, CANNY_VISP_BACKEND, computeCannyThreshold(), computePartialDerivatives(), vpImageConvert::convert(), vpCannyEdgeDetection::detect(), vpCannyEdgeDetection::setGradients(), and vpCannyEdgeDetection::setMask().
|
static |
Apply the Canny edge operator on the image Isrc and return the resulting image Ires.
The following example shows how to use the method:
| [in] | Isrc | : Image to apply the Canny edge detector to. |
| [out] | Ires | : Filtered image (255 means an edge, 0 otherwise). |
| [in] | gaussianFilterSize | : The size of the mask of the Gaussian filter to apply (an odd number). |
| [in] | thresholdCanny | : The upper threshold for the Canny operator. Only value greater than this value are marked as an edge. If negative, it will be automatically computed, along with the lower threshold. Otherwise, the lower threshold will be set to one third of the thresholdCanny . |
| [in] | apertureSobel | : Size of the mask for the Sobel operator (odd number). |
Definition at line 330 of file vpImageFilter_canny.cpp.
References canny().
Referenced by canny(), canny(), vpCircleHoughTransform::edgeDetection(), and vpMeNurbs::seekExtremitiesCanny().
|
static |
Compute the upper Canny edge filter threshold, using Gaussian blur + Sobel or + Scharr operators to compute the gradient of the image.
| [in] | cv_I | : The image, in cv format. |
| [in] | p_cv_dIx | : If different from nullptr, the gradient of cv_I with regard to the horizontal axis. |
| [in] | p_cv_dIy | : If different from nullptr, the gradient of cv_I with regard to the vertical axis. |
| [out] | lowerThresh | : The lower threshold for the Canny edge filter. |
| [in] | gaussianKernelSize | : The size of the mask of the Gaussian filter to apply (an odd number). |
| [in] | gaussianStdev | : The standard deviation of the Gaussian filter to apply. |
| [in] | apertureGradient | : Size of the mask for the Sobel operator (odd number). |
| [in] | lowerThresholdRatio | : The ratio of the upper threshold the lower threshold must be equal to. |
| [in] | upperThresholdRatio | : The ratio of pixels whose absolute gradient Gabs is lower or equal to to define |
| [in] | filteringType | : The gradient filter to apply to compute the gradient, if p_cv_dIx and p_cv_dIy are nullptr. the upper threshold. |
Definition at line 204 of file vpImageFilter_canny.cpp.
References computePartialDerivatives(), and vpException::fatalError.
Referenced by canny(), vpCannyEdgeDetection::detect(), and vpCannyEdgeDetection::detect().
|
inlinestatic |
Compute the upper Canny edge filter threshold, using Gaussian blur + Sobel or + Scharr operators to compute the gradient of the image.
| OutType | : Either float, to accelerate the computation time, or double, to have greater precision. |
| [in] | I | : The gray-scale image, in ViSP format. |
| [in] | p_dIx | : If different from nullptr, must contain the gradient of the image with regard to the horizontal axis. |
| [in] | p_dIy | : If different from nullptr, must contain the gradient of the image with regard to the vertical axis. |
| [in] | lowerThresh | : Canny lower threshold. |
| [in] | gaussianKernelSize | : The size of the mask of the Gaussian filter to apply (an odd number). |
| [in] | gaussianStdev | : The standard deviation of the Gaussian filter to apply. |
| [in] | apertureGradient | : Size of the mask for the Sobel operator (odd number). |
| [in] | lowerThresholdRatio | : The ratio of the upper threshold the lower threshold must be equal to. |
| [in] | upperThresholdRatio | : The ratio of pixels whose absolute gradient Gabs is lower or equal to define the upper threshold. |
| [in] | filteringType | : The gradient filter to apply to compute the gradient, if p_dIx and p_dIy are nullptr. |
| [in] | p_mask | : If different from nullptr , only the pixels for which p_mask is true will be considered. |
Definition at line 349 of file vpImageFilter.h.
References vpImage< Type >::bitmap, vpHistogram::calculate(), CANNY_GBLUR_SOBEL_FILTERING, CANNY_VISP_BACKEND, computePartialDerivatives(), vpException::fatalError, vpHistogram::getTotal(), and vpHistogram::setMask().
|
inlinestatic |
Compute the upper Canny edge filter threshold for a HSV image.
| ArithmeticType | : The type of encoding of the channels of the HSV image. |
| useFullScale | : When using unsigned char, true means that Hue is encoded on the range [0; 255], otherwise it uses the limited range as defined in the vpHSV class. |
| OutType | : Either float, to accelerate the computation time, or double, to have greater precision. |
| [in] | I | : The HSV image. |
| [in] | p_dIx | : If different from nullptr, must contain the gradient of the image with regard to the horizontal axis. |
| [in] | p_dIy | : If different from nullptr, must contain the gradient of the image with regard to the vertical axis. |
| [in] | lowerThresh | : Canny lower threshold. |
| [in] | gaussianKernelSize | : The size of the mask of the Gaussian filter to apply (an odd number). |
| [in] | gaussianStdev | : The standard deviation of the Gaussian filter to apply. |
| [in] | lowerThresholdRatio | : The ratio of the upper threshold the lower threshold must be equal to. |
| [in] | upperThresholdRatio | : The ratio of pixels whose absolute gradient Gabs is lower or equal to define the upper threshold. |
| [in] | filteringType | : Canny filter type. |
| [in] | p_mask | : If different from nullptr , only the pixels for which p_mask is true will be considered. |
Definition at line 466 of file vpImageFilter.h.
References vpImage< Type >::bitmap, vpHistogram::calculate(), CANNY_GBLUR_SOBEL_FILTERING, vpException::fatalError, gaussianBlur(), vpHistogram::getTotal(), gradientFilter(), and vpHistogram::setMask().
|
static |
Compute the partial derivatives (i.e. horizontal and vertical gradients) of the input image.
| [in] | cv_I | The input image we want the partial derivatives. |
| [out] | cv_dIx | The horizontal partial derivative, i.e. horizontal gradient. |
| [out] | cv_dIy | The vertical partial derivative, i.e. vertical gradient. |
| [in] | computeDx | Indicate if we must compute the horizontal gradient. |
| [in] | computeDy | Indicate if we must compute the vertical gradient. |
| [in] | normalize | Indicate if we must normalize the gradient filters. |
| [in] | gaussianKernelSize | The size of the kernel of the Gaussian filter used to blur the image. |
| [in] | gaussianStdev | The standard deviation of the Gaussian filter used to blur the image. If it is non-positive, it is computed from kernel size (gaussianKernelSize parameter) as |
| [in] | apertureGradient | The size of the kernel of the gradient filter. |
| [in] | filteringType | The type of filters to apply to compute the gradients. |
Definition at line 588 of file vpImageFilter.cpp.
References CANNY_GBLUR_SCHARR_FILTERING, and CANNY_GBLUR_SOBEL_FILTERING.
Referenced by canny(), computeCannyThreshold(), computeCannyThreshold(), computePartialDerivatives(), and computePartialDerivatives().
|
inlinestatic |
Compute the partial derivatives (i.e. horizontal and vertical gradients) of the input image.
| ImageType | Either unsigned char, float or double |
| FilterType | Either float or double. |
| [in] | I | The input image we want the partial derivatives. |
| [out] | dIx | The horizontal partial derivative, i.e. horizontal gradient. |
| [out] | dIy | The vertical partial derivative, i.e. vertical gradient. |
| [in] | computeDx | Indicate if we must compute the horizontal gradient. |
| [in] | computeDy | Indicate if we must compute the vertical gradient. |
| [in] | normalize | Indicate if we must normalize the gradient filters. |
| [in] | gaussianKernelSize | The size of the kernel of the Gaussian filter used to blur the image. If it is non-positive, it is computed from kernel size (gaussianKernelSize parameter) as |
| [in] | gaussianStdev | The standard deviation of the Gaussian filter used to blur the image. |
| [in] | apertureGradient | The size of the kernel of the gradient filter. |
| [in] | filteringType | The type of filters to apply to compute the gradients. |
| [in] | backend | The type of backend to use to compute the gradients. |
| [in] | p_mask | If different from nullptr, mask indicating which points to consider (true) or to ignore(false). |
Definition at line 171 of file vpImageFilter.h.
References vpException::badValue, CANNY_GBLUR_SCHARR_FILTERING, CANNY_GBLUR_SOBEL_FILTERING, CANNY_OPENCV_BACKEND, CANNY_VISP_BACKEND, computePartialDerivatives(), vpImageConvert::convert(), filter(), gaussianBlur(), getScharrKernelX(), getScharrKernelY(), getSobelKernelX(), getSobelKernelY(), gradientFilterX(), gradientFilterY(), vpException::notImplementedError, vpImage< Type >::resize(), and vpCannyFiltAndGradTypeToStr().
|
inlinestaticdelete |
References CANNY_GBLUR_SOBEL_FILTERING, and CANNY_VISP_BACKEND.
|
inlinestaticdelete |
References CANNY_GBLUR_SOBEL_FILTERING, CANNY_VISP_BACKEND, and computePartialDerivatives().
|
inlinestaticdelete |
References CANNY_GBLUR_SOBEL_FILTERING, and CANNY_VISP_BACKEND.
|
inlinestatic |
Apply a 1x3 derivative filter to an image pixel.
| I | : Image to filter |
| r | : coordinates (row) of the pixel |
| c | : coordinates (column) of the pixel |
Definition at line 608 of file vpImageFilter.h.
Referenced by vpFeatureLuminance::buildFrom(), getGradX(), and getGradX().
|
inlinestatic |
Apply a 1 x size Derivative Filter in X to an image pixel.
| FilterType | : Either float, to accelerate the computation time, or double, to have greater precision. |
| I | : Image to filter |
| r | : Coordinates(row) of the pixel |
| c | : Coordinates(column) of the pixel |
| filter | : Coefficients of the filter to be initialized using vpImageFilter::getGaussianDerivativeKernel(). |
| size | : Size of the filter. |
Definition at line 643 of file vpImageFilter.h.
References filter().
|
inlinestatic |
Apply a 3x1 derivative filter to an image pixel.
| I | : Image to filter |
| r | : coordinates (row) of the pixel |
| c | : coordinates (column) of the pixel |
Definition at line 622 of file vpImageFilter.h.
Referenced by vpFeatureLuminance::buildFrom(), getGradY(), and getGradY().
|
inlinestatic |
Apply a size x 1 Derivative Filter in Y to an image pixel.
| FilterType | : Either float, to accelerate the computation time, or double, to have greater precision. |
| I | : Image to filter. |
| r | : Coordinates (row) of the pixel. |
| c | : Coordinates (column) of the pixel. |
| filter | : Coefficients of the filter to be initialized using vpImageFilter::getGaussianDerivativeKernel(). |
| size | : Size of the filter. |
Definition at line 671 of file vpImageFilter.h.
References filter().
|
inlinestatic |
Apply a filter at a given image location.
| FilterType | Image and filter types: double or float |
| I | The input image |
| row | The row coordinate where the filter should be applied |
| col | The column coordinate where the filter should be applied |
| M | the filter |
Definition at line 780 of file vpImageFilter.h.
References vpArray2D< Type >::getCols(), and vpArray2D< Type >::getRows().
|
inlinestatic |
Apply a separable filter.
| FilterType | : Either float, to accelerate the computation time, or double, to have greater precision. |
| I | : The original image. |
| GI | : The filtered image. |
| filter | : The separable filter. |
| size | : The size of the filter. |
| p_mask | : If different from nullptr, mask indicating which points to consider (true) or to ignore(false). |
Definition at line 904 of file vpImageFilter.h.
References vpImage< Type >::destroy(), filter(), filterX(), and filterY().
|
inlinestatic |
Apply a filter to an image.
| FilterType | : Either float, to accelerate the computation time, or double, to have greater precision. |
| I | : Image to filter |
| If | : Filtered image. |
| M | : Filter kernel. |
| convolve | : If true, perform a convolution otherwise a correlation. |
| p_mask | : If different from nullptr, mask indicating which points to consider (true) or to ignore(false). |
Definition at line 715 of file vpImageFilter.h.
References vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), and vpImage< Type >::resize().
Referenced by vpCircleHoughTransform::computeGradients(), computePartialDerivatives(), derivativeFilterX(), derivativeFilterY(), filter(), filter(), filter(), filterX(), filterX(), filterY(), filterY(), vpTemplateTracker::getGaussianBluredImage(), getGaussianDerivativeKernel(), getGaussianKernel(), getGradX(), getGradY(), vpTemplateTrackerMI::getMI(), vpTemplateTrackerMI::getMI256(), getScharrKernelX(), getScharrKernelY(), getSobelKernelX(), getSobelKernelY(), gradientFilterX(), gradientFilterY(), vpTemplateTrackerMIESM::initHessienDesired(), vpTemplateTrackerMIForwardAdditional::initHessienDesired(), vpTemplateTrackerMIForwardCompositional::initHessienDesired(), vpTemplateTrackerMIInverseCompositional::initHessienDesired(), vpTemplateTrackerZNCCForwardAdditional::initHessienDesired(), vpTemplateTrackerZNCCInverseCompositional::initHessienDesired(), vpTemplateTracker::initTracking(), vpTemplateTrackerMIESM::trackNoPyr(), vpTemplateTrackerMIForwardAdditional::trackNoPyr(), vpTemplateTrackerMIForwardCompositional::trackNoPyr(), vpTemplateTrackerMIInverseCompositional::trackNoPyr(), vpTemplateTrackerSSDESM::trackNoPyr(), vpTemplateTrackerSSDForwardAdditional::trackNoPyr(), vpTemplateTrackerSSDForwardCompositional::trackNoPyr(), vpTemplateTrackerSSDInverseCompositional::trackNoPyr(), vpTemplateTrackerZNCCForwardAdditional::trackNoPyr(), and vpTemplateTrackerZNCCInverseCompositional::trackNoPyr().
|
inlinestatic |
Apply a filter to an image:
| FilterType | : Either float, to accelerate the computation time, or double, to have greater precision. |
| I | : Image to filter |
| Iu | : Filtered image along the horizontal axis (u = columns). |
| Iv | : Filtered image along the vertical axis (v = rows). |
| M | : Filter kernel. |
| convolve | : If true, perform a convolution otherwise a correlation. |
| p_mask | : If different from nullptr, mask indicating which points to consider (true) or to ignore(false). |
Definition at line 817 of file vpImageFilter.h.
References vpArray2D< Type >::getRows(), and vpImage< Type >::resize().
|
staticdelete |
References filter(), and sepFilter().
|
staticdelete |
References filter().
|
staticdelete |
|
inlinestatic |
Definition at line 912 of file vpImageFilter.h.
Referenced by getGaussXPyramidal().
|
inlinestatic |
Definition at line 917 of file vpImageFilter.h.
Referenced by getGaussYPyramidal().
|
inlinestatic |
Filter along the horizontal direction "in the middle" of the image (i.e not on a border).
| ImageType | The type of pixels. In this case, it must be a color type (vpRGBa, vpHSV). |
| OutputType | The type of pixels in the resulting image. It can be an arithmetic type or a color type (vpRGBa, vpHSV). |
| FilterType | An arithmetic type. |
| [in] | I | The image that must be filtered. |
| [in] | result | The pixel resulting from the filtering operation. |
| [in] | r | The row index. |
| [in] | c | The column index. |
| [in] | filter | The coefficients of the filter. |
| [in] | size | The size of the filter. |
Definition at line 1203 of file vpImageFilter.h.
References filter().
|
inlinestatic |
Filter along the horizontal direction "in the middle" of the image (i.e not on a border).
| ImageType | The type of pixels. In this case, it must be an arithmetic type. |
| OutputType | The type of pixels in the resulting image. In this case, it must be an arithmetic type. |
| FilterType | An arithmetic type. |
| [in] | I | The image that must be filtered. |
| [in] | result | The pixel resulting from the filtering operation. |
| [in] | r | The row index. |
| [in] | c | The column index. |
| [in] | filter | The coefficients of the filter. |
| [in] | size | The size of the filter. |
Definition at line 1176 of file vpImageFilter.h.
References filter().
|
inlinestatic |
Filter along the horizontal direction.
| ImageType | The type of pixels. It can be an arithmetic type or a color type (vpRGBa, vpHSV). |
| OutputType | The type of pixels in the resulting image. It can be an arithmetic type or a color type (vpRGBa, vpHSV). |
| FilterType | An arithmetic type. |
| [in] | I | The image that must be filtered. |
| [in] | dIx | The image filtered along the horizontal direction. |
| [in] | filter | The coefficients of the filter. |
| [in] | size | The size of the filter. |
| [in] | p_mask | A boolean mask that permits to select the pixels that must be filtered if different from nullptr, unused otherwise. |
Definition at line 1102 of file vpImageFilter.h.
References filter(), and filterX().
Referenced by vpCircleHoughTransform::computeGradients(), filter(), filterX(), gaussianBlur(), and getGradYGauss2D().
|
inlinestatic |
Filter along the vertical direction "in the middle" of the image (i.e not on a border).
| ImageType | The type of pixels. In this case, it must be a color type (vpRGBa, vpHSV). |
| OutputType | The type of pixels in the resulting image. It can be an arithmetic type or a color type (vpRGBa, vpHSV). |
| FilterType | An arithmetic type. |
| [in] | I | The image that must be filtered. |
| [in] | result | The pixel resulting from the filtering operation. |
| [in] | r | The row index. |
| [in] | c | The column index. |
| [in] | filter | The coefficients of the filter. |
| [in] | size | The size of the filter. |
Definition at line 1596 of file vpImageFilter.h.
References filter().
|
inlinestatic |
Filter along the vertical direction "in the middle" of the image (i.e not on a border).
| ImageType | The type of pixels. In this case, it must be an arithmetic type. |
| OutputType | The type of pixels in the resulting image. In this case, it must be an arithmetic type. |
| FilterType | An arithmetic type. |
| [in] | I | The image that must be filtered. |
| [in] | result | The pixel resulting from the filtering operation. |
| [in] | r | The row index. |
| [in] | c | The column index. |
| [in] | filter | The coefficients of the filter. |
| [in] | size | The size of the filter. |
Definition at line 1569 of file vpImageFilter.h.
References filter().
|
inlinestatic |
Filter along the vertical direction.
| ImageType | The type of pixels. It can be an arithmetic type or a color type (vpRGBa, vpHSV). |
| OutputType | The type of pixels in the resulting image. It can be an arithmetic type or a color type (vpRGBa, vpHSV). |
| FilterType | An arithmetic type. |
| [in] | I | The image that must be filtered. |
| [in] | dIy | The image filtered along the vertical direction. |
| [in] | filter | The coefficients of the filter. |
| [in] | size | The size of the filter. |
| [in] | p_mask | A boolean mask that permits to select the pixels that must be filtered if different from nullptr, unused otherwise. |
Definition at line 1493 of file vpImageFilter.h.
References filter(), and filterY().
Referenced by vpCircleHoughTransform::computeGradients(), filter(), filterY(), gaussianBlur(), and getGradXGauss2D().
|
inlinestatic |
Apply a Gaussian blur to an image.
| ImageType | : Either an arithmetic type or a color image. |
| OutputType | : Either the same type than the ImageType, for color images, or an arithmetic type. |
| FilterType | : Either float, to accelerate the computation time, or double, to have greater precision. |
| I | : Input image. |
| GI | : Filtered image. |
| size | : Filter size. This value should be odd. |
| sigma | : Gaussian standard deviation. If it is equal to zero or negative, it is computed from filter size as sigma = (size-1)/6. |
| normalize | : Flag indicating whether to normalize the filter coefficients or not. |
| p_mask | : If different from nullptr, mask indicating which points to consider (true) or to ignore(false). |
Definition at line 1776 of file vpImageFilter.h.
References vpImage< Type >::destroy(), vpException::dimensionError, filterX(), filterY(), and getGaussianKernel().
Referenced by computeCannyThreshold(), computePartialDerivatives(), vpCannyEdgeDetection::detect(), VISP_NAMESPACE_NAME::gammaCorrectionSpatialBased(), VISP_NAMESPACE_NAME::gammaCorrectionSpatialBased(), VISP_NAMESPACE_NAME::MSRCR(), VISP_NAMESPACE_NAME::unsharpMask(), and VISP_NAMESPACE_NAME::unsharpMask().
|
inlinestatic |
Apply a 5x5 Gaussian filter to an image pixel.
| fr | : Image to filter |
| r | : coordinates (row) of the pixel |
| c | : coordinates (column) of the pixel |
Definition at line 1837 of file vpImageFilter.h.
|
inlinestatic |
Return the coefficients of a Gaussian derivative filter that may be used to compute spatial image derivatives after applying a Gaussian blur.
| FilterType | : Either float, to accelerate the computation time, or double, to have greater precision. |
| filter | : Pointer to the filter kernel that should refer to a (size+1)/2 array. The first value refers to the central coefficient, the next one to the right coefficients. Left coefficients could be deduced by symmetry. |
| size | : Filter size. This value should be odd. |
| sigma | : Gaussian standard deviation. If it is equal to zero or negative, it is computed from filter size as sigma = (size-1)/6. |
| normalize | : Flag indicating whether to normalize the filter coefficients or not. |
Definition at line 1918 of file vpImageFilter.h.
References filter(), vpImageException::incorrectInitializationError, and vpMath::sqr().
Referenced by vpTemplateTracker::setGaussianFilterSize(), and vpTemplateTracker::vpTemplateTracker().
|
inlinestatic |
Return the coefficients
of a Gaussian filter.
| FilterType | : Either float, to accelerate the computation time, or double, to have greater precision. |
| [out] | filter | : Pointer to the half size filter kernel that should refer to a (size+1)/2 array. The first value refers to the central coefficient, the next one to the right coefficients. Left coefficients could be deduced by symmetry. |
| [in] | size | : Filter size. This value should be odd and positive. |
| [in] | sigma | : Gaussian standard deviation |
| [in] | normalize | : Flag indicating whether to normalize the filter coefficients or not. In that case |
The function computes the (size+1)/2 values of the Gaussian filter coefficients
as:
Definition at line 1870 of file vpImageFilter.h.
References filter(), vpImageException::incorrectInitializationError, and vpMath::sqr().
Referenced by gaussianBlur(), vpCircleHoughTransform::initGaussianFilters(), vpTemplateTracker::setGaussianFilterSize(), and vpTemplateTracker::vpTemplateTracker().
|
static |
Definition at line 429 of file vpImageFilter.cpp.
References vpImageConvert::convert(), getGaussXPyramidal(), and getGaussYPyramidal().
Referenced by vpTemplateTracker::initHessienDesiredPyr(), vpTemplateTracker::initTrackingPyr(), and vpTemplateTracker::trackPyr().
|
static |
Definition at line 450 of file vpImageFilter.cpp.
References filterGaussXPyramidal(), and vpImage< Type >::resize().
Referenced by getGaussPyramidal().
|
static |
Definition at line 466 of file vpImageFilter.cpp.
References filterGaussYPyramidal(), and vpImage< Type >::resize().
Referenced by getGaussPyramidal().
|
inlinestatic |
Definition at line 1993 of file vpImageFilter.h.
References derivativeFilterX(), and filter().
|
inlinestatic |
Definition at line 1959 of file vpImageFilter.h.
References derivativeFilterX().
Referenced by getGradXGauss2D(), vpTemplateTrackerMIInverseCompositional::initCompInverse(), vpTemplateTrackerMIESM::initHessienDesired(), vpTemplateTrackerZNCCForwardAdditional::initHessienDesired(), and vpTemplateTrackerZNCCInverseCompositional::initHessienDesired().
|
inlinestatic |
Compute the gradient along X after applying a gaussian filter along Y.
| FilterType | : Either float, to accelerate the computation time, or double, to have greater precision. |
| I | : Input image |
| dIx | : Gradient along X. |
| gaussianKernel | : Gaussian kernel which values should be computed using vpImageFilter::getGaussianKernel(). |
| gaussianDerivativeKernel | : Gaussian derivative kernel which values should be computed using vpImageFilter::getGaussianDerivativeKernel(). |
| size | : Size of the Gaussian and Gaussian derivative kernels. |
| p_mask | : If different from nullptr, mask indicating which points to consider (true) or to ignore(false). |
Definition at line 2038 of file vpImageFilter.h.
References filterY(), and getGradX().
Referenced by vpTemplateTrackerMIInverseCompositional::initCompInverse(), vpTemplateTrackerZNCCInverseCompositional::initCompInverse(), vpTemplateTrackerMIESM::initHessienDesired(), vpTemplateTrackerMIForwardAdditional::initHessienDesired(), vpTemplateTrackerMIForwardCompositional::initHessienDesired(), vpTemplateTrackerZNCCForwardAdditional::initHessienDesired(), vpTemplateTrackerZNCCInverseCompositional::initHessienDesired(), vpTemplateTracker::initTracking(), vpTemplateTrackerMIESM::trackNoPyr(), vpTemplateTrackerMIForwardAdditional::trackNoPyr(), vpTemplateTrackerMIForwardCompositional::trackNoPyr(), vpTemplateTrackerSSDESM::trackNoPyr(), vpTemplateTrackerSSDForwardAdditional::trackNoPyr(), vpTemplateTrackerSSDForwardCompositional::trackNoPyr(), and vpTemplateTrackerZNCCForwardAdditional::trackNoPyr().
|
inlinestatic |
Definition at line 2138 of file vpImageFilter.h.
References derivativeFilterY(), and filter().
|
inlinestatic |
Definition at line 2099 of file vpImageFilter.h.
References derivativeFilterY().
Referenced by getGradYGauss2D(), vpTemplateTrackerMIInverseCompositional::initCompInverse(), vpTemplateTrackerMIESM::initHessienDesired(), vpTemplateTrackerZNCCForwardAdditional::initHessienDesired(), and vpTemplateTrackerZNCCInverseCompositional::initHessienDesired().
|
inlinestatic |
Compute the gradient along Y after applying a gaussian filter along X.
| FilterType | : Either float, to accelerate the computation time, or double, to have greater precision. |
| I | : Input image |
| dIy | : Gradient along Y. |
| gaussianKernel | : Gaussian kernel which values should be computed using vpImageFilter::getGaussianKernel(). |
| gaussianDerivativeKernel | : Gaussian derivative kernel which values should be computed using vpImageFilter::getGaussianDerivativeKernel(). |
| size | : Size of the Gaussian and Gaussian derivative kernels. |
| p_mask | : If different from nullptr, mask indicating which points to consider (true) or to ignore(false). |
Definition at line 2189 of file vpImageFilter.h.
References filterX(), and getGradY().
Referenced by vpTemplateTrackerMIInverseCompositional::initCompInverse(), vpTemplateTrackerZNCCInverseCompositional::initCompInverse(), vpTemplateTrackerMIESM::initHessienDesired(), vpTemplateTrackerMIForwardAdditional::initHessienDesired(), vpTemplateTrackerMIForwardCompositional::initHessienDesired(), vpTemplateTrackerZNCCForwardAdditional::initHessienDesired(), vpTemplateTrackerZNCCInverseCompositional::initHessienDesired(), vpTemplateTracker::initTracking(), vpTemplateTrackerMIESM::trackNoPyr(), vpTemplateTrackerMIForwardAdditional::trackNoPyr(), vpTemplateTrackerMIForwardCompositional::trackNoPyr(), vpTemplateTrackerSSDESM::trackNoPyr(), vpTemplateTrackerSSDForwardAdditional::trackNoPyr(), vpTemplateTrackerSSDForwardCompositional::trackNoPyr(), and vpTemplateTrackerZNCCForwardAdditional::trackNoPyr().
|
inlinestatic |
Get Scharr kernel for X-direction.
| FilterType | : Either float, to accelerate the computation time, or double, to have greater precision. |
| filter | : Pointer to a double array already allocated. |
| size | : Kernel size computed as: kernel_size = size*2 + 1 (max size is 20). |
Definition at line 2260 of file vpImageFilter.h.
References vpArray2D< Type >::data, vpException::dimensionError, filter(), vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), getScharrKernelY(), and vpArray2D< Type >::t().
Referenced by computePartialDerivatives(), and vpCircleHoughTransform::initGradientFilters().
|
inlinestatic |
Get Scharr kernel for Y-direction.
| FilterType | : Either float, to accelerate the computation time, or double, to have greater precision. |
| filter | : Pointer to a double array already allocated. |
| size | : Kernel size computed as: kernel_size = size*2 + 1 (max size is 20). |
Definition at line 2284 of file vpImageFilter.h.
References vpException::dimensionError, and filter().
Referenced by computePartialDerivatives(), getScharrKernelX(), and vpCircleHoughTransform::initGradientFilters().
|
inlinestatic |
Get Sobel kernel for X-direction.
| FilterType | Either float, to accelerate the computation time, or double, to have greater precision. |
| filter | : Pointer to a double array already allocated. |
| size | : Kernel size computed as: kernel_size = size*2 + 1 (max size is 20). |
Definition at line 2314 of file vpImageFilter.h.
References vpArray2D< Type >::data, vpException::dimensionError, filter(), vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), getSobelKernelY(), and vpArray2D< Type >::t().
Referenced by computePartialDerivatives(), vpCircleHoughTransform::initGradientFilters(), vpMbTracker::setProjectionErrorKernelSize(), and vpMbTracker::vpMbTracker().
|
inlinestatic |
Get Sobel kernel for Y-direction.
| FilterType | : Either float, to accelerate the computation time, or double, to have greater precision. |
| filter | : Pointer to a double array already allocated. |
| size | : Kernel size computed as: kernel_size = size*2 + 1 (max size is 20). |
Definition at line 2339 of file vpImageFilter.h.
References vpArray2D< Type >::conv2(), vpArray2D< Type >::data, vpException::dimensionError, filter(), vpArray2D< Type >::getCols(), and vpArray2D< Type >::getRows().
Referenced by computePartialDerivatives(), getSobelKernelX(), vpCircleHoughTransform::initGradientFilters(), vpMbTracker::setProjectionErrorKernelSize(), and vpMbTracker::vpMbTracker().
|
inlinestatic |
Compute the horizontal and vertical gradients for HSV images.
| ArithmeticType | The encoding of the HSV channels. |
| FilterType | The type to use for the filter and the type of the resulting gradient image. |
| useFullScale | See the documentation of the vpHSV class to have details on this template parameter. |
| [in] | I | The input image. |
| [in] | GIx | The resulting gradient image along the X-axis. |
| [in] | GIy | The resulting gradient image along the Y-axis. |
| [in] | nbThread | The number of threads to use to compute the gradient. |
| [in] | p_mask | Optional boolean mask to indicate which pixels should be considered and which should be ignored. |
| [in] | type | The type of the gradient filter. |
Definition at line 2422 of file vpImageFilter.h.
References CANNY_GBLUR_SCHARR_FILTERING, gradientFilterX(), gradientFilterY(), and vpImage< Type >::resize().
Referenced by computeCannyThreshold(), and vpCannyEdgeDetection::detect().
|
inlinestatic |
Gradient filter along the X-axis for HSV images.
| ArithmeticType | The encoding of the HSV channels. |
| FilterType | The type to use for the filter and the type of the resulting gradient image. |
| useFullScale | See the documentation of the vpHSV class to have details on this template parameter. |
| [in] | I | The input image. |
| [in] | GIx | The resulting gradient image along the X-axis. |
| [in] | nbThread | The number of threads to use to compute the gradient. |
| [in] | p_mask | Optional boolean mask to indicate which pixels should be considered and which should be ignored. |
| [in] | type | The type of the gradient filter. |
Definition at line 2060 of file vpImageFilter.h.
References vpException::badValue, CANNY_GBLUR_SCHARR_FILTERING, CANNY_GBLUR_SOBEL_FILTERING, filter(), and vpImage< Type >::resize().
Referenced by computePartialDerivatives(), and gradientFilter().
|
inlinestatic |
Gradient filter along the Y-axis for HSV images.
| ArithmeticType | The encoding of the HSV channels. |
| FilterType | The type to use for the filter and the type of the resulting gradient image. |
| useFullScale | See the documentation of the vpHSV class to have details on this template parameter. |
| [in] | I | The input image. |
| [in] | GIy | The resulting gradient image along the Y-axis. |
| [in] | nbThread | The number of threads to use to compute the gradient. |
| [in] | p_mask | Optional boolean mask to indicate which pixels should be considered and which should be ignored. |
| [in] | type | The type of the gradient filter. |
Definition at line 2211 of file vpImageFilter.h.
References vpException::badValue, CANNY_COUNT_FILTERING, CANNY_GBLUR_SCHARR_FILTERING, CANNY_GBLUR_SOBEL_FILTERING, filter(), and vpImage< Type >::resize().
Referenced by computePartialDerivatives(), and gradientFilter().
|
static |
Calculates the median value of a single channel. The algorithm is based on based on https://github.com/arnaudgelas/OpenCVExamples/blob/master/cvMat/Statistics/Median/Median.cpp.
| [in] | channel | : Single channel image in OpenCV format. |
Definition at line 507 of file vpImageFilter.cpp.
|
static |
Calculates the median value of a single channel. The algorithm is based on based on https://github.com/arnaudgelas/OpenCVExamples/blob/master/cvMat/Statistics/Median/Median.cpp.
| [in] | Isrc | : Gray-level image in ViSP format. |
Definition at line 540 of file vpImageFilter.cpp.
References vpImageConvert::convert(), and median().
Calculates the median value of a vpRGBa image. The result is ordered in RGB format.
| [in] | Isrc | : RGB image in ViSP format. Alpha channel is ignored. |
Definition at line 555 of file vpImageFilter.cpp.
References vpImageConvert::convert(), and median().
|
static |
Apply a filter to an image using two separable kernels. For instance, the Sobel kernel can be decomposed to:
Thus, the convolution operation can be performed as:
Using two separable kernels reduce the number of operations and can be faster for large kernels.
| [in] | I | : Image to filter |
| [out] | If | : Filtered image. |
| [in] | kernelH | : Separable kernel (performed first). |
| [in] | kernelV | : Separable kernel (performed last). |
Definition at line 129 of file vpImageFilter.cpp.
References vpImage< Type >::resize(), and vpArray2D< Type >::size().
Referenced by filter().
|
static |
Cast a string into a vpImageFilter::vpCannyBackendTypeToString.
| [in] | name | The name of the backend. |
Definition at line 95 of file vpImageFilter_canny.cpp.
References CANNY_COUNT_BACKEND, vpIoTools::toLowerCase(), and vpCannyBackendTypeToString().
Referenced by vpCircleHoughTransform::vpCircleHoughTransformParams::from_json.
|
static |
Get the list of available vpCannyBackendType.
| [in] | pref | The prefix of the list. |
| [in] | sep | The separator between two elements of the list. |
| [in] | suf | The suffix of the list. |
Definition at line 49 of file vpImageFilter_canny.cpp.
References CANNY_COUNT_BACKEND, and vpCannyBackendTypeToString().
|
static |
Cast a vpImageFilter::vpCannyBackendTypeToString into a string, to know its name.
| [in] | type | The type that must be casted into a string. |
Definition at line 70 of file vpImageFilter_canny.cpp.
References CANNY_COUNT_BACKEND, CANNY_OPENCV_BACKEND, CANNY_VISP_BACKEND, and vpException::fatalError.
Referenced by vpCircleHoughTransform::vpCircleHoughTransformParams::from_json, vpCircleHoughTransform::vpCircleHoughTransformParams::to_json, vpCircleHoughTransform::vpCircleHoughTransformParams::toString(), vpCannyBackendTypeFromString(), and vpCannyBackendTypeList().
|
static |
Cast a string into a vpImageFilter::vpCannyFilteringAndGradientType.
| [in] | name | The name of the backend. |
Definition at line 167 of file vpImageFilter_canny.cpp.
References CANNY_COUNT_FILTERING, vpIoTools::toLowerCase(), and vpCannyFiltAndGradTypeToStr().
Referenced by vpCannyEdgeDetection::from_json, and vpCircleHoughTransform::vpCircleHoughTransformParams::from_json.
|
static |
Cast a vpImageFilter::vpCannyFilteringAndGradientType into a string, to know its name.
| [in] | type | The type that must be casted into a string. |
Definition at line 142 of file vpImageFilter_canny.cpp.
References CANNY_COUNT_FILTERING, CANNY_GBLUR_SCHARR_FILTERING, CANNY_GBLUR_SOBEL_FILTERING, and vpException::fatalError.
Referenced by vpCircleHoughTransform::computeGradients(), computePartialDerivatives(), vpCannyEdgeDetection::from_json, vpCircleHoughTransform::vpCircleHoughTransformParams::from_json, vpCircleHoughTransform::initGradientFilters(), vpCannyEdgeDetection::to_json, vpCircleHoughTransform::vpCircleHoughTransformParams::to_json, vpCircleHoughTransform::vpCircleHoughTransformParams::toString(), vpCannyFiltAndGradTypeFromStr(), and vpGetCannyFiltAndGradTypes().
|
static |
Get the list of available vpCannyFilteringAndGradientType.
| [in] | pref | The prefix of the list. |
| [in] | sep | The separator between two elements of the list. |
| [in] | suf | The suffix of the list. |
Definition at line 121 of file vpImageFilter_canny.cpp.
References CANNY_COUNT_FILTERING, and vpCannyFiltAndGradTypeToStr().