49 : _memory_group(
std::move(memory_manager)),
54 _border_mag_gradient(),
101 _memory_group.
manage(&_gx);
102 _memory_group.
manage(&_gy);
105 if(gradient_size == 3)
107 auto k = std::make_unique<NESobel3x3>();
108 k->configure(input, &_gx, &_gy, border_mode, constant_border_value);
109 _sobel = std::move(k);
111 else if(gradient_size == 5)
113 auto k = std::make_unique<NESobel5x5>();
114 k->configure(input, &_gx, &_gy, border_mode, constant_border_value);
115 _sobel = std::move(k);
117 else if(gradient_size == 7)
119 auto k = std::make_unique<NESobel7x7>();
120 k->configure(input, &_gx, &_gy, border_mode, constant_border_value);
121 _sobel = std::move(k);
129 _memory_group.
manage(&_magnitude);
130 _memory_group.
manage(&_phase);
133 auto k = std::make_unique<NEGradientKernel>();
134 k->configure(&_gx, &_gy, &_magnitude, &_phase, norm_type);
135 _gradient = std::move(k);
142 _memory_group.
manage(&_nonmax);
145 _non_max_suppr = std::make_unique<NEEdgeNonMaxSuppressionKernel>();
146 _non_max_suppr->configure(&_magnitude, &_phase, &_nonmax, upper_thr, lower_thr, border_mode ==
BorderMode::UNDEFINED);
150 _border_mag_gradient = std::make_unique<NEFillBorderKernel>();
151 _border_mag_gradient->configure(&_magnitude, _non_max_suppr->border_size(), border_mode, constant_border_value);
158 _edge_trace = std::make_unique<NEEdgeTraceKernel>();
159 _edge_trace->configure(&_nonmax, output);
162 _border_edge_trace = std::make_unique<NEFillBorderKernel>();
163 _border_edge_trace->configure(&_nonmax, _edge_trace->border_size(),
BorderMode::CONSTANT,
static_cast<float>(0.f));
BorderMode
Methods available to handle borders.
void init(const TensorAllocator &allocator, const Coordinates &coords, TensorInfo &sub_info)
Shares the same backing memory with another tensor allocator, while the tensor info might be differen...
NECannyEdge(std::shared_ptr< IMemoryManager > memory_manager=nullptr)
Constructor.
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.
1 channel, 1 U16 per channel
Interface for Neon tensor.
void run() override
Run the kernels contained in the function.
Copyright (c) 2017-2021 Arm Limited.
TensorAllocator * allocator()
Return a pointer to the tensor's allocator.
void configure(ITensor *input, ITensor *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...
1 channel, 1 S32 per channel
void manage(IMemoryManageable *obj) override
Sets a object to be managed by the given memory group.
~NECannyEdge()
Default destructor.
1 channel, 1 U32 per channel
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
virtual uint8_t * buffer() const =0
Interface to be implemented by the child class to return a pointer to CPU memory. ...
void allocate() override
Allocate size specified by TensorInfo of CPU memory.
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
#define ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
void init(Format format)
Initialize the tensor info with just a format.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
Memory group resources scope handling class.
virtual size_t total_size() const =0
Returns the total size of the tensor in bytes.
virtual void schedule(ICPPKernel *kernel, const Hints &hints)=0
Runs the kernel in the same thread as the caller synchronously.
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
Borders are left undefined.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Store the tensor's metadata.
static IScheduler & get()
Access the scheduler singleton.