Table of Contents

Class XImgprocInvoke

Namespace
Emgu.CV.XImgproc
Assembly
Emgu.CV.dll

Library to invoke XImgproc functions

public static class XImgprocInvoke
Inheritance
XImgprocInvoke
Inherited Members

Methods

AmFilter(IInputArray, IInputArray, IOutputArray, double, double, bool)

Simple one-line Adaptive Manifold Filter call.

public static void AmFilter(IInputArray joint, IInputArray src, IOutputArray dst, double sigmaS, double sigmaR, bool adjustOutliers = false)

Parameters

joint IInputArray

joint (also called as guided) image or array of images with any numbers of channels.

src IInputArray

filtering image with any numbers of channels.

dst IOutputArray

output image.

sigmaS double

spatial standard deviation.

sigmaR double

color space standard deviation, it is similar to the sigma in the color space into bilateralFilter.

adjustOutliers bool

optional, specify perform outliers adjust operation or not, (Eq. 9) in the original paper.

AnisotropicDiffusion(IInputArray, IOutputArray, float, float, int)

Performs anisotropic diffusion on an image.

public static void AnisotropicDiffusion(IInputArray src, IOutputArray dst, float alpha, float K, int niters)

Parameters

src IInputArray

Grayscale Source image.

dst IOutputArray

Destination image of the same size and the same number of channels as src .

alpha float

The amount of time to step forward by on each iteration (normally, it's between 0 and 1).

K float

sensitivity to the edges

niters int

The number of iterations

BilateralTextureFilter(IInputArray, IOutputArray, int, int, double, double)

Applies the bilateral texture filter to an image. It performs structure-preserving texture filter.

public static void BilateralTextureFilter(IInputArray src, IOutputArray dst, int fr = 3, int numIter = 1, double sigmaAlpha = -1, double sigmaAvg = -1)

Parameters

src IInputArray

Source image whose depth is 8-bit UINT or 32-bit FLOAT

dst IOutputArray

Destination image of the same size and type as src.

fr int

Radius of kernel to be used for filtering. It should be positive integer

numIter int

Number of iterations of algorithm, It should be positive integer

sigmaAlpha double

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.

sigmaAvg double

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.

Remarks

For more details about this filter see: Hojin Cho, Hyunjoon Lee, Henry Kang, and Seungyong Lee. Bilateral texture filtering. ACM Transactions on Graphics, 33(4):128:1–128:8, July 2014.

BrightEdges(Mat, Mat, int, int, int)

Brighten the edges of the image

public static void BrightEdges(Mat original, Mat edgeview, int contrast, int shortrange, int longrange)

Parameters

original Mat

The source image

edgeview Mat

The result

contrast int

Contrast

shortrange int

Short Range

longrange int

Long Range

CovarianceEstimation(IInputArray, IOutputArray, int, int)

Computes the estimated covariance matrix of an image using the sliding window forumlation.

public static void CovarianceEstimation(IInputArray src, IOutputArray dst, int windowRows, int windowCols)

Parameters

src IInputArray

The source image. Input image must be of a complex type.

dst IOutputArray

The destination estimated covariance matrix. Output matrix will be size (windowRowswindowCols, windowRowswindowCols).

windowRows int

The number of rows in the window.

windowCols int

The number of cols in the window. 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.

DtFilter(IInputArray, IInputArray, IOutputArray, double, double, DtFilterType, int)

Simple one-line Domain Transform filter call.

public static void DtFilter(IInputArray guide, IInputArray src, IOutputArray dst, double sigmaSpatial, double sigmaColor, DtFilterType mode, int numIters = 3)

Parameters

guide IInputArray

guided image (also called as joint image) with unsigned 8-bit or floating-point 32-bit depth and up to 4 channels.

src IInputArray

filtering image with unsigned 8-bit or floating-point 32-bit depth and up to 4 channels.

dst IOutputArray

output image

sigmaSpatial double

parameter in the original article, it's similar to the sigma in the coordinate space into bilateralFilter.

sigmaColor double

parameter in the original article, it's similar to the sigma in the color space into bilateralFilter.

mode DtFilterType

Dt filter mode

numIters int

optional number of iterations used for filtering, 3 is quite enough.

FastGlobalSmootherFilter(IInputArray, IInputArray, IOutputArray, double, double, double, int)

Simple one-line Fast Global Smoother filter call.

public static void FastGlobalSmootherFilter(IInputArray guide, IInputArray src, IOutputArray dst, double lambda, double sigmaColor, double lambdaAttenuation = 0.25, int numIter = 3)

Parameters

guide IInputArray

image serving as guide for filtering. It should have 8-bit depth and either 1 or 3 channels.

src IInputArray

source image for filtering with unsigned 8-bit or signed 16-bit or floating-point 32-bit depth and up to 4 channels.

dst IOutputArray

destination image.

lambda double

parameter defining the amount of regularization

sigmaColor double

parameter, that is similar to color space sigma in bilateralFilter.

lambdaAttenuation double

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.

numIter int

number of iterations used for filtering, 3 is usually enough.

Filter(IDisparityFilter, IInputArray, IInputArray, IOutputArray, IInputArray, Rectangle, IInputArray)

Apply filtering to the disparity map.

public static void Filter(this IDisparityFilter filter, IInputArray disparityMapLeft, IInputArray leftView, IOutputArray filteredDisparityMap, IInputArray disparityMapRight = null, Rectangle roi = default, IInputArray rightView = null)

Parameters

filter IDisparityFilter

The disparity filter

disparityMapLeft IInputArray

Disparity map of the left view, 1 channel, CV_16S type. Implicitly assumes that disparity values are scaled by 16 (one-pixel disparity corresponds to the value of 16 in the disparity map). Disparity map can have any resolution, it will be automatically resized to fit left_view resolution.

leftView IInputArray

Left view of the original stereo-pair to guide the filtering process, 8-bit single-channel or three-channel image.

filteredDisparityMap IOutputArray

Output disparity map.

disparityMapRight IInputArray

Optional argument, some implementations might also use the disparity map of the right view to compute confidence maps, for instance.

roi Rectangle

Region of the disparity map to filter. Optional, usually it should be set automatically.

rightView IInputArray

Optional argument, some implementations might also use the right view of the original stereo-pair.

GradientDericheX(IInputArray, IOutputArray, double, double)

Applies X Deriche filter to an image.

public static void GradientDericheX(IInputArray op, IOutputArray dst, double alphaDerive, double alphaMean)

Parameters

op IInputArray

Source 8-bit or 16bit image, 1-channel or 3-channel image.

dst IOutputArray

result CV_32FC image with same number of channel than _op.

alphaDerive double

see paper

alphaMean double

see paper

Remarks

For more details about this implementation, please see http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.476.5736&rep=rep1&type=pdf

GradientDericheY(IInputArray, IOutputArray, double, double)

Applies Y Deriche filter to an image.

public static void GradientDericheY(IInputArray op, IOutputArray dst, double alphaDerive, double alphaMean)

Parameters

op IInputArray

Source 8-bit or 16bit image, 1-channel or 3-channel image.

dst IOutputArray

result CV_32FC image with same number of channel than _op.

alphaDerive double

see paper

alphaMean double

see paper

Remarks

For more details about this implementation, please see here

GradientPaillouX(IInputArray, IOutputArray, double, double)

Applies Paillou filter to an image.

public static void GradientPaillouX(IInputArray op, IOutputArray dst, double alpha, double omega)

Parameters

op IInputArray

Source 8-bit or 16bit image, 1-channel or 3-channel image.

dst IOutputArray

result CV_32F image with same number of channel than op.

alpha double

see paper

omega double

see paper

Remarks

For more details about this implementation, please see: Philippe Paillou. Detecting step edges in noisy sar images: a new linear operator. IEEE transactions on geoscience and remote sensing, 35(1):191–196, 1997.

GradientPaillouY(IInputArray, IOutputArray, double, double)

Applies Paillou filter to an image.

public static void GradientPaillouY(IInputArray op, IOutputArray dst, double alpha, double omega)

Parameters

op IInputArray

Source 8-bit or 16bit image, 1-channel or 3-channel image.

dst IOutputArray

result CV_32F image with same number of channel than op.

alpha double

see paper

omega double

see paper

Remarks

For more details about this implementation, please see: Philippe Paillou. Detecting step edges in noisy sar images: a new linear operator. IEEE transactions on geoscience and remote sensing, 35(1):191–196, 1997.

GuidedFilter(IInputArray, IInputArray, IOutputArray, int, double, DepthType)

Simple one-line Guided Filter call.

public static void GuidedFilter(IInputArray guide, IInputArray src, IOutputArray dst, int radius, double eps, DepthType dDepth = DepthType.Default)

Parameters

guide IInputArray

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.

src IInputArray

filtering image with any numbers of channels.

dst IOutputArray

output image.

radius int

radius of Guided Filter.

eps double

regularization term of Guided Filter. eps^2 is similar to the sigma in the color space into bilateralFilter.

dDepth DepthType

optional depth of the output image.

JointBilateralFilter(IInputArray, IInputArray, IOutputArray, int, double, double, BorderType)

Applies the joint bilateral filter to an image.

public static void JointBilateralFilter(IInputArray joint, IInputArray src, IOutputArray dst, int d, double sigmaColor, double sigmaSpace, BorderType borderType = BorderType.Default)

Parameters

joint IInputArray

Joint 8-bit or floating-point, 1-channel or 3-channel image.

src IInputArray

Source 8-bit or floating-point, 1-channel or 3-channel image with the same depth as joint image.

dst IOutputArray

Destination image of the same size and type as src .

d int

Diameter of each pixel neighborhood that is used during filtering. If it is non-positive, it is computed from sigmaSpace .

sigmaColor double

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.

sigmaSpace double

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 .

borderType BorderType

Border type

L0Smooth(IInputArray, IOutputArray, double, double)

Global image smoothing via L0 gradient minimization.

public static void L0Smooth(IInputArray src, IOutputArray dst, double lambda = 0.02, double kappa = 2)

Parameters

src IInputArray

Source image for filtering with unsigned 8-bit or signed 16-bit or floating-point depth.

dst IOutputArray

Destination image.

lambda double

Parameter defining the smooth term weight.

kappa double

Parameter defining the increasing factor of the weight of the gradient data term.

NiBlackThreshold(IInputArray, IOutputArray, double, LocalBinarizationMethods, int, double)

Niblack threshold

public static void NiBlackThreshold(IInputArray src, IOutputArray dst, double maxValue, LocalBinarizationMethods type, int blockSize, double delta)

Parameters

src IInputArray

The source image

dst IOutputArray

The output result

maxValue double

Maximum value to use with CV_THRESH_BINARY and CV_THRESH_BINARY_INV thresholding types

type LocalBinarizationMethods

Value that defines which local binarization algorithm should be used.

blockSize int

Block size

delta double

delta

RadonTransform(IInputArray, IOutputArray, double, double, double, bool, bool)

This function calculates the Radon Transform of a given image in any range. See https://engineering.purdue.edu/~malcolm/pct/CTI_Ch03.pdf for detail. If the input type is CV_8U, the output will be CV_32S. If the input type is CV_32F or CV_64F, the output will be CV_64F The output size will be num_of_integral x src_diagonal_length. If crop is selected, the input image will be crop into square then circle, and output size will be num_of_integral x min_edge.

public static void RadonTransform(IInputArray src, IOutputArray dst, double theta = 1, double startAngle = 0, double endAngle = 180, bool crop = false, bool norm = false)

Parameters

src IInputArray

The source (input) image.

dst IOutputArray

The destination image, result of transformation.

theta double

Angle resolution of the transform in degrees.

startAngle double

Start angle of the transform in degrees.

endAngle double

End angle of the transform in degrees.

crop bool

If true, crop the source image into a circle.

norm bool

Normalize the output Mat to grayscale and convert type to CV_8U

RollingGuidanceFilter(IInputArray, IOutputArray, int, double, double, int, BorderType)

Applies the rolling guidance filter to an image

public static void RollingGuidanceFilter(IInputArray src, IOutputArray dst, int d = -1, double sigmaColor = 25, double sigmaSpace = 3, int numOfIter = 4, BorderType borderType = BorderType.Default)

Parameters

src IInputArray

Source 8-bit or floating-point, 1-channel or 3-channel image.

dst IOutputArray

Destination image of the same size and type as src.

d int

Diameter of each pixel neighborhood that is used during filtering. If it is non-positive, it is computed from sigmaSpace .

sigmaColor double

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.

sigmaSpace double

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 .

numOfIter int

Number of iterations of joint edge-preserving filtering applied on the source image.

borderType BorderType

Border type

Thinning(IInputArray, IOutputArray, 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.

public static void Thinning(IInputArray src, IOutputArray dst, ThinningTypes thinningType)

Parameters

src IInputArray

Source 8-bit single-channel image, containing binary blobs, with blobs having 255 pixel values.

dst IOutputArray

Destination image of the same size and the same type as src. The function can work in-place.

thinningType ThinningTypes

Value that defines which thinning algorithm should be used.

WeightedMedianFilter(IInputArray, IInputArray, IOutputArray, int, double, WMFWeightType, Mat)

Applies weighted median filter to an image.

public static void WeightedMedianFilter(IInputArray joint, IInputArray src, IOutputArray dst, int r, double sigma = 25.5, WMFWeightType weightType = WMFWeightType.Exp, Mat mask = null)

Parameters

joint IInputArray

Joint 8-bit, 1-channel or 3-channel image.

src IInputArray

Source 8-bit or floating-point, 1-channel or 3-channel image.

dst IOutputArray

Destination image.

r int

Radius of filtering kernel, should be a positive integer.

sigma double

Filter range standard deviation for the joint image.

weightType WMFWeightType

The type of weight definition

mask Mat

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: Qi Zhang, Li Xu, and Jiaya Jia. 100+ times faster weighted median filter (wmf). In Computer Vision and Pattern Recognition (CVPR), 2014 IEEE Conference on, pages 2830–2837. IEEE, 2014.