OpenCV  3.3.1 Open Source Computer Vision
Extended Image Processing

## Modules

Structured forests for fast edge detection

Filters

Superpixels

Image segmentation

Fast line detector

## Functions

void cv::ximgproc::anisotropicDiffusion (InputArray src, OutputArray dst, float alpha, float K, int niters)
Performs anisotropic diffusian on an image. More...

void cv::ximgproc::niBlackThreshold (InputArray _src, OutputArray _dst, double maxValue, int type, int blockSize, double k, int binarizationMethod=BINARIZATION_NIBLACK)
Performs thresholding on input images using Niblack's technique or some of the popular variations it inspired. More...

Matx23d cv::PeiLinNormalization (InputArray I)
Calculates an affine transformation that normalize given image using Pei&Lin Normalization. More...

void cv::PeiLinNormalization (InputArray I, OutputArray T)

void cv::ximgproc::thinning (InputArray src, OutputArray dst, int thinningType=THINNING_ZHANGSUEN)
Applies a binary blob thinning operation, to achieve a skeletization of the input image. More...

## § anisotropicDiffusion()

 void cv::ximgproc::anisotropicDiffusion ( InputArray src, OutputArray dst, float alpha, float K, int niters )

Performs anisotropic diffusian on an image.

The function applies Perona-Malik anisotropic diffusion to an image. This is the solution to the partial differential equation:

${\frac {\partial I}{\partial t}}={\mathrm {div}}\left(c(x,y,t)\nabla I\right)=\nabla c\cdot \nabla I+c(x,y,t)\Delta I$

Suggested functions for c(x,y,t) are:

$c\left(\|\nabla I\|\right)=e^{{-\left(\|\nabla I\|/K\right)^{2}}}$

or

$c\left(\|\nabla I\|\right)={\frac {1}{1+\left({\frac {\|\nabla I\|}{K}}\right)^{2}}}$

Parameters
 src Grayscale Source image. dst Destination image of the same size and the same number of channels as src . alpha The amount of time to step forward by on each iteration (normally, it's between 0 and 1). K sensitivity to the edges niters The number of iterations

## § niBlackThreshold()

 void cv::ximgproc::niBlackThreshold ( InputArray _src, OutputArray _dst, double maxValue, int type, int blockSize, double k, int binarizationMethod = BINARIZATION_NIBLACK )

Performs thresholding on input images using Niblack's technique or some of the popular variations it inspired.

The function transforms a grayscale image to a binary image according to the formulae:

• THRESH_BINARY

$dst(x,y) = \fork{\texttt{maxValue}}{if $$src(x,y) > T(x,y)$$}{0}{otherwise}$

• THRESH_BINARY_INV

$dst(x,y) = \fork{0}{if $$src(x,y) > T(x,y)$$}{\texttt{maxValue}}{otherwise}$

where $$T(x,y)$$ is a threshold calculated individually for each pixel.

The threshold value $$T(x, y)$$ is determined based on the binarization method chosen. For classic Niblack, it is the mean minus $$k$$ times standard deviation of $$\texttt{blockSize} \times\texttt{blockSize}$$ neighborhood of $$(x, y)$$.

The function can't process the image in-place.

Parameters
 _src Source 8-bit single-channel image. _dst Destination image of the same size and the same type as src. 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. type Thresholding type, see cv::ThresholdTypes. blockSize Size of a pixel neighborhood that is used to calculate a threshold value for the pixel: 3, 5, 7, and so on. 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. binarizationMethod Binarization method to use. By default, Niblack's technique is used. Other techniques can be specified, see cv::ximgproc::LocalBinarizationMethods.

## § PeiLinNormalization() [1/2]

 Matx23d cv::PeiLinNormalization ( InputArray I )

Calculates an affine transformation that normalize given image using Pei&Lin Normalization.

Assume given image $$I=T(\bar{I})$$ where $$\bar{I}$$ is a normalized image and $$T$$ is an affine transformation distorting this image by translation, rotation, scaling and skew. The function returns an affine transformation matrix corresponding to the transformation $$T^{-1}$$ described in [PeiLin95]. For more details about this implementation, please see [PeiLin95] Soo-Chang Pei and Chao-Nan Lin. Image normalization for pattern recognition. Image and Vision Computing, Vol. 13, N.10, pp. 711-723, 1995.

Parameters
 I Given transformed image.
Returns
Transformation matrix corresponding to inversed image transformation

## § PeiLinNormalization() [2/2]

 void cv::PeiLinNormalization ( InputArray I, OutputArray T )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## § thinning()

 void cv::ximgproc::thinning ( InputArray src, OutputArray dst, int thinningType = THINNING_ZHANGSUEN )

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.

Parameters
 src Source 8-bit single-channel image, containing binary blobs, with blobs having 255 pixel values. dst Destination image of the same size and the same type as src. The function can work in-place. thinningType Value that defines which thinning algorithm should be used. See cv::ximgproc::ThinningTypes