49 : _memory_group(
std::move(memory_manager)),
62 _num_corner_candidates(0)
67 float sensitivity, int32_t gradient_size, int32_t block_size,
KeyPointArray *corners,
68 BorderMode border_mode, uint8_t constant_border_value)
90 _memory_group.
manage(&_gx);
91 _memory_group.
manage(&_gy);
97 _corners_list.resize(shape.
x() * shape.
y());
100 switch(gradient_size)
104 auto k = std::make_unique<NESobel3x3>();
105 k->configure(input, &_gx, &_gy, border_mode, constant_border_value);
106 _sobel = std::move(k);
111 auto k = std::make_unique<NESobel5x5>();
112 k->configure(input, &_gx, &_gy, border_mode, constant_border_value);
113 _sobel = std::move(k);
118 auto k = std::make_unique<NESobel7x7>();
119 k->configure(input, &_gx, &_gy, border_mode, constant_border_value);
120 _sobel = std::move(k);
128 const float norm_factor = 1.0f / (255.0f * pow(4.0f, gradient_size / 2) * block_size);
131 _memory_group.
manage(&_score);
138 auto k = std::make_unique<NEHarrisScoreKernel<3>>();
139 k->configure(&_gx, &_gy, &_score, norm_factor, threshold, sensitivity, border_mode ==
BorderMode::UNDEFINED);
140 _harris_score = std::move(k);
145 auto k = std::make_unique<NEHarrisScoreKernel<5>>();
146 k->configure(&_gx, &_gy, &_score, norm_factor, threshold, sensitivity, border_mode ==
BorderMode::UNDEFINED);
147 _harris_score = std::move(k);
152 auto k = std::make_unique<NEHarrisScoreKernel<7>>();
153 k->configure(&_gx, &_gy, &_score, norm_factor, threshold, sensitivity, border_mode ==
BorderMode::UNDEFINED);
154 _harris_score = std::move(k);
161 _border_gx = std::make_unique<NEFillBorderKernel>();
162 _border_gy = std::make_unique<NEFillBorderKernel>();
163 _border_gx->configure(&_gx, _harris_score->border_size(), border_mode, constant_border_value);
164 _border_gy->configure(&_gy, _harris_score->border_size(), border_mode, constant_border_value);
171 _memory_group.
manage(&_nonmax);
174 _non_max_suppr.
configure(&_score, &_nonmax, border_mode);
180 _candidates.
configure(&_nonmax, _corners_list.data(), &_num_corner_candidates);
186 _sort_euclidean.
configure(_corners_list.data(), corners, &_num_corner_candidates, min_dist);
196 _num_corner_candidates = 0;
209 _non_max_suppr.
run();
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...
#define ARM_COMPUTE_ERROR_ON_TENSOR_NOT_2D(t)
void run() override final
Run the kernels contained in the function.
NEHarrisCorners(std::shared_ptr< IMemoryManager > memory_manager=nullptr)
Constructor.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
1 channel, 1 U8 per channel
1 channel, 1 F32 per channel
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Interface for Neon tensor.
Copyright (c) 2017-2021 Arm Limited.
TensorAllocator * allocator()
Return a pointer to the tensor's allocator.
Basic implementation of the IArray interface which allocates a static number of T values...
1 channel, 1 S32 per channel
void manage(IMemoryManageable *obj) override
Sets a object to be managed by the given memory group.
T x() const
Alias to access the size of the first dimension.
~NEHarrisCorners()
Default destructor.
void run() override
Run the kernels contained in the function.
void configure(InternalKeypoint *in_out, IKeyPointArray *output, const int32_t *num_corner_candidates, float min_distance)
Initialise the kernel's source, destination and border mode.
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
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
void configure(ITensor *input, ITensor *output, BorderMode border_mode)
Initialise the function's source, destinations and border mode.
#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.
Memory group resources scope handling class.
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.
void configure(IImage *input, float threshold, float min_dist, float sensitivity, int32_t gradient_size, int32_t block_size, KeyPointArray *corners, BorderMode border_mode, uint8_t constant_border_value=0)
Initialize the function's source, destination, conv and border_mode.
Store the tensor's metadata.
T y() const
Alias to access the size of the second dimension.
SimpleTensor< T > threshold(const SimpleTensor< T > &src, T threshold, T false_value, T true_value, ThresholdType type, T upper)
void configure(const IImage *input, InternalKeypoint *output, int32_t *num_corner_candidates)
Setup the kernel parameters.
static IScheduler & get()
Access the scheduler singleton.