21.02
|
Basic function to execute canny edge on OpenCL. More...
#include <CLCannyEdge.h>
Public Member Functions | |
CLCannyEdge (std::shared_ptr< IMemoryManager > memory_manager=nullptr) | |
Constructor. More... | |
CLCannyEdge (const CLCannyEdge &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
CLCannyEdge & | operator= (const CLCannyEdge &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
~CLCannyEdge () | |
Default destructor. More... | |
void | configure (ICLTensor *input, ICLTensor *output, int32_t upper_thr, int32_t lower_thr, int32_t gradient_size, int32_t norm_type, BorderMode border_mode, uint8_t constant_border_value=0) |
Initialise the function's source, destination, thresholds, gradient size, normalization type and border mode. More... | |
void | configure (const CLCompileContext &compile_context, ICLTensor *input, ICLTensor *output, int32_t upper_thr, int32_t lower_thr, int32_t gradient_size, int32_t norm_type, BorderMode border_mode, uint8_t constant_border_value=0) |
Initialise the function's source, destination, thresholds, gradient size, normalization type and border mode. More... | |
virtual void | run () override |
Run the kernels contained in the function. More... | |
Public Member Functions inherited from IFunction | |
virtual | ~IFunction ()=default |
Destructor. More... | |
virtual void | prepare () |
Prepare the function for executing. More... | |
Basic function to execute canny edge on OpenCL.
This function calls the following OpenCL kernels and functions:
Definition at line 55 of file CLCannyEdge.h.
CLCannyEdge | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default destructor.
void configure | ( | ICLTensor * | input, |
ICLTensor * | output, | ||
int32_t | upper_thr, | ||
int32_t | lower_thr, | ||
int32_t | gradient_size, | ||
int32_t | norm_type, | ||
BorderMode | border_mode, | ||
uint8_t | constant_border_value = 0 |
||
) |
Initialise the function's source, destination, thresholds, gradient size, normalization type and border mode.
[in,out] | input | Source tensor. Data types supported: U8. (Written to only for border_mode != UNDEFINED) |
[out] | output | Destination tensor. Data types supported: U8. |
[in] | upper_thr | Upper threshold used for the hysteresis. |
[in] | lower_thr | Lower threshold used for the hysteresis. |
[in] | gradient_size | Gradient size (3, 5 or 7). |
[in] | norm_type | Normalization type. if 1, L1-Norm otherwise L2-Norm. |
[in] | border_mode | Border mode to use for the convolution. |
[in] | constant_border_value | (Optional) Constant value to use for borders if border_mode is set to CONSTANT. |
Definition at line 63 of file CLCannyEdge.cpp.
References CLKernelLibrary::get().
void configure | ( | const CLCompileContext & | compile_context, |
ICLTensor * | input, | ||
ICLTensor * | output, | ||
int32_t | upper_thr, | ||
int32_t | lower_thr, | ||
int32_t | gradient_size, | ||
int32_t | norm_type, | ||
BorderMode | border_mode, | ||
uint8_t | constant_border_value = 0 |
||
) |
Initialise the function's source, destination, thresholds, gradient size, normalization type and border mode.
[in] | compile_context | The compile context to be used. |
[in,out] | input | Source tensor. Data types supported: U8. (Written to only for border_mode != UNDEFINED) |
[out] | output | Destination tensor. Data types supported: U8. |
[in] | upper_thr | Upper threshold used for the hysteresis. |
[in] | lower_thr | Lower threshold used for the hysteresis. |
[in] | gradient_size | Gradient size (3, 5 or 7). |
[in] | norm_type | Normalization type. if 1, L1-Norm otherwise L2-Norm. |
[in] | border_mode | Border mode to use for the convolution. |
[in] | constant_border_value | (Optional) Constant value to use for borders if border_mode is set to CONSTANT. |
Definition at line 69 of file CLCannyEdge.cpp.
References CLTensorAllocator::allocate(), CLTensor::allocator(), ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_VAR, ITensorInfo::dimension(), ITensor::info(), arm_compute::test::validation::info, ITensorAllocator::init(), TensorInfo::init(), MemoryGroup::manage(), arm_compute::S16, arm_compute::S32, TensorShape::set(), arm_compute::test::validation::shape, ITensorInfo::tensor_shape(), arm_compute::U16, arm_compute::U32, arm_compute::U8, and arm_compute::UNDEFINED.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
overridevirtual |
Run the kernels contained in the function.
For Neon kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 190 of file CLCannyEdge.cpp.
References ICLTensor::clear(), CLScheduler::enqueue(), and CLScheduler::get().