Class CvXImgProc
cv::ximgproc functions
Inheritance
Inherited Members
Namespace: OpenCvSharp.XImgProc
Assembly: OpenCvSharp.dll
Syntax
public static class CvXImgProc
Methods
| Improve this Doc View SourceAMFilter(InputArray, InputArray, OutputArray, Double, Double, Boolean)
Simple one-line Adaptive Manifold Filter call.
Declaration
public static void AMFilter(InputArray joint, InputArray src, OutputArray dst, double sigmaS, double sigmaR, bool adjustOutliers = false)
Parameters
Type | Name | Description |
---|---|---|
InputArray | joint | joint (also called as guided) image or array of images with any numbers of channels. |
InputArray | src | filtering image with any numbers of channels. |
OutputArray | dst | output image. |
System.Double | sigmaS | spatial standard deviation. |
System.Double | sigmaR | color space standard deviation, it is similar to the sigma in the color space into bilateralFilter. |
System.Boolean | adjustOutliers | optional, specify perform outliers adjust operation or not, (Eq. 9) in the original paper. |
AnisotropicDiffusion(InputArray, OutputArray, Single, Single, Int32)
Performs anisotropic diffusian on an image. The function applies Perona-Malik anisotropic diffusion to an image.
Declaration
public static void AnisotropicDiffusion(InputArray src, OutputArray dst, float alpha, float k, int niters)
Parameters
Type | Name | Description |
---|---|---|
InputArray | src | Grayscale Source image. |
OutputArray | dst | Destination image of the same size and the same number of channels as src. |
System.Single | alpha | The amount of time to step forward by on each iteration (normally, it's between 0 and 1). |
System.Single | k | sensitivity to the edges |
System.Int32 | niters | The number of iterations |
BilateralTextureFilter(InputArray, OutputArray, Int32, Int32, Double, Double)
Applies the bilateral texture filter to an image. It performs structure-preserving texture filter. For more details about this filter see @cite Cho2014.
Declaration
public static void BilateralTextureFilter(InputArray src, OutputArray dst, int fr = 3, int numIter = 1, double sigmaAlpha = -1, double sigmaAvg = -1)
Parameters
Type | Name | Description |
---|---|---|
InputArray | src | Source image whose depth is 8-bit UINT or 32-bit FLOAT |
OutputArray | dst | Destination image of the same size and type as src. |
System.Int32 | fr | Radius of kernel to be used for filtering. It should be positive integer |
System.Int32 | numIter | Number of iterations of algorithm, It should be positive integer |
System.Double | sigmaAlpha | Controls the sharpness of the weight transition from edges to smooth/texture regions, where a bigger value means sharper transition.When the value is negative, it is automatically calculated. |
System.Double | sigmaAvg | Range blur parameter for texture blurring. Larger value makes result to be more blurred. When the value is negative, it is automatically calculated as described in the paper. |
BrightEdges(Mat, Mat, Int32, Int32, Int32)
Declaration
public static void BrightEdges(Mat original, Mat edgeView, int contrast = 1, int shortRange = 3, int longRange = 9)
Parameters
Type | Name | Description |
---|---|---|
Mat | original | |
Mat | edgeView | |
System.Int32 | contrast | |
System.Int32 | shortRange | |
System.Int32 | longRange |
ColorMatchTemplate(InputArray, InputArray, OutputArray)
Compares a color template against overlapped color image regions.
Declaration
public static void ColorMatchTemplate(InputArray img, InputArray templ, OutputArray result)
Parameters
Type | Name | Description |
---|---|---|
InputArray | img | Image where the search is running. It must be 3 channels image |
InputArray | templ | Searched template. It must be not greater than the source image and have 3 channels |
OutputArray | result | Map of comparison results. It must be single-channel 64-bit floating-point |
CovarianceEstimation(InputArray, OutputArray, Int32, Int32)
Computes the estimated covariance matrix of an image using the sliding window forumlation.
Declaration
public static void CovarianceEstimation(InputArray src, OutputArray dst, int windowRows, int windowCols)
Parameters
Type | Name | Description |
---|---|---|
InputArray | src | The source image. Input image must be of a complex type. |
OutputArray | dst | The destination estimated covariance matrix. Output matrix will be size (windowRowswindowCols, windowRowswindowCols). |
System.Int32 | windowRows | The number of rows in the window. |
System.Int32 | windowCols | The number of cols in the window. |
Remarks
The window size parameters control the accuracy of the estimation. The sliding window moves over the entire image from the top-left corner to the bottom right corner.Each location of the window represents a sample. If the window is the size of the image, then this gives the exact covariance matrix. For all other cases, the sizes of the window will impact the number of samples and the number of elements in the estimated covariance matrix.
CreateAMFilter(Double, Double, Boolean)
Factory method, create instance of AdaptiveManifoldFilter and produce some initialization routines.
Declaration
public static AdaptiveManifoldFilter CreateAMFilter(double sigmaS, double sigmaR, bool adjustOutliers = false)
Parameters
Type | Name | Description |
---|---|---|
System.Double | sigmaS | spatial standard deviation. |
System.Double | sigmaR | color space standard deviation, it is similar to the sigma in the color space into bilateralFilter. |
System.Boolean | adjustOutliers | optional, specify perform outliers adjust operation or not, (Eq. 9) in the original paper. |
Returns
Type | Description |
---|---|
AdaptiveManifoldFilter |
CreateDTFilter(InputArray, Double, Double, EdgeAwareFiltersList, Int32)
Factory method, create instance of DTFilter and produce initialization routines.
Declaration
public static DTFilter CreateDTFilter(InputArray guide, double sigmaSpatial, double sigmaColor, EdgeAwareFiltersList mode = EdgeAwareFiltersList.DTF_NC, int numIters = 3)
Parameters
Type | Name | Description |
---|---|---|
InputArray | guide | guided image (used to build transformed distance, which describes edge structure of guided image). |
System.Double | sigmaSpatial | sigma_H parameter in the original article, it's similar to the sigma in the coordinate space into bilateralFilter. |
System.Double | sigmaColor | sigma_r parameter in the original article, it's similar to the sigma in the color space into bilateralFilter. |
EdgeAwareFiltersList | mode | one form three modes DTF_NC, DTF_RF and DTF_IC which corresponds to three modes for filtering 2D signals in the article. |
System.Int32 | numIters | optional number of iterations used for filtering, 3 is quite enough. |
Returns
Type | Description |
---|---|
DTFilter |
CreateEdgeBoxes(Single, Single, Single, Single, Int32, Single, Single, Single, Single, Single, Single, Single)
Creates a EdgeBoxes
Declaration
public static EdgeBoxes CreateEdgeBoxes(float alpha = 0.65F, float beta = 0.75F, float eta = 1F, float minScore = 0.01F, int maxBoxes = 10000, float edgeMinMag = 0.1F, float edgeMergeThr = 0.5F, float clusterMinMag = 0.5F, float maxAspectRatio = 3F, float minBoxArea = 1000F, float gamma = 2F, float kappa = 1.5F)
Parameters
Type | Name | Description |
---|---|---|
System.Single | alpha | step size of sliding window search. |
System.Single | beta | nms threshold for object proposals. |
System.Single | eta | adaptation rate for nms threshold. |
System.Single | minScore | min score of boxes to detect. |
System.Int32 | maxBoxes | max number of boxes to detect. |
System.Single | edgeMinMag | edge min magnitude. Increase to trade off accuracy for speed. |
System.Single | edgeMergeThr | edge merge threshold. Increase to trade off accuracy for speed. |
System.Single | clusterMinMag | cluster min magnitude. Increase to trade off accuracy for speed. |
System.Single | maxAspectRatio | max aspect ratio of boxes. |
System.Single | minBoxArea | minimum area of boxes. |
System.Single | gamma | affinity sensitivity. |
System.Single | kappa | scale sensitivity. |
Returns
Type | Description |
---|---|
EdgeBoxes |
CreateFastGlobalSmootherFilter(InputArray, Double, Double, Double, Int32)
Factory method, create instance of FastGlobalSmootherFilter and execute the initialization routines.
Declaration
public static FastGlobalSmootherFilter CreateFastGlobalSmootherFilter(InputArray guide, double lambda, double sigmaColor, double lambdaAttenuation = 0.25, int numIter = 3)
Parameters
Type | Name | Description |
---|---|---|
InputArray | guide | image serving as guide for filtering. It should have 8-bit depth and either 1 or 3 channels. |
System.Double | lambda | parameter defining the amount of regularization |
System.Double | sigmaColor | parameter, that is similar to color space sigma in bilateralFilter. |
System.Double | lambdaAttenuation | internal parameter, defining how much lambda decreases after each iteration. Normally, it should be 0.25. Setting it to 1.0 may lead to streaking artifacts. |
System.Int32 | numIter | number of iterations used for filtering, 3 is usually enough. |
Returns
Type | Description |
---|---|
FastGlobalSmootherFilter |
CreateFastLineDetector(Int32, Single, Double, Double, Int32, Boolean)
Creates a smart pointer to a FastLineDetector object and initializes it
Declaration
public static FastLineDetector CreateFastLineDetector(int lengthThreshold = 10, float distanceThreshold = 1.41421354F, double cannyTh1 = 50, double cannyTh2 = 50, int cannyApertureSize = 3, bool doMerge = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | lengthThreshold | Segment shorter than this will be discarded |
System.Single | distanceThreshold | A point placed from a hypothesis line segment farther than this will be regarded as an outlier |
System.Double | cannyTh1 | First threshold for hysteresis procedure in Canny() |
System.Double | cannyTh2 | Second threshold for hysteresis procedure in Canny() |
System.Int32 | cannyApertureSize | Aperture size for the sobel operator in Canny() |
System.Boolean | doMerge | If true, incremental merging of segments will be performed |
Returns
Type | Description |
---|---|
FastLineDetector |
CreateGuidedFilter(InputArray, Int32, Double)
Factory method, create instance of GuidedFilter and produce initialization routines.
Declaration
public static GuidedFilter CreateGuidedFilter(InputArray guide, int radius, double eps)
Parameters
Type | Name | Description |
---|---|---|
InputArray | guide | guided image (or array of images) with up to 3 channels, if it have more then 3 channels then only first 3 channels will be used. |
System.Int32 | radius | radius of Guided Filter. |
System.Double | eps | regularization term of Guided Filter. eps^2 is similar to the sigma in the color space into bilateralFilter. |
Returns
Type | Description |
---|---|
GuidedFilter |
CreateQuaternionImage(InputArray, OutputArray)
creates a quaternion image.
Declaration
public static void CreateQuaternionImage(InputArray img, OutputArray qimg)
Parameters
Type | Name | Description |
---|---|---|
InputArray | img | Source 8-bit, 32-bit or 64-bit image, with 3-channel image. |
OutputArray | qimg | result CV_64FC4 a quaternion image( 4 chanels zero channel and B,G,R). |
CreateRFFeatureGetter()
Creates a RFFeatureGetter
Declaration
public static RFFeatureGetter CreateRFFeatureGetter()
Returns
Type | Description |
---|---|
RFFeatureGetter |
CreateStructuredEdgeDetection(String, RFFeatureGetter)
Creates a StructuredEdgeDetection
Declaration
public static StructuredEdgeDetection CreateStructuredEdgeDetection(string model, RFFeatureGetter howToGetFeatures = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | model | name of the file where the model is stored |
RFFeatureGetter | howToGetFeatures | optional object inheriting from RFFeatureGetter. You need it only if you would like to train your own forest, pass null otherwise |
Returns
Type | Description |
---|---|
StructuredEdgeDetection |
CreateSuperpixelLSC(InputArray, Int32, Single)
Class implementing the LSC (Linear Spectral Clustering) superpixels.
The function initializes a SuperpixelLSC object for the input image. It sets the parameters of superpixel algorithm, which are: region_size and ruler.It preallocate some buffers for future computing iterations over the given image.An example of LSC is illustrated in the following picture. For enhanced results it is recommended for color images to preprocess image with little gaussian blur with a small 3 x 3 kernel and additional conversion into CieLAB color space.
Declaration
public static SuperpixelLSC CreateSuperpixelLSC(InputArray image, int regionSize = 10, float ratio = 0.075F)
Parameters
Type | Name | Description |
---|---|---|
InputArray | image | image Image to segment |
System.Int32 | regionSize | Chooses an average superpixel size measured in pixels |
System.Single | ratio | Chooses the enforcement of superpixel compactness factor of superpixel |
Returns
Type | Description |
---|---|
SuperpixelLSC |
CreateSuperpixelSEEDS(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Boolean)
Initializes a SuperpixelSEEDS object.
The function initializes a SuperpixelSEEDS object for the input image. It stores the parameters of the image: image_width, image_height and image_channels.It also sets the parameters of the SEEDS superpixel algorithm, which are: num_superpixels, num_levels, use_prior, histogram_bins and double_step.
The number of levels in num_levels defines the amount of block levels that the algorithm use in the optimization.The initialization is a grid, in which the superpixels are equally distributed through the width and the height of the image.The larger blocks correspond to the superpixel size, and the levels with smaller blocks are formed by dividing the larger blocks into 2 x 2 blocks of pixels, recursively until the smaller block level. An example of initialization of 4 block levels is illustrated in the following figure.
Declaration
public static SuperpixelSEEDS CreateSuperpixelSEEDS(int imageWidth, int imageHeight, int imageChannels, int numSuperpixels, int numLevels, int prior = 2, int histogramBins = 5, bool doubleStep = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | imageWidth | Image width. |
System.Int32 | imageHeight | Image height. |
System.Int32 | imageChannels | Number of channels of the image. |
System.Int32 | numSuperpixels | Desired number of superpixels. Note that the actual number may be smaller due to restrictions(depending on the image size and num_levels). Use getNumberOfSuperpixels() to get the actual number. |
System.Int32 | numLevels | Number of block levels. The more levels, the more accurate is the segmentation, but needs more memory and CPU time. |
System.Int32 | prior | enable 3x3 shape smoothing term if >0. A larger value leads to smoother shapes. prior must be in the range[0, 5]. |
System.Int32 | histogramBins | Number of histogram bins. |
System.Boolean | doubleStep | If true, iterate each block level twice for higher accuracy. |
Returns
Type | Description |
---|---|
SuperpixelSEEDS |
DTFilter(InputArray, InputArray, OutputArray, Double, Double, EdgeAwareFiltersList, Int32)
Simple one-line Domain Transform filter call. If you have multiple images to filter with the same guided image then use DTFilter interface to avoid extra computations on initialization stage.
Declaration
public static void DTFilter(InputArray guide, InputArray src, OutputArray dst, double sigmaSpatial, double sigmaColor, EdgeAwareFiltersList mode = EdgeAwareFiltersList.DTF_NC, int numIters = 3)
Parameters
Type | Name | Description |
---|---|---|
InputArray | guide | guided image (also called as joint image) with unsigned 8-bit or floating-point 32-bit depth and up to 4 channels. |
InputArray | src | filtering image with unsigned 8-bit or floating-point 32-bit depth and up to 4 channels. |
OutputArray | dst | destination image |
System.Double | sigmaSpatial | sigma_H parameter in the original article, it's similar to the sigma in the coordinate space into bilateralFilter. |
System.Double | sigmaColor | sigma_r parameter in the original article, it's similar to the sigma in the color space into bilateralFilter. |
EdgeAwareFiltersList | mode | one form three modes DTF_NC, DTF_RF and DTF_IC which corresponds to three modes for filtering 2D signals in the article. |
System.Int32 | numIters | optional number of iterations used for filtering, 3 is quite enough. |
EdgePreservingFilter(InputArray, OutputArray, Int32, Double)
Smoothes an image using the Edge-Preserving filter.
Declaration
public static void EdgePreservingFilter(InputArray src, OutputArray dst, int d, double threshold)
Parameters
Type | Name | Description |
---|---|---|
InputArray | src | Source 8-bit 3-channel image. |
OutputArray | dst | Destination image of the same size and type as src. |
System.Int32 | d | Diameter of each pixel neighborhood that is used during filtering. Must be greater or equal 3. |
System.Double | threshold | Threshold, which distinguishes between noise, outliers, and data. |
FastBilateralSolverFilter(InputArray, InputArray, InputArray, OutputArray, Double, Double, Double, Double, Int32, Double)
Simple one-line Fast Bilateral Solver filter call. If you have multiple images to filter with the same guide then use FastBilateralSolverFilter interface to avoid extra computations.
Declaration
public static void FastBilateralSolverFilter(InputArray guide, InputArray src, InputArray confidence, OutputArray dst, double sigmaSpatial = 8, double sigmaLuma = 8, double sigmaChroma = 8, double lambda = 128, int numIter = 25, double maxTol = 1E-05)
Parameters
Type | Name | Description |
---|---|---|
InputArray | guide | image serving as guide for filtering. It should have 8-bit depth and either 1 or 3 channels. |
InputArray | src | source image for filtering with unsigned 8-bit or signed 16-bit or floating-point 32-bit depth and up to 4 channels. |
InputArray | confidence | confidence image with unsigned 8-bit or floating-point 32-bit confidence and 1 channel. |
OutputArray | dst | destination image. |
System.Double | sigmaSpatial | parameter, that is similar to spatial space sigma (bandwidth) in bilateralFilter. |
System.Double | sigmaLuma | parameter, that is similar to luma space sigma (bandwidth) in bilateralFilter. |
System.Double | sigmaChroma | parameter, that is similar to chroma space sigma (bandwidth) in bilateralFilter. |
System.Double | lambda | smoothness strength parameter for solver. |
System.Int32 | numIter | number of iterations used for solver, 25 is usually enough. |
System.Double | maxTol | convergence tolerance used for solver. |
FastGlobalSmootherFilter(InputArray, InputArray, OutputArray, Double, Double, Double, Int32)
Simple one-line Fast Global Smoother filter call. If you have multiple images to filter with the same guide then use FastGlobalSmootherFilter interface to avoid extra computations.
Declaration
public static void FastGlobalSmootherFilter(InputArray guide, InputArray src, OutputArray dst, double lambda, double sigmaColor, double lambdaAttenuation = 0.25, int numIter = 3)
Parameters
Type | Name | Description |
---|---|---|
InputArray | guide | image serving as guide for filtering. It should have 8-bit depth and either 1 or 3 channels. |
InputArray | src | source image for filtering with unsigned 8-bit or signed 16-bit or floating-point 32-bit depth and up to 4 channels. |
OutputArray | dst | destination image. |
System.Double | lambda | parameter defining the amount of regularization |
System.Double | sigmaColor | parameter, that is similar to color space sigma in bilateralFilter. |
System.Double | lambdaAttenuation | internal parameter, defining how much lambda decreases after each iteration. Normally, it should be 0.25. Setting it to 1.0 may lead to streaking artifacts. |
System.Int32 | numIter | number of iterations used for filtering, 3 is usually enough. |
FastHoughTransform(InputArray, OutputArray, MatType, AngleRangeOption, HoughOP, HoughDeskewOption)
Calculates 2D Fast Hough transform of an image.
Declaration
public static void FastHoughTransform(InputArray src, OutputArray dst, MatType dstMatDepth, AngleRangeOption angleRange = AngleRangeOption.ARO_315_135, HoughOP op = HoughOP.FHT_ADD, HoughDeskewOption makeSkew = HoughDeskewOption.DESKEW)
Parameters
Type | Name | Description |
---|---|---|
InputArray | src | The source (input) image. |
OutputArray | dst | The destination image, result of transformation. |
OpenCvSharp.MatType | dstMatDepth | The depth of destination image |
AngleRangeOption | angleRange | The part of Hough space to calculate, see cv::AngleRangeOption |
HoughOP | op | The operation to be applied, see cv::HoughOp |
HoughDeskewOption | makeSkew | Specifies to do or not to do image skewing, see cv::HoughDeskewOption |
GradientDericheX(InputArray, OutputArray, Double, Double)
Applies X Deriche filter to an image.
Declaration
public static void GradientDericheX(InputArray op, OutputArray dst, double alpha, double omega)
Parameters
Type | Name | Description |
---|---|---|
InputArray | op | Source 8-bit or 16bit image, 1-channel or 3-channel image. |
OutputArray | dst | result CV_32FC image with same number of channel than _op. |
System.Double | alpha | double see paper |
System.Double | omega | double see paper |
GradientDericheY(InputArray, OutputArray, Double, Double)
Applies Y Deriche filter to an image.
Declaration
public static void GradientDericheY(InputArray op, OutputArray dst, double alpha, double omega)
Parameters
Type | Name | Description |
---|---|---|
InputArray | op | Source 8-bit or 16bit image, 1-channel or 3-channel image. |
OutputArray | dst | result CV_32FC image with same number of channel than _op. |
System.Double | alpha | double see paper |
System.Double | omega | double see paper |
GradientPaillouX(InputArray, OutputArray, Double, Double)
Applies Paillou filter to an image.
Declaration
public static void GradientPaillouX(InputArray op, OutputArray dst, double alpha, double omega)
Parameters
Type | Name | Description |
---|---|---|
InputArray | op | Source CV_8U(S) or CV_16U(S), 1-channel or 3-channels image. |
OutputArray | dst | Result CV_32F image with same number of channel than op. |
System.Double | alpha | double see paper |
System.Double | omega | double see paper |
GradientPaillouY(InputArray, OutputArray, Double, Double)
Applies Paillou filter to an image.
Declaration
public static void GradientPaillouY(InputArray op, OutputArray dst, double alpha, double omega)
Parameters
Type | Name | Description |
---|---|---|
InputArray | op | Source CV_8U(S) or CV_16U(S), 1-channel or 3-channels image. |
OutputArray | dst | Result CV_32F image with same number of channel than op. |
System.Double | alpha | double see paper |
System.Double | omega | double see paper |
GuidedFilter(InputArray, InputArray, OutputArray, Int32, Double, Int32)
Simple one-line Guided Filter call.
If you have multiple images to filter with the same guided image then use GuidedFilter interface to avoid extra computations on initialization stage.
Declaration
public static void GuidedFilter(InputArray guide, InputArray src, OutputArray dst, int radius, double eps, int dDepth = -1)
Parameters
Type | Name | Description |
---|---|---|
InputArray | guide | guided image (or array of images) with up to 3 channels, if it have more then 3 channels then only first 3 channels will be used. |
InputArray | src | filtering image with any numbers of channels. |
OutputArray | dst | output image. |
System.Int32 | radius | radius of Guided Filter. |
System.Double | eps | regularization term of Guided Filter. eps^2 is similar to the sigma in the color space into bilateralFilter. |
System.Int32 | dDepth | optional depth of the output image. |
HoughPoint2Line(Point, InputArray, AngleRangeOption, HoughDeskewOption, RulesOption)
Calculates coordinates of line segment corresponded by point in Hough space.
Declaration
public static Vec4i HoughPoint2Line(Point houghPoint, InputArray srcImgInfo, AngleRangeOption angleRange = AngleRangeOption.ARO_315_135, HoughDeskewOption makeSkew = HoughDeskewOption.DESKEW, RulesOption rules = RulesOption.IGNORE_BORDERS)
Parameters
Type | Name | Description |
---|---|---|
OpenCvSharp.Point | houghPoint | Point in Hough space. |
InputArray | srcImgInfo | The source (input) image of Hough transform. |
AngleRangeOption | angleRange | The part of Hough space where point is situated, see cv::AngleRangeOption |
HoughDeskewOption | makeSkew | Specifies to do or not to do image skewing, see cv::HoughDeskewOption |
RulesOption | rules | Specifies strictness of line segment calculating, see cv::RulesOption |
Returns
Type | Description |
---|---|
Vec4i | Coordinates of line segment corresponded by point in Hough space. |
Remarks
If rules parameter set to RO_STRICT then returned line cut along the border of source image. If rules parameter set to RO_WEAK then in case of point, which belongs the incorrect part of Hough image, returned line will not intersect source image.
JointBilateralFilter(InputArray, InputArray, OutputArray, Int32, Double, Double, BorderTypes)
Applies the joint bilateral filter to an image.
Declaration
public static void JointBilateralFilter(InputArray joint, InputArray src, OutputArray dst, int d, double sigmaColor, double sigmaSpace, BorderTypes borderType = BorderTypes.Reflect101)
Parameters
Type | Name | Description |
---|---|---|
InputArray | joint | Joint 8-bit or floating-point, 1-channel or 3-channel image. |
InputArray | src | Source 8-bit or floating-point, 1-channel or 3-channel image with the same depth as joint image. |
OutputArray | dst | Destination image of the same size and type as src. |
System.Int32 | d | Diameter of each pixel neighborhood that is used during filtering. If it is non-positive, it is computed from sigmaSpace. |
System.Double | sigmaColor | Filter sigma in the color space. A larger value of the parameter means that farther colors within the pixel neighborhood(see sigmaSpace) will be mixed together, resulting in larger areas of semi-equal color. |
System.Double | sigmaSpace | Filter sigma in the coordinate space. A larger value of the parameter means that farther pixels will influence each other as long as their colors are close enough(see sigmaColor). When d>0 , it specifies the neighborhood size regardless of sigmaSpace.Otherwise, d is proportional to sigmaSpace. |
BorderTypes | borderType |
L0Smooth(InputArray, OutputArray, Double, Double)
Global image smoothing via L0 gradient minimization.
Declaration
public static void L0Smooth(InputArray src, OutputArray dst, double lambda = 0.02, double kappa = 2)
Parameters
Type | Name | Description |
---|---|---|
InputArray | src | source image for filtering with unsigned 8-bit or signed 16-bit or floating-point depth. |
OutputArray | dst | destination image. |
System.Double | lambda | parameter defining the smooth term weight. |
System.Double | kappa | parameter defining the increasing factor of the weight of the gradient data term. |
NiblackThreshold(InputArray, OutputArray, Double, ThresholdTypes, Int32, Double, LocalBinarizationMethods, Double)
Applies Niblack thresholding to input image.
Declaration
public static void NiblackThreshold(InputArray src, OutputArray dst, double maxValue, ThresholdTypes type, int blockSize, double k, LocalBinarizationMethods binarizationMethod = LocalBinarizationMethods.Niblack, double r = 128)
Parameters
Type | Name | Description |
---|---|---|
InputArray | src | Source 8-bit single-channel image. |
OutputArray | dst | Destination image of the same size and the same type as src. |
System.Double | maxValue | Non-zero value assigned to the pixels for which the condition is satisfied, used with the THRESH_BINARY and THRESH_BINARY_INV thresholding types. |
ThresholdTypes | type | Thresholding type, see cv::ThresholdTypes. |
System.Int32 | blockSize | Size of a pixel neighborhood that is used to calculate a threshold value for the pixel: 3, 5, 7, and so on. |
System.Double | k | The user-adjustable parameter used by Niblack and inspired techniques.For Niblack, this is normally a value between 0 and 1 that is multiplied with the standard deviation and subtracted from the mean. |
LocalBinarizationMethods | binarizationMethod | Binarization method to use. By default, Niblack's technique is used. Other techniques can be specified, see cv::ximgproc::LocalBinarizationMethods. |
System.Double | r | The user-adjustable parameter used by Sauvola's technique. This is the dynamic range of standard deviation. |
Remarks
The function transforms a grayscale image to a binary image according to the formulae:
- THRESH_BINARY \f[dst(x, y) = \fork{\texttt{maxValue } }{if (src(x, y) > T(x, y))}{0}{otherwise}\f]
- ** THRESH_BINARY_INV** \f[dst(x, y) = \fork{0}{if (src(x, y) > T(x, y))}{\texttt{maxValue}}{otherwise}\f] where \f$T(x, y)\f$ is a threshold calculated individually for each pixel. The threshold value \f$T(x, y)\f$ is the mean minus \f$ delta \f$ times standard deviation of \f$\texttt{blockSize} \times\texttt{blockSize}\f$ neighborhood of \f$(x, y)\f$. The function can't process the image in-place.
PeiLinNormalization(InputArray)
Calculates an affine transformation that normalize given image using Pei&Lin Normalization.
Declaration
public static double[, ] PeiLinNormalization(InputArray i)
Parameters
Type | Name | Description |
---|---|---|
InputArray | i | Given transformed image. |
Returns
Type | Description |
---|---|
System.Double[,] | Transformation matrix corresponding to inversed image transformation |
PeiLinNormalization(InputArray, OutputArray)
Calculates an affine transformation that normalize given image using Pei&Lin Normalization.
Declaration
public static void PeiLinNormalization(InputArray i, OutputArray t)
Parameters
Type | Name | Description |
---|---|---|
InputArray | i | Given transformed image. |
OutputArray | t | Inversed image transformation. |
QConj(InputArray, OutputArray)
calculates conjugate of a quaternion image.
Declaration
public static void QConj(InputArray qimg, OutputArray qcimg)
Parameters
Type | Name | Description |
---|---|---|
InputArray | qimg | quaternion image. |
OutputArray | qcimg | conjugate of qimg |
QDft(InputArray, OutputArray, DftFlags, Boolean)
Performs a forward or inverse Discrete quaternion Fourier transform of a 2D quaternion array.
Declaration
public static void QDft(InputArray img, OutputArray qimg, DftFlags flags, bool sideLeft)
Parameters
Type | Name | Description |
---|---|---|
InputArray | img | quaternion image. |
OutputArray | qimg | quaternion image in dual space. |
DftFlags | flags | quaternion image in dual space. only DFT_INVERSE flags is supported |
System.Boolean | sideLeft | true the hypercomplex exponential is to be multiplied on the left (false on the right ). |
QMultiply(InputArray, InputArray, OutputArray)
Calculates the per-element quaternion product of two arrays
Declaration
public static void QMultiply(InputArray src1, InputArray src2, OutputArray dst)
Parameters
Type | Name | Description |
---|---|---|
InputArray | src1 | quaternion image. |
InputArray | src2 | quaternion image. |
OutputArray | dst | product dst(I)=src1(I) . src2(I) |
QUnitary(InputArray, OutputArray)
divides each element by its modulus.
Declaration
public static void QUnitary(InputArray qimg, OutputArray qnimg)
Parameters
Type | Name | Description |
---|---|---|
InputArray | qimg | quaternion image. |
OutputArray | qnimg | conjugate of qimg |
RollingGuidanceFilter(InputArray, OutputArray, Int32, Double, Double, Int32, BorderTypes)
Applies the rolling guidance filter to an image.
Declaration
public static void RollingGuidanceFilter(InputArray src, OutputArray dst, int d = -1, double sigmaColor = 25, double sigmaSpace = 3, int numOfIter = 4, BorderTypes borderType = BorderTypes.Reflect101)
Parameters
Type | Name | Description |
---|---|---|
InputArray | src | 8-bit or floating-point, 1-channel or 3-channel image. |
OutputArray | dst | Destination image of the same size and type as src. |
System.Int32 | d | Diameter of each pixel neighborhood that is used during filtering. If it is non-positive, it is computed from sigmaSpace. |
System.Double | sigmaColor | Filter sigma in the color space. A larger value of the parameter means that farther colors within the pixel neighborhood(see sigmaSpace) will be mixed together, resulting in larger areas of semi-equal color. |
System.Double | sigmaSpace | Filter sigma in the coordinate space. A larger value of the parameter means that farther pixels will influence each other as long as their colors are close enough(see sigmaColor). When d>0 , it specifies the neighborhood size regardless of sigmaSpace.Otherwise, d is proportional to sigmaSpace. |
System.Int32 | numOfIter | Number of iterations of joint edge-preserving filtering applied on the source image. |
BorderTypes | borderType |
Thinning(InputArray, OutputArray, ThinningTypes)
Applies a binary blob thinning operation, to achieve a skeletization of the input image. The function transforms a binary blob image into a skeletized form using the technique of Zhang-Suen.
Declaration
public static void Thinning(InputArray src, OutputArray dst, ThinningTypes thinningType = ThinningTypes.ZHANGSUEN)
Parameters
Type | Name | Description |
---|---|---|
InputArray | src | Source 8-bit single-channel image, containing binary blobs, with blobs having 255 pixel values. |
OutputArray | dst | Destination image of the same size and the same type as src. The function can work in-place. |
ThinningTypes | thinningType | Value that defines which thinning algorithm should be used. |
WeightedMedianFilter(InputArray, InputArray, OutputArray, Int32, Double, WMFWeightType, Mat)
Applies weighted median filter to an image.
Declaration
public static void WeightedMedianFilter(InputArray joint, InputArray src, OutputArray dst, int r, double sigma = 25.5, WMFWeightType weightType = WMFWeightType.EXP, Mat mask = null)
Parameters
Type | Name | Description |
---|---|---|
InputArray | joint | Joint 8-bit, 1-channel or 3-channel image. |
InputArray | src | Source 8-bit or floating-point, 1-channel or 3-channel image. |
OutputArray | dst | Destination image. |
System.Int32 | r | Radius of filtering kernel, should be a positive integer. |
System.Double | sigma | Filter range standard deviation for the joint image. |
WMFWeightType | weightType | The type of weight definition, see WMFWeightType |
Mat | mask | A 0-1 mask that has the same size with I. This mask is used to ignore the effect of some pixels. If the pixel value on mask is 0, the pixel will be ignored when maintaining the joint-histogram.This is useful for applications like optical flow occlusion handling. |
Remarks
For more details about this implementation, please see @cite zhang2014100+