OpenCV  3.2.0
Open Source Computer Vision
Modules | Functions
Extended Image Processing

Modules

 Structured forests for fast edge detection
 
 Filters
 
 Superpixels
 
 Image segmentation
 
 Fast line detector
 

Functions

void cv::ximgproc::niBlackThreshold (InputArray _src, OutputArray _dst, double maxValue, int type, int blockSize, double delta)
 Applies Niblack thresholding to input image. More...
 
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...
 

Detailed Description

Function Documentation

§ niBlackThreshold()

void cv::ximgproc::niBlackThreshold ( InputArray  _src,
OutputArray  _dst,
double  maxValue,
int  type,
int  blockSize,
double  delta 
)

Applies Niblack thresholding to input image.

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 the mean minus \( delta \) times standard deviation of \(\texttt{blockSize} \times\texttt{blockSize}\) neighborhood of \((x, y)\).

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

Parameters
_srcSource 8-bit single-channel image.
_dstDestination image of the same size and the same type as src.
maxValueNon-zero value assigned to the pixels for which the condition is satisfied, used with the THRESH_BINARY and THRESH_BINARY_INV thresholding types.
typeThresholding type, see cv::ThresholdTypes.
blockSizeSize of a pixel neighborhood that is used to calculate a threshold value for the pixel: 3, 5, 7, and so on.
deltaConstant multiplied with the standard deviation and subtracted from the mean. Normally, it is taken to be a real number between 0 and 1.
See also
threshold, adaptiveThreshold

§ 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
srcSource 8-bit single-channel image, containing binary blobs, with blobs having 255 pixel values.
dstDestination image of the same size and the same type as src. The function can work in-place.
thinningTypeValue that defines which thinning algorithm should be used. See cv::ThinningTypes