OpenCV  3.0.0-dev Open Source Computer Vision

## Classes

Interface for Adaptive Manifold Filter realizations. More...

class  cv::ximgproc::DisparityFilter
Main interface for all disparity map filters. More...

class  cv::ximgproc::DisparityWLSFilter
Disparity map filter based on Weighted Least Squares filter (in form of Fast Global Smoother that is a lot faster than traditional Weighted Least Squares filter implementations) and optional use of left-right-consistency-based confidence to refine the results in half-occlusions and uniform areas. More...

class  cv::ximgproc::DTFilter
Interface for realizations of Domain Transform filter. More...

class  cv::ximgproc::EdgeAwareInterpolator
Sparse match interpolation algorithm based on modified locally-weighted affine estimator from [116] and Fast Global Smoother as post-processing filter. More...

class  cv::ximgproc::FastGlobalSmootherFilter
Interface for implementations of Fast Global Smoother filter. More...

class  cv::ximgproc::GuidedFilter
Interface for realizations of Guided Filter. More...

class  cv::ximgproc::SparseMatchInterpolator
Main interface for all filters, that take sparse matches as an input and produce a dense per-pixel matching (optical flow) as an output. More...

## Enumerations

enum  cv::ximgproc::EdgeAwareFiltersList {
cv::ximgproc::DTF_NC,
cv::ximgproc::DTF_IC,
cv::ximgproc::DTF_RF,
cv::ximgproc::GUIDED_FILTER,
cv::ximgproc::AM_FILTER
}

## Functions

void cv::ximgproc::amFilter (InputArray joint, InputArray src, OutputArray dst, double sigma_s, double sigma_r, bool adjust_outliers=false)
Simple one-line Adaptive Manifold Filter call. More...

double cv::ximgproc::computeBadPixelPercent (InputArray GT, InputArray src, Rect ROI, int thresh=24)
Function for computing the percent of "bad" pixels in the disparity map (pixels where error is higher than a specified threshold) More...

double cv::ximgproc::computeMSE (InputArray GT, InputArray src, Rect ROI)
Function for computing mean square error for disparity maps. More...

Factory method, create instance of AdaptiveManifoldFilter and produce some initialization routines. More...

Ptr< DisparityWLSFilter > cv::ximgproc::createDisparityWLSFilter (Ptr< StereoMatcher > matcher_left)
Convenience factory method that creates an instance of DisparityWLSFilter and sets up all the relevant filter parameters automatically based on the matcher instance. Currently supports only StereoBM and StereoSGBM. More...

Ptr< DisparityWLSFilter > cv::ximgproc::createDisparityWLSFilterGeneric (bool use_confidence)
More generic factory method, create instance of DisparityWLSFilter and execute basic initialization routines. When using this method you will need to set-up the ROI, matchers and other parameters by yourself. More...

Ptr< DTFilter > cv::ximgproc::createDTFilter (InputArray guide, double sigmaSpatial, double sigmaColor, int mode=DTF_NC, int numIters=3)
Factory method, create instance of DTFilter and produce initialization routines. More...

Ptr< EdgeAwareInterpolator > cv::ximgproc::createEdgeAwareInterpolator ()
Factory method that creates an instance of the EdgeAwareInterpolator. More...

Ptr< FastGlobalSmootherFilter > cv::ximgproc::createFastGlobalSmootherFilter (InputArray guide, double lambda, double sigma_color, double lambda_attenuation=0.25, int num_iter=3)
Factory method, create instance of FastGlobalSmootherFilter and execute the initialization routines. More...

Ptr< GuidedFilter > cv::ximgproc::createGuidedFilter (InputArray guide, int radius, double eps)
Factory method, create instance of GuidedFilter and produce initialization routines. More...

Ptr< StereoMatcher > cv::ximgproc::createRightMatcher (Ptr< StereoMatcher > matcher_left)
Convenience method to set up the matcher for computing the right-view disparity map that is required in case of filtering with confidence. More...

void cv::ximgproc::dtFilter (InputArray guide, InputArray src, OutputArray dst, double sigmaSpatial, double sigmaColor, int mode=DTF_NC, int numIters=3)
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. More...

void cv::ximgproc::fastGlobalSmootherFilter (InputArray guide, InputArray src, OutputArray dst, double lambda, double sigma_color, double lambda_attenuation=0.25, int num_iter=3)
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. More...

void cv::ximgproc::getDisparityVis (InputArray src, OutputArray dst, double scale=1.0)
Function for creating a disparity map visualization (clamped CV_8U image) More...

void cv::ximgproc::guidedFilter (InputArray guide, InputArray src, OutputArray dst, int radius, double eps, int dDepth=-1)
Simple one-line Guided Filter call. More...

void cv::ximgproc::jointBilateralFilter (InputArray joint, InputArray src, OutputArray dst, int d, double sigmaColor, double sigmaSpace, int borderType=BORDER_DEFAULT)
Applies the joint bilateral filter to an image. More...

void cv::ximgproc::l0Smooth (InputArray src, OutputArray dst, double lambda=0.02, double kappa=2.0)
Global image smoothing via L0 gradient minimization. More...

int cv::ximgproc::readGT (String src_path, OutputArray dst)
Function for reading ground truth disparity maps. Supports basic Middlebury and MPI-Sintel formats. Note that the resulting disparity map is scaled by 16. More...

void cv::ximgproc::rollingGuidanceFilter (InputArray src, OutputArray dst, int d=-1, double sigmaColor=25, double sigmaSpace=3, int numOfIter=4, int borderType=BORDER_DEFAULT)
Applies the rolling guidance filter to an image. More...

Enumerator
DTF_NC
DTF_IC
DTF_RF
GUIDED_FILTER
AM_FILTER

## Function Documentation

 void cv::ximgproc::amFilter ( InputArray joint, InputArray src, OutputArray dst, double sigma_s, double sigma_r, bool adjust_outliers = false )

Simple one-line Adaptive Manifold Filter call.

Parameters
 joint joint (also called as guided) image or array of images with any numbers of channels. src filtering image with any numbers of channels. dst output image. sigma_s spatial standard deviation. sigma_r color space standard deviation, it is similar to the sigma in the color space into bilateralFilter. adjust_outliers optional, specify perform outliers adjust operation or not, (Eq. 9) in the original paper.
Note
Joint images with CV_8U and CV_16U depth converted to images with CV_32F depth and [0; 1] color range before processing. Hence color space sigma sigma_r must be in [0; 1] range, unlike same sigmas in bilateralFilter and dtFilter functions.
bilateralFilter, dtFilter, guidedFilter
 double cv::ximgproc::computeBadPixelPercent ( InputArray GT, InputArray src, Rect ROI, int thresh = 24 )

Function for computing the percent of "bad" pixels in the disparity map (pixels where error is higher than a specified threshold)

Parameters
 GT ground truth disparity map src disparity map to evaluate ROI region of interest thresh threshold used to determine "bad" pixels
Returns
returns mean square error between GT and src
 double cv::ximgproc::computeMSE ( InputArray GT, InputArray src, Rect ROI )

Function for computing mean square error for disparity maps.

Parameters
 GT ground truth disparity map src disparity map to evaluate ROI region of interest
Returns
returns mean square error between GT and src
 Ptr cv::ximgproc::createAMFilter ( double sigma_s, double sigma_r, bool adjust_outliers = false )

Factory method, create instance of AdaptiveManifoldFilter and produce some initialization routines.

Parameters
 sigma_s spatial standard deviation. sigma_r color space standard deviation, it is similar to the sigma in the color space into bilateralFilter. adjust_outliers optional, specify perform outliers adjust operation or not, (Eq. 9) in the original paper.

For more details about Adaptive Manifold Filter parameters, see the original article [55] .

Note
Joint images with CV_8U and CV_16U depth converted to images with CV_32F depth and [0; 1] color range before processing. Hence color space sigma sigma_r must be in [0; 1] range, unlike same sigmas in bilateralFilter and dtFilter functions.
 Ptr cv::ximgproc::createDisparityWLSFilter ( Ptr< StereoMatcher > matcher_left )

Convenience factory method that creates an instance of DisparityWLSFilter and sets up all the relevant filter parameters automatically based on the matcher instance. Currently supports only StereoBM and StereoSGBM.

Parameters
 matcher_left stereo matcher instance that will be used with the filter
 Ptr cv::ximgproc::createDisparityWLSFilterGeneric ( bool use_confidence )

More generic factory method, create instance of DisparityWLSFilter and execute basic initialization routines. When using this method you will need to set-up the ROI, matchers and other parameters by yourself.

Parameters
 use_confidence filtering with confidence requires two disparity maps (for the left and right views) and is approximately two times slower. However, quality is typically significantly better.
 Ptr cv::ximgproc::createDTFilter ( InputArray guide, double sigmaSpatial, double sigmaColor, int mode = DTF_NC, int numIters = 3 )

Factory method, create instance of DTFilter and produce initialization routines.

Parameters
 guide guided image (used to build transformed distance, which describes edge structure of guided image). sigmaSpatial $${\sigma}_H$$ parameter in the original article, it's similar to the sigma in the coordinate space into bilateralFilter. sigmaColor $${\sigma}_r$$ parameter in the original article, it's similar to the sigma in the color space into bilateralFilter. mode one form three modes DTF_NC, DTF_RF and DTF_IC which corresponds to three modes for filtering 2D signals in the article. numIters optional number of iterations used for filtering, 3 is quite enough.

For more details about Domain Transform filter parameters, see the original article [54] and Domain Transform filter homepage.

 Ptr cv::ximgproc::createEdgeAwareInterpolator ( )

Factory method that creates an instance of the EdgeAwareInterpolator.

 Ptr cv::ximgproc::createFastGlobalSmootherFilter ( InputArray guide, double lambda, double sigma_color, double lambda_attenuation = 0.25, int num_iter = 3 )

Factory method, create instance of FastGlobalSmootherFilter and execute the initialization routines.

Parameters
 guide image serving as guide for filtering. It should have 8-bit depth and either 1 or 3 channels. lambda parameter defining the amount of regularization sigma_color parameter, that is similar to color space sigma in bilateralFilter. lambda_attenuation 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. num_iter number of iterations used for filtering, 3 is usually enough.

For more details about Fast Global Smoother parameters, see the original paper [101]. However, please note that there are several differences. Lambda attenuation described in the paper is implemented a bit differently so do not expect the results to be identical to those from the paper; sigma_color values from the paper should be multiplied by 255.0 to achieve the same effect. Also, in case of image filtering where source and guide image are the same, authors propose to dynamically update the guide image after each iteration. To maximize the performance this feature was not implemented here.

 Ptr cv::ximgproc::createGuidedFilter ( InputArray guide, int radius, double eps )

Factory method, create instance of GuidedFilter and produce initialization routines.

Parameters
 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. radius radius of Guided Filter. eps regularization term of Guided Filter. $${eps}^2$$ is similar to the sigma in the color space into bilateralFilter.

For more details about Guided Filter parameters, see the original article [64] .

 Ptr cv::ximgproc::createRightMatcher ( Ptr< StereoMatcher > matcher_left )

Convenience method to set up the matcher for computing the right-view disparity map that is required in case of filtering with confidence.

Parameters
 matcher_left main stereo matcher instance that will be used with the filter
 void cv::ximgproc::dtFilter ( InputArray guide, InputArray src, OutputArray dst, double sigmaSpatial, double sigmaColor, int mode = DTF_NC, int numIters = 3 )

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.

Parameters
 guide guided image (also called as joint image) with unsigned 8-bit or floating-point 32-bit depth and up to 4 channels. src filtering image with unsigned 8-bit or floating-point 32-bit depth and up to 4 channels. dst sigmaSpatial $${\sigma}_H$$ parameter in the original article, it's similar to the sigma in the coordinate space into bilateralFilter. sigmaColor $${\sigma}_r$$ parameter in the original article, it's similar to the sigma in the color space into bilateralFilter. mode one form three modes DTF_NC, DTF_RF and DTF_IC which corresponds to three modes for filtering 2D signals in the article. numIters optional number of iterations used for filtering, 3 is quite enough.
bilateralFilter, guidedFilter, amFilter
 void cv::ximgproc::fastGlobalSmootherFilter ( InputArray guide, InputArray src, OutputArray dst, double lambda, double sigma_color, double lambda_attenuation = 0.25, int num_iter = 3 )

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.

Parameters
 guide image serving as guide for filtering. It should have 8-bit depth and either 1 or 3 channels. src source image for filtering with unsigned 8-bit or signed 16-bit or floating-point 32-bit depth and up to 4 channels. dst destination image. lambda parameter defining the amount of regularization sigma_color parameter, that is similar to color space sigma in bilateralFilter. lambda_attenuation 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. num_iter number of iterations used for filtering, 3 is usually enough.
 void cv::ximgproc::getDisparityVis ( InputArray src, OutputArray dst, double scale = 1.0 )

Function for creating a disparity map visualization (clamped CV_8U image)

Parameters
 src input disparity map (CV_16S depth) dst output visualization scale disparity map will be multiplied by this value for visualization
 void cv::ximgproc::guidedFilter ( InputArray guide, InputArray src, OutputArray dst, int radius, double eps, int dDepth = -1 )

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.

Parameters
 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. src filtering image with any numbers of channels. dst output image. radius radius of Guided Filter. eps regularization term of Guided Filter. $${eps}^2$$ is similar to the sigma in the color space into bilateralFilter. dDepth optional depth of the output image.
bilateralFilter, dtFilter, amFilter
 void cv::ximgproc::jointBilateralFilter ( InputArray joint, InputArray src, OutputArray dst, int d, double sigmaColor, double sigmaSpace, int borderType = BORDER_DEFAULT )

Applies the joint bilateral filter to an image.

Parameters
 joint Joint 8-bit or floating-point, 1-channel or 3-channel image. src Source 8-bit or floating-point, 1-channel or 3-channel image with the same depth as joint image. dst Destination image of the same size and type as src . d Diameter of each pixel neighborhood that is used during filtering. If it is non-positive, it is computed from sigmaSpace . 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. 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 . borderType
Note
bilateralFilter and jointBilateralFilter use L1 norm to compute difference between colors.
bilateralFilter, amFilter
 void cv::ximgproc::l0Smooth ( InputArray src, OutputArray dst, double lambda = 0.02, double kappa = 2.0 )

Global image smoothing via L0 gradient minimization.

Parameters
 src source image for filtering with unsigned 8-bit or signed 16-bit or floating-point depth. dst destination image. lambda parameter defining the smooth term weight. kappa parameter defining the increasing factor of the weight of the gradient data term.

For more details about L0 Smoother, see the original paper [153].

 int cv::ximgproc::readGT ( String src_path, OutputArray dst )

Function for reading ground truth disparity maps. Supports basic Middlebury and MPI-Sintel formats. Note that the resulting disparity map is scaled by 16.

Parameters
 src_path path to the image, containing ground-truth disparity map dst output disparity map, CV_16S depth
Returns
returns zero if successfully read the ground truth
 void cv::ximgproc::rollingGuidanceFilter ( InputArray src, OutputArray dst, int d = -1, double sigmaColor = 25, double sigmaSpace = 3, int numOfIter = 4, int borderType = BORDER_DEFAULT )

Applies the rolling guidance filter to an image.

Parameters
 src Source 8-bit or floating-point, 1-channel or 3-channel image. dst Destination image of the same size and type as src. d Diameter of each pixel neighborhood that is used during filtering. If it is non-positive, it is computed from sigmaSpace . 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. 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 . numOfIter Number of iterations of joint edge-preserving filtering applied on the source image. borderType
Note
rollingGuidanceFilter uses jointBilateralFilter as the edge-preserving filter.