42 : _memory_group(
std::move(memory_manager)),
64 uint8_t constant_border_value)
66 configure(
CLKernelLibrary::get().get_compile_context(), input, output, upper_thr, lower_thr, gradient_size, norm_type, border_mode, constant_border_value);
71 uint8_t constant_border_value)
82 const unsigned int L1_hysteresis_stack_size = 8;
114 shape_l1_stack.
set(0, input->
info()->
dimension(0) * L1_hysteresis_stack_size);
119 _memory_group.
manage(&_gx);
120 _memory_group.
manage(&_gy);
123 if(gradient_size == 3)
125 auto k = std::make_unique<CLSobel3x3>();
126 k->configure(compile_context, input, &_gx, &_gy, border_mode, constant_border_value);
127 _sobel = std::move(k);
129 else if(gradient_size == 5)
131 auto k = std::make_unique<CLSobel5x5>();
132 k->configure(compile_context, input, &_gx, &_gy, border_mode, constant_border_value);
133 _sobel = std::move(k);
135 else if(gradient_size == 7)
137 auto k = std::make_unique<CLSobel7x7>();
138 k->configure(compile_context, input, &_gx, &_gy, border_mode, constant_border_value);
139 _sobel = std::move(k);
147 _memory_group.
manage(&_mag);
148 _memory_group.
manage(&_phase);
151 _gradient->configure(compile_context, &_gx, &_gy, &_mag, &_phase, norm_type);
158 _memory_group.
manage(&_nonmax);
161 _non_max_suppr->configure(compile_context, &_mag, &_phase, &_nonmax, lower_thr, border_mode ==
BorderMode::UNDEFINED);
168 _border_mag_gradient->configure(compile_context, &_mag, _non_max_suppr->border_size(), border_mode, constant_border_value);
174 _memory_group.
manage(&_visited);
175 _memory_group.
manage(&_recorded);
176 _memory_group.
manage(&_l1_stack);
177 _memory_group.
manage(&_l1_list_counter);
180 _edge_trace->configure(compile_context, &_nonmax, output, upper_thr, lower_thr, &_visited, &_recorded, &_l1_stack, &_l1_list_counter);
BorderMode
Methods available to handle borders.
OpenCL kernel to perform Gradient computation.
virtual size_t dimension(size_t index) const =0
Return the size of the requested dimension.
static CLScheduler & get()
Access the scheduler singleton.
1 channel, 1 U8 per channel
#define ARM_COMPUTE_ERROR_VAR(msg,...)
Print the given message then throw an std::runtime_error.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
CLTensorAllocator * allocator()
Return a pointer to the tensor's allocator.
1 channel, 1 U16 per channel
void init(const TensorInfo &input, size_t alignment=0)
Initialize a tensor based on the passed TensorInfo.
Copyright (c) 2017-2021 Arm Limited.
1 channel, 1 S32 per channel
void manage(IMemoryManageable *obj) override
Sets a object to be managed by the given memory group.
virtual void run() override
Run the kernels contained in the function.
Interface to enqueue OpenCL kernels and get/set the OpenCL CommandQueue and ICLTuner.
CLCannyEdge(std::shared_ptr< IMemoryManager > memory_manager=nullptr)
Constructor.
void clear(cl::CommandQueue &q)
Clear the contents of the tensor synchronously.
1 channel, 1 U32 per channel
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
1 channel, 1 S16 per channel
void enqueue(ICLKernel &kernel, bool flush=true)
Schedule the execution of the passed kernel if possible.
#define ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
void init(Format format)
Initialize the tensor info with just a format.
void allocate() override
Allocate size specified by TensorInfo of OpenCL memory.
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 bord...
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
Interface for filling the border of a kernel.
Memory group resources scope handling class.
Interface for OpenCL tensor.
OpenCL kernel to perform Edge tracing.
Borders are left undefined.
Wrapper to configure the Khronos OpenCL C++ header.
~CLCannyEdge()
Default destructor.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Store the tensor's metadata.
TensorShape & set(size_t dimension, size_t value, bool apply_dim_correction=true, bool increase_dim_unit=true)
Accessor to set the value of one of the dimensions.
OpenCL kernel to perform Non-Maxima suppression for Canny Edge.