hls::Threshold


Synopsis

template<int ROWS, int COLS, int SRC_T, int DST_T, typename P_T>
void hls::Threshold( hls::Mat<ROWS, COLS, SRC_T>& src,
                     hls::Mat<ROWS, COLS, DST_T>& dst,
                     P_T thresh,
                     P_T maxval,
                     int thresh_type );

Parameters

  • src – the input single-channel image.
  • dst – the output single-channel image.
  • thresh – threshold value.
  • maxval – maximum value to use with some threshold types.
  • thresh_type – threshold type, see details in description.

Description


Performs a fixed-level threshold to each element in a single-channel image srcand return the result as a single-channel image dst. The thresholding type supported by this function are determined by thresh_type:
  • HLS_THRESH_BINARY
Threshold1.png
  • HLS_THRESH_BINARY_INV
Threshold2.png
  • HLS_THRESH_TRUNC
Threshold3.png
  • HLS_THRESH_TOZERO
Threshold4.png
  • HLS_THRESH_TOZERO_INV
Threshold5.png
Image data must be stored in src, the image data of dst must be empty before invocations. Invoking this function will consume the data in src, and filling the image data of dst.
src and dst must have the same size and be single-channel images. thresh and maxval must have the same data types.


OpenCV reference


cvThreshold, cv::threshold