Back to Aurora Vision Studio website

You are here: Start » Filter Reference » OpenCV » Miscellaneous Image Transformations » cvThreshold

cvThreshold


Module: OpenCV

Applies a fixed-level threshold to each image element.

Name Type Description
Input value inImage Image Input image.
Input value inThresh Real Threshold value.
Input value inMaxVal Real Maximum value to use with the THRESH_BINARY and THRESH_BINARY_INV thresholding types.
Input value inThresholdType CvThresholdType Thresholding type.
Input value inUseOtsu Bool Flag specifying if OTSU algorithm should be used.
Output value outImage Image Output image

Description

cvThreshold applies fixed-level thresholding to single-channel images. It is used to get binary image out of a grayscale image or for removing a noise. It is filtering out pixels with too small or too large values. There are several types of thresholding supported by the function. They are determined by inThresholdType:

THRESH_BINARY

THRESH_BINARY_INV

THRESH_TRUNC

THRESH_TOZERO

THRESH_TOZERO_INV

Examples

Result of cvThreshold performed on the sample image with inThresh = 128, inMaxVal = 255, inThresholdType = THRESH_BINARY, inUseOtsu = false.

Errors

This filter can throw an exception to report error. Read how to deal with errors in Error Handling.

List of possible exceptions:

Error type Description
DomainError Input image must be 1-channel, UINT8 or REAL image in cvThreshold.

Complexity Level

This filter is available on Basic Complexity Level.

See Also