48 : _memory_group(std::move(memory_manager)),
61 _num_corner_candidates(0),
69 float sensitivity, int32_t gradient_size, int32_t block_size,
ICLKeyPointArray *corners,
70 BorderMode border_mode, uint8_t constant_border_value,
bool use_fp16)
72 configure(
CLKernelLibrary::get().get_compile_context(),
input,
threshold, min_dist, sensitivity, gradient_size, block_size, corners, border_mode, constant_border_value, use_fp16);
76 float sensitivity, int32_t gradient_size, int32_t block_size,
ICLKeyPointArray *corners,
77 BorderMode border_mode, uint8_t constant_border_value,
bool use_fp16)
101 _memory_group.
manage(&_gx);
102 _memory_group.
manage(&_gy);
105 switch(gradient_size)
109 auto k = arm_compute::support::cpp14::make_unique<CLSobel3x3>();
110 k->configure(compile_context,
input, &_gx, &_gy, border_mode, constant_border_value);
111 _sobel = std::move(k);
116 auto k = arm_compute::support::cpp14::make_unique<CLSobel5x5>();
117 k->configure(compile_context,
input, &_gx, &_gy, border_mode, constant_border_value);
118 _sobel = std::move(k);
123 auto k = arm_compute::support::cpp14::make_unique<CLSobel7x7>();
124 k->configure(compile_context,
input, &_gx, &_gy, border_mode, constant_border_value);
125 _sobel = std::move(k);
133 const float norm_factor = 1.0f / (255.0f * pow(4.0f, gradient_size / 2) * block_size);
134 const float pow4_normalization_factor = pow(norm_factor, 4);
137 _memory_group.
manage(&_score);
140 _harris_score->configure(compile_context, &_gx, &_gy, &_score, block_size, pow4_normalization_factor,
threshold, sensitivity, border_mode ==
BorderMode::UNDEFINED);
143 _border_gx->configure(compile_context, &_gx, _harris_score->border_size(), border_mode,
PixelValue(constant_border_value));
144 _border_gy->configure(compile_context, &_gy, _harris_score->border_size(), border_mode,
PixelValue(constant_border_value));
151 _memory_group.
manage(&_nonmax);
154 _non_max_suppr.
configure(compile_context, &_score, &_nonmax, border_mode);
160 _candidates.
configure(&_nonmax, _corners_list.data(), &_num_corner_candidates);
166 _sort_euclidean.
configure(_corners_list.data(), _corners, &_num_corner_candidates, min_dist);
176 _num_corner_candidates = 0;
189 _non_max_suppr.
run();
BorderMode
Methods available to handle borders.
Class describing the value of a pixel for any image format.
~CLHarrisCorners()
Default destructor.
#define ARM_COMPUTE_ERROR_ON_TENSOR_NOT_2D(t)
static CLScheduler & get()
Access the scheduler singleton.
#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
void map(cl::CommandQueue &q, bool blocking=true)
Enqueue a map operation of the allocated buffer on the given queue.
#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.
void init(const TensorInfo &input, size_t alignment=0)
Initialize a tensor based on the passed TensorInfo.
Copyright (c) 2017-2020 Arm Limited.
void map(bool blocking=true)
Enqueue a map operation of the allocated buffer.
1 channel, 1 S32 per channel
void manage(IMemoryManageable *obj) override
Sets a object to be managed by the given memory group.
Interface to enqueue OpenCL kernels and get/set the OpenCL CommandQueue and ICLTuner.
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.
Interface for OpenCL Array.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
void run() override final
Run the kernels contained in the function.
void configure(ICLTensor *input, ICLTensor *output, BorderMode border_mode)
Initialise the function's source, destinations and border mode.
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
_Unique_if< T >::_Single_object make_unique(Args &&... args)
Construct a single object and return a unique pointer to it.
Interface for the harris score kernel.
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 unmap(cl::CommandQueue &q)
Enqueue an unmap operation of the allocated and mapped buffer on the given queue.
void allocate() override
Allocate size specified by TensorInfo of OpenCL memory.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
Interface for filling the border of a kernel.
Memory group resources scope handling class.
Interface for OpenCL tensor.
virtual void schedule(ICPPKernel *kernel, const Hints &hints)=0
Runs the kernel in the same thread as the caller synchronously.
Borders are left undefined.
void run() override
Run the kernels contained in the function.
Wrapper to configure the Khronos OpenCL C++ header.
Store the tensor's metadata.
void configure(ICLImage *input, float threshold, float min_dist, float sensitivity, int32_t gradient_size, int32_t block_size, ICLKeyPointArray *corners, BorderMode border_mode, uint8_t constant_border_value=0, bool use_fp16=false)
Initialize the function's source, destination, conv and border_mode.
DataType
Available data types.
void unmap()
Enqueue an unmap operation of the allocated and mapped buffer.
SimpleTensor< T > threshold(const SimpleTensor< T > &src, T threshold, T false_value, T true_value, ThresholdType type, T upper)
CLHarrisCorners(std::shared_ptr< IMemoryManager > memory_manager=nullptr)
Constructor.
void configure(const IImage *input, InternalKeypoint *output, int32_t *num_corner_candidates)
Setup the kernel parameters.
static IScheduler & get()
Access the scheduler singleton.