Class XImgprocInvoke
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
IInputArrayjoint (also called as guided) image or array of images with any numbers of channels.
src
IInputArrayfiltering image with any numbers of channels.
dst
IOutputArrayoutput image.
sigmaS
doublespatial standard deviation.
sigmaR
doublecolor space standard deviation, it is similar to the sigma in the color space into bilateralFilter.
adjustOutliers
booloptional, 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
IInputArrayGrayscale Source image.
dst
IOutputArrayDestination image of the same size and the same number of channels as src .
alpha
floatThe amount of time to step forward by on each iteration (normally, it's between 0 and 1).
K
floatsensitivity to the edges
niters
intThe 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
IInputArraySource image whose depth is 8-bit UINT or 32-bit FLOAT
dst
IOutputArrayDestination image of the same size and type as src.
fr
intRadius of kernel to be used for filtering. It should be positive integer
numIter
intNumber of iterations of algorithm, It should be positive integer
sigmaAlpha
doubleControls 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
doubleRange 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
MatThe source image
edgeview
MatThe result
contrast
intContrast
shortrange
intShort Range
longrange
intLong 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
IInputArrayThe source image. Input image must be of a complex type.
dst
IOutputArrayThe destination estimated covariance matrix. Output matrix will be size (windowRowswindowCols, windowRowswindowCols).
windowRows
intThe number of rows in the window.
windowCols
intThe 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
IInputArrayguided image (also called as joint image) with unsigned 8-bit or floating-point 32-bit depth and up to 4 channels.
src
IInputArrayfiltering image with unsigned 8-bit or floating-point 32-bit depth and up to 4 channels.
dst
IOutputArrayoutput image
sigmaSpatial
doubleparameter in the original article, it's similar to the sigma in the coordinate space into bilateralFilter.
sigmaColor
doubleparameter in the original article, it's similar to the sigma in the color space into bilateralFilter.
mode
DtFilterTypeDt filter mode
numIters
intoptional 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
IInputArrayimage serving as guide for filtering. It should have 8-bit depth and either 1 or 3 channels.
src
IInputArraysource image for filtering with unsigned 8-bit or signed 16-bit or floating-point 32-bit depth and up to 4 channels.
dst
IOutputArraydestination image.
lambda
doubleparameter defining the amount of regularization
sigmaColor
doubleparameter, that is similar to color space sigma in bilateralFilter.
lambdaAttenuation
doubleinternal 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
intnumber 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
IDisparityFilterThe disparity filter
disparityMapLeft
IInputArrayDisparity 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
IInputArrayLeft view of the original stereo-pair to guide the filtering process, 8-bit single-channel or three-channel image.
filteredDisparityMap
IOutputArrayOutput disparity map.
disparityMapRight
IInputArrayOptional argument, some implementations might also use the disparity map of the right view to compute confidence maps, for instance.
roi
RectangleRegion of the disparity map to filter. Optional, usually it should be set automatically.
rightView
IInputArrayOptional 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
IInputArraySource 8-bit or 16bit image, 1-channel or 3-channel image.
dst
IOutputArrayresult CV_32FC image with same number of channel than _op.
alphaDerive
doublesee paper
alphaMean
doublesee 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
IInputArraySource 8-bit or 16bit image, 1-channel or 3-channel image.
dst
IOutputArrayresult CV_32FC image with same number of channel than _op.
alphaDerive
doublesee paper
alphaMean
doublesee 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
IInputArraySource 8-bit or 16bit image, 1-channel or 3-channel image.
dst
IOutputArrayresult CV_32F image with same number of channel than op.
alpha
doublesee paper
omega
doublesee 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
IInputArraySource 8-bit or 16bit image, 1-channel or 3-channel image.
dst
IOutputArrayresult CV_32F image with same number of channel than op.
alpha
doublesee paper
omega
doublesee 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
IInputArrayguided 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
IInputArrayfiltering image with any numbers of channels.
dst
IOutputArrayoutput image.
radius
intradius of Guided Filter.
eps
doubleregularization term of Guided Filter. eps^2 is similar to the sigma in the color space into bilateralFilter.
dDepth
DepthTypeoptional 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
IInputArrayJoint 8-bit or floating-point, 1-channel or 3-channel image.
src
IInputArraySource 8-bit or floating-point, 1-channel or 3-channel image with the same depth as joint image.
dst
IOutputArrayDestination image of the same size and type as src .
d
intDiameter of each pixel neighborhood that is used during filtering. If it is non-positive, it is computed from sigmaSpace .
sigmaColor
doubleFilter 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
doubleFilter 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
BorderTypeBorder 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
IInputArraySource image for filtering with unsigned 8-bit or signed 16-bit or floating-point depth.
dst
IOutputArrayDestination image.
lambda
doubleParameter defining the smooth term weight.
kappa
doubleParameter 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
IInputArrayThe source image
dst
IOutputArrayThe output result
maxValue
doubleMaximum value to use with CV_THRESH_BINARY and CV_THRESH_BINARY_INV thresholding types
type
LocalBinarizationMethodsValue that defines which local binarization algorithm should be used.
blockSize
intBlock size
delta
doubledelta
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
IInputArrayThe source (input) image.
dst
IOutputArrayThe destination image, result of transformation.
theta
doubleAngle resolution of the transform in degrees.
startAngle
doubleStart angle of the transform in degrees.
endAngle
doubleEnd angle of the transform in degrees.
crop
boolIf true, crop the source image into a circle.
norm
boolNormalize 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
IInputArraySource 8-bit or floating-point, 1-channel or 3-channel image.
dst
IOutputArrayDestination image of the same size and type as src.
d
intDiameter of each pixel neighborhood that is used during filtering. If it is non-positive, it is computed from sigmaSpace .
sigmaColor
doubleFilter 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
doubleFilter 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
intNumber of iterations of joint edge-preserving filtering applied on the source image.
borderType
BorderTypeBorder 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
IInputArraySource 8-bit single-channel image, containing binary blobs, with blobs having 255 pixel values.
dst
IOutputArrayDestination image of the same size and the same type as src. The function can work in-place.
thinningType
ThinningTypesValue 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
IInputArrayJoint 8-bit, 1-channel or 3-channel image.
src
IInputArraySource 8-bit or floating-point, 1-channel or 3-channel image.
dst
IOutputArrayDestination image.
r
intRadius of filtering kernel, should be a positive integer.
sigma
doubleFilter range standard deviation for the joint image.
weightType
WMFWeightTypeThe type of weight definition
mask
MatA 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.