Visual Servoing Platform
version 3.6.1 under development (2024-10-15)
|
#include <visp3/core/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.6, const float &upperThresholdRatio=0.8, 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) |
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) |
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) |
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.6, const float &upperThresholdRatio=0.8, 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) |
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) |
template<typename ImageType > | |
static void | filter (const vpImage< ImageType > &I, vpImage< ImageType > &Iu, vpImage< ImageType > &Iv, const vpArray2D< vpRGBa > &M, bool convolve) |
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 FilterType > | |
static void | filterX (const vpImage< ImageType > &I, vpImage< FilterType > &dIx, const FilterType *filter, unsigned int size, const vpImage< bool > *p_mask=nullptr) |
static void | filterX (const vpImage< vpRGBa > &I, vpImage< vpRGBa > &dIx, const double *filter, unsigned int size, const vpImage< bool > *p_mask=nullptr) |
template<typename ImageType , typename FilterType > | |
static FilterType | filterX (const vpImage< ImageType > &I, unsigned int r, unsigned int c, const FilterType *filter, unsigned int size) |
static void | filterY (const vpImage< vpRGBa > &I, vpImage< vpRGBa > &dIx, const double *filter, unsigned int size, const vpImage< bool > *p_mask=nullptr) |
template<typename ImageType , typename FilterType > | |
static void | filterY (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 FilterType | filterY (const vpImage< ImageType > &I, unsigned int r, unsigned int c, const FilterType *filter, unsigned int size) |
template<typename ImageType , typename FilterType > | |
static void | gaussianBlur (const vpImage< ImageType > &I, vpImage< FilterType > &GI, unsigned int size=7, FilterType sigma=0., bool normalize=true, const vpImage< bool > *p_mask=nullptr) |
static void | gaussianBlur (const vpImage< vpRGBa > &I, vpImage< vpRGBa > &GI, unsigned int size=7, double 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 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 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) |
Various image filter, convolution, etc...
Definition at line 70 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 74 of file vpImageFilter.h.
Canny filter and gradient operators to apply on the image before the edge detection stage.
Definition at line 89 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 350 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 436 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 296 of file vpImageFilter_canny.cpp.
Referenced by 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 200 of file vpImageFilter_canny.cpp.
References computePartialDerivatives().
Referenced by canny(), 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 331 of file vpImageFilter.h.
References vpHistogram::calculate(), CANNY_VISP_BACKEND, vpImage< Type >::getHeight(), vpHistogram::getTotal(), vpImage< Type >::getWidth(), 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 575 of file vpImageFilter.cpp.
References CANNY_GBLUR_SCHARR_FILTERING, and CANNY_GBLUR_SOBEL_FILTERING.
Referenced by canny(), and computeCannyThreshold().
|
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 153 of file vpImageFilter.h.
References vpException::badValue, vpImageConvert::convert(), vpArray2D< Type >::data, filter(), gaussianBlur(), vpArray2D< Type >::getCols(), vpImage< Type >::getHeight(), vpArray2D< Type >::getRows(), getScharrKernelX(), getScharrKernelY(), getSobelKernelX(), getSobelKernelY(), vpImage< Type >::getWidth(), vpException::notImplementedError, and vpImage< Type >::resize().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
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 402 of file vpImageFilter.h.
Referenced by vpFeatureLuminance::buildFrom(), 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 437 of file vpImageFilter.h.
|
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 416 of file vpImageFilter.h.
Referenced by vpFeatureLuminance::buildFrom(), 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 465 of file vpImageFilter.h.
|
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 574 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 698 of file vpImageFilter.h.
References vpImage< Type >::destroy().
|
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). |
The convolution is almost the same operation:
Only pixels in the input image fully covered by the kernel are considered.
Definition at line 509 of file vpImageFilter.h.
References vpArray2D< Type >::getCols(), vpImage< Type >::getHeight(), vpArray2D< Type >::getRows(), vpImage< Type >::getWidth(), and vpImage< Type >::resize().
Referenced by vpCircleHoughTransform::computeGradients(), computePartialDerivatives(), filterX(), filterY(), vpTemplateTracker::getGaussianBluredImage(), vpTemplateTrackerMI::getMI(), vpTemplateTrackerMI::getMI256(), vpTemplateTrackerZNCCForwardAdditional::initHessienDesired(), vpTemplateTrackerZNCCInverseCompositional::initHessienDesired(), vpTemplateTrackerMIESM::initHessienDesired(), vpTemplateTrackerMIForwardAdditional::initHessienDesired(), vpTemplateTrackerMIForwardCompositional::initHessienDesired(), vpTemplateTrackerMIInverseCompositional::initHessienDesired(), vpTemplateTracker::initTracking(), vpTemplateTrackerSSDESM::trackNoPyr(), vpTemplateTrackerSSDForwardAdditional::trackNoPyr(), vpTemplateTrackerSSDForwardCompositional::trackNoPyr(), vpTemplateTrackerSSDInverseCompositional::trackNoPyr(), vpTemplateTrackerZNCCForwardAdditional::trackNoPyr(), vpTemplateTrackerZNCCInverseCompositional::trackNoPyr(), vpTemplateTrackerMIESM::trackNoPyr(), vpTemplateTrackerMIForwardAdditional::trackNoPyr(), vpTemplateTrackerMIForwardCompositional::trackNoPyr(), and vpTemplateTrackerMIInverseCompositional::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 611 of file vpImageFilter.h.
References vpImage< Type >::getHeight(), vpArray2D< Type >::getRows(), vpImage< Type >::getWidth(), and vpImage< Type >::resize().
|
static |
|
static |
|
static |
|
inlinestatic |
Definition at line 706 of file vpImageFilter.h.
Referenced by getGaussXPyramidal().
|
inlinestatic |
Definition at line 711 of file vpImageFilter.h.
Referenced by getGaussYPyramidal().
|
inlinestatic |
Definition at line 758 of file vpImageFilter.h.
|
inlinestatic |
Definition at line 718 of file vpImageFilter.h.
References vpImage< Type >::getHeight(), and vpImage< Type >::getWidth().
Referenced by vpCircleHoughTransform::computeGradients(), and gaussianBlur().
|
static |
Definition at line 182 of file vpImageFilter.cpp.
References filter(), vpImage< Type >::getHeight(), and vpImage< Type >::getWidth().
|
inlinestatic |
Definition at line 868 of file vpImageFilter.h.
|
inlinestatic |
Definition at line 827 of file vpImageFilter.h.
References vpImage< Type >::getHeight(), and vpImage< Type >::getWidth().
|
static |
Definition at line 244 of file vpImageFilter.cpp.
References filter(), vpImage< Type >::getHeight(), and vpImage< Type >::getWidth().
Referenced by vpCircleHoughTransform::computeGradients(), and gaussianBlur().
|
inlinestatic |
Apply a Gaussian blur to an image.
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 947 of file vpImageFilter.h.
References vpImage< Type >::destroy().
Referenced by computePartialDerivatives(), VISP_NAMESPACE_NAME::gammaCorrectionSpatialBased(), VISP_NAMESPACE_NAME::MSRCR(), and VISP_NAMESPACE_NAME::unsharpMask().
|
static |
Apply a Gaussian blur to RGB color image.
[in] | I | : Input image. |
[out] | GI | : Filtered image. |
[in] | size | : Filter size. This value should be odd. |
[in] | sigma | : Gaussian standard deviation. If it is equal to zero or negative, it is computed from filter size as sigma = (size-1)/6. |
[in] | normalize | : Flag indicating whether to normalize the filter coefficients or not. |
[in] | p_mask | : If different from nullptr, mask indicating which points to consider (true) or to ignore(false). |
Definition at line 320 of file vpImageFilter.cpp.
References vpImage< Type >::destroy(), filterX(), filterY(), and getGaussianKernel().
|
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 969 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 1050 of file vpImageFilter.h.
References 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 . If it is equal to zero or negative, it is computed from filter size as sigma = (size-1)/6. |
[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 1002 of file vpImageFilter.h.
References vpImageException::incorrectInitializationError, and vpMath::sqr().
Referenced by gaussianBlur(), vpCircleHoughTransform::initGaussianFilters(), vpTemplateTracker::setGaussianFilterSize(), and vpTemplateTracker::vpTemplateTracker().
|
static |
Definition at line 416 of file vpImageFilter.cpp.
References vpImageConvert::convert(), getGaussXPyramidal(), getGaussYPyramidal(), vpImage< Type >::getHeight(), and vpImage< Type >::getWidth().
Referenced by vpTemplateTracker::initHessienDesiredPyr(), vpTemplateTracker::initTrackingPyr(), and vpTemplateTracker::trackPyr().
|
static |
Definition at line 437 of file vpImageFilter.cpp.
References filterGaussXPyramidal(), vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), and vpImage< Type >::resize().
Referenced by getGaussPyramidal().
|
static |
Definition at line 453 of file vpImageFilter.cpp.
References filterGaussYPyramidal(), vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), and vpImage< Type >::resize().
Referenced by getGaussPyramidal().
|
inlinestatic |
Definition at line 1122 of file vpImageFilter.h.
References vpImage< Type >::getHeight(), and vpImage< Type >::getWidth().
|
inlinestatic |
Definition at line 1088 of file vpImageFilter.h.
References derivativeFilterX(), vpImage< Type >::getHeight(), and vpImage< Type >::getWidth().
Referenced by vpTemplateTrackerMIInverseCompositional::initCompInverse(), vpTemplateTrackerZNCCForwardAdditional::initHessienDesired(), vpTemplateTrackerZNCCInverseCompositional::initHessienDesired(), and vpTemplateTrackerMIESM::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 1167 of file vpImageFilter.h.
Referenced by vpTemplateTrackerZNCCInverseCompositional::initCompInverse(), vpTemplateTrackerMIInverseCompositional::initCompInverse(), vpTemplateTrackerZNCCForwardAdditional::initHessienDesired(), vpTemplateTrackerZNCCInverseCompositional::initHessienDesired(), vpTemplateTrackerMIESM::initHessienDesired(), vpTemplateTrackerMIForwardAdditional::initHessienDesired(), vpTemplateTrackerMIForwardCompositional::initHessienDesired(), vpTemplateTracker::initTracking(), vpTemplateTrackerSSDESM::trackNoPyr(), vpTemplateTrackerSSDForwardAdditional::trackNoPyr(), vpTemplateTrackerSSDForwardCompositional::trackNoPyr(), vpTemplateTrackerZNCCForwardAdditional::trackNoPyr(), vpTemplateTrackerMIESM::trackNoPyr(), vpTemplateTrackerMIForwardAdditional::trackNoPyr(), and vpTemplateTrackerMIForwardCompositional::trackNoPyr().
|
inlinestatic |
Definition at line 1216 of file vpImageFilter.h.
References vpImage< Type >::getHeight(), and vpImage< Type >::getWidth().
|
inlinestatic |
Definition at line 1177 of file vpImageFilter.h.
References derivativeFilterY(), vpImage< Type >::getHeight(), and vpImage< Type >::getWidth().
Referenced by vpTemplateTrackerMIInverseCompositional::initCompInverse(), vpTemplateTrackerZNCCForwardAdditional::initHessienDesired(), vpTemplateTrackerZNCCInverseCompositional::initHessienDesired(), and vpTemplateTrackerMIESM::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 1267 of file vpImageFilter.h.
Referenced by vpTemplateTrackerZNCCInverseCompositional::initCompInverse(), vpTemplateTrackerMIInverseCompositional::initCompInverse(), vpTemplateTrackerZNCCForwardAdditional::initHessienDesired(), vpTemplateTrackerZNCCInverseCompositional::initHessienDesired(), vpTemplateTrackerMIESM::initHessienDesired(), vpTemplateTrackerMIForwardAdditional::initHessienDesired(), vpTemplateTrackerMIForwardCompositional::initHessienDesired(), vpTemplateTracker::initTracking(), vpTemplateTrackerSSDESM::trackNoPyr(), vpTemplateTrackerSSDForwardAdditional::trackNoPyr(), vpTemplateTrackerSSDForwardCompositional::trackNoPyr(), vpTemplateTrackerZNCCForwardAdditional::trackNoPyr(), vpTemplateTrackerMIESM::trackNoPyr(), vpTemplateTrackerMIForwardAdditional::trackNoPyr(), and vpTemplateTrackerMIForwardCompositional::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 1283 of file vpImageFilter.h.
References vpArray2D< Type >::data, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), 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 1307 of file vpImageFilter.h.
References vpException::dimensionError.
Referenced by computePartialDerivatives(), 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 1337 of file vpImageFilter.h.
References vpArray2D< Type >::data, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), 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 1362 of file vpImageFilter.h.
References vpArray2D< Type >::conv2(), vpArray2D< Type >::data, vpException::dimensionError, vpArray2D< Type >::getCols(), and vpArray2D< Type >::getRows().
Referenced by computePartialDerivatives(), vpCircleHoughTransform::initGradientFilters(), vpMbTracker::setProjectionErrorKernelSize(), and vpMbTracker::vpMbTracker().
|
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 494 of file vpImageFilter.cpp.
Referenced by median().
|
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 527 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 542 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 >::getHeight(), vpImage< Type >::getWidth(), vpImage< Type >::resize(), and vpArray2D< Type >::size().
|
static |
Cast a string into a vpImageFilter::vpCannyBackendTypeToString.
[in] | name | The name of the backend. |
Definition at line 93 of file vpImageFilter_canny.cpp.
References CANNY_COUNT_BACKEND, vpIoTools::toLowerCase(), and vpCannyBackendTypeToString().
|
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, and CANNY_VISP_BACKEND.
Referenced by vpCircleHoughTransform::vpCircleHoughTransformParams::toString(), vpCannyBackendTypeFromString(), and vpCannyBackendTypeList().
|
static |
Cast a string into a vpImageFilter::vpCannyFilteringAndGradientType.
[in] | name | The name of the backend. |
Definition at line 163 of file vpImageFilter_canny.cpp.
References CANNY_COUNT_FILTERING, vpIoTools::toLowerCase(), and vpCannyFiltAndGradTypeToStr().
|
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 140 of file vpImageFilter_canny.cpp.
References CANNY_COUNT_FILTERING, CANNY_GBLUR_SCHARR_FILTERING, and CANNY_GBLUR_SOBEL_FILTERING.
Referenced by vpCircleHoughTransform::computeGradients(), vpCircleHoughTransform::initGradientFilters(), 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 119 of file vpImageFilter_canny.cpp.
References CANNY_COUNT_FILTERING, and vpCannyFiltAndGradTypeToStr().