Threshold Class Reference#
3 min read time
Class for managing the Threshold operator. More...
#include <op_thresholding.hpp>

Public Member Functions | |
void | operator() (hipStream_t stream, const roccv::Tensor &input, const roccv::Tensor &output, const roccv::Tensor &thresh, const roccv::Tensor &maxVal, eDeviceType device=eDeviceType::GPU) |
Construct a new Threshold object. The object can be used to choose a global threshold value that is the same for all pixels across the image. More... | |
Threshold (eThresholdType threshType, int32_t maxBatchSize) | |
Constructs a Threshold object. More... | |
~Threshold () | |
Destroy the Threshold object. More... | |
![]() | |
virtual | ~IOperator () |
Detailed Description
Class for managing the Threshold operator.
Constructor & Destructor Documentation
◆ Threshold()
roccv::Threshold::Threshold | ( | eThresholdType | threshType, |
int32_t | maxBatchSize | ||
) |
Constructs a Threshold object.
◆ ~Threshold()
roccv::Threshold::~Threshold | ( | ) |
Destroy the Threshold object.
Member Function Documentation
◆ operator()()
void roccv::Threshold::operator() | ( | hipStream_t | stream, |
const roccv::Tensor & | input, | ||
const roccv::Tensor & | output, | ||
const roccv::Tensor & | thresh, | ||
const roccv::Tensor & | maxVal, | ||
eDeviceType | device = eDeviceType::GPU |
||
) |
Construct a new Threshold object. The object can be used to choose a global threshold value that is the same for all pixels across the image.
Limitations:
Input: Supported TensorLayout(s): [HWC, NHWC] Channels: [1, 3, 4] Supported DataType(s): [U8]
Output: Supported TensorLayout(s): [HWC, NHWC] Channels: [1, 3, 4] Supported DataType(s): [U8]
Input/Output dependency
Property | Input == Output -------------- | ------------- Data Layout | Yes Data Type | Yes Number | Yes Channels | Yes Width | Yes Height | Yes
threshold Tensor
Must be of layout type 'NW' (dim = 2) with N = maxBatchSize and W = 1 Data Type must be an 8bit unsigned integer (DATA_TYPE_U8).
maxval Tensor
Must be of layout type 'NW' (dim = 2) with N = maxBatchSize and W = 1 Data Type must be 8bit unsigned integer (DATA_TYPE_U8).
thresh and maxVal are expected to be contiguous in memory.
Current Supported Threshold Types (threshType)
- THRESH_BINARY
- THRESH_BINARY_INV
- THRESH_TRUNC
- THRESH_TOZERO
- THRESH_TOZERO_INV
- Parameters
-
[in] stream The HIP stream to run this operation on. [in] input Input tensor with image batch data [out] output Output tensor for storing modified image batch data [in] thresh thresh an array of size maxBatch that gives the threshold value of each image. [in] maxVal maxval an array of size maxBatch that gives the maxval value of each image, used with the THRESH_BINARY and THRESH_BINARY_INV thresholding types. [in] device The device which this operation should run on. (Default: eDeviceType::GPU)
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-roccv/checkouts/latest/include/op_thresholding.hpp