DIPlib Documentation - ©1995-2013 Quantitative Imaging Group, Delft University of Technology.

# Threshold

Point Operation

## SYNOPSIS

`#include "dip_point.h"`

dip_Error dip_Threshold ( in, out, threshold, foreground, background, binaryOutput )

## DATA TYPES

integer, float

## FUNCTION

This function thresholds an image at the `threshold` value. If the boolean `binaryOutput` is true, `Threshold` will produce a binary image. Otherwise an image of the same type as the input image is produced, with the pixels set to either `foreground` or `background`. In other words: `out` = ( `in` >= `` threshold ? `foreground` : `background`)

## ARGUMENTS

Data type | Name | Description
`dip_Image` | `in` | Input image
`dip_Image` | `out` | Output image
`dip_float` | `threshold` | Threshold value
`dip_float` | `foreground` | Foreground value
`dip_float` | `background` | Background value
`dip_Boolean` | `binaryOutput` | Convert output image to binary

## SEE ALSO

See section 10.3, "Segmentation", in Fundamentals of Image Processing.

`RangeThreshold`, `SelectValue`, `NotZero`, `Compare`, `HysteresisThreshold`, `IsodataThreshold`, `Clip`