45 : _input(nullptr), _pyramid(nullptr), _tmp()
52 : _horizontal_border_handler(),
53 _vertical_border_handler(),
54 _horizontal_reduction(),
69 const uint16_t pixel_value_u16 =
static_cast<uint16_t
>(constant_border_value) * 2 + static_cast<uint16_t>(constant_border_value) * 8 +
static_cast<uint16_t
>(constant_border_value) * 6;
73 const size_t num_stages = num_levels - 1;
85 _tmp.init(pyramid_info);
87 _horizontal_reduction.clear();
88 _vertical_reduction.clear();
89 _horizontal_border_handler.clear();
90 _vertical_border_handler.clear();
92 _horizontal_reduction.resize(num_stages);
93 _vertical_reduction.resize(num_stages);
94 _horizontal_border_handler.resize(num_stages);
95 _vertical_border_handler.resize(num_stages);
97 for(
size_t i = 0; i < num_stages; ++i)
100 _horizontal_reduction[i] = std::make_unique<NEGaussianPyramidHorKernel>();
101 _horizontal_reduction[i]->configure(_pyramid->get_pyramid_level(i), _tmp.get_pyramid_level(i));
104 _vertical_reduction[i] = std::make_unique<NEGaussianPyramidVertKernel>();
105 _vertical_reduction[i]->configure(_tmp.get_pyramid_level(i), _pyramid->get_pyramid_level(i + 1));
108 _horizontal_border_handler[i] = std::make_unique<NEFillBorderKernel>();
109 _horizontal_border_handler[i]->configure(_pyramid->get_pyramid_level(i), _horizontal_reduction[i]->border_size(), border_mode,
PixelValue(constant_border_value));
112 _vertical_border_handler[i] = std::make_unique<NEFillBorderKernel>();
113 _vertical_border_handler[i]->configure(_tmp.get_pyramid_level(i), _vertical_reduction[i]->border_size(), border_mode,
PixelValue(pixel_value_u16));
125 const unsigned int num_levels = _pyramid->info()->num_levels();
128 _pyramid->get_pyramid_level(0)->copy_from(*_input);
130 for(
unsigned int i = 0; i < num_levels - 1; ++i)
158 const size_t num_stages = num_levels - 1;
164 _scale_nearest.clear();
166 _gaus5x5.resize(num_stages);
167 _scale_nearest.resize(num_stages);
172 _tmp.
init(pyramid_info);
174 for(
size_t i = 0; i < num_levels - 1; ++i)
177 _gaus5x5[i].configure(_pyramid->get_pyramid_level(i), _tmp.get_pyramid_level(i), border_mode, constant_border_value);
192 const size_t num_levels = _pyramid->info()->num_levels();
195 _pyramid->get_pyramid_level(0)->copy_from(*_input);
197 for(
unsigned int i = 0; i < num_levels - 1; ++i)
200 _scale_nearest[i].run();
BorderMode
Methods available to handle borders.
constexpr float SCALE_PYRAMID_ORB
Constant value used to indicate a ORB scaled pyramid.
void run() override
Run the kernels contained in the function.
constexpr float SCALE_PYRAMID_HALF
Constant value used to indicate a half-scale pyramid.
virtual size_t num_dimensions() const =0
The number of dimensions of the tensor (rank)
const TensorShape & tensor_shape() const
Return the TensorShape of the o-th level tensor.
Class describing the value of a pixel for any image format.
virtual const PyramidInfo * info() const =0
Interface to be implemented by the child class to return the Pyramid's metadata.
~NEGaussianPyramidOrb()
Default destructor.
void configure(const ITensor *input, IPyramid *pyramid, BorderMode border_mode, uint8_t constant_border_value) override
Initialise the function's source, destinations and border mode.
virtual size_t dimension(size_t index) const =0
Return the size of the requested dimension.
1 channel, 1 U8 per channel
void init(size_t num_levels, float scale, size_t width, size_t height, Format format)
Initialize pyramid's metadata for 2D tensors.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Output values are defined to match the source pixel whose center is nearest to the sample position...
Interface for Neon tensor.
Copyright (c) 2017-2021 Arm Limited.
Samples are taken at pixel center.
NEGaussianPyramidOrb()
Constructor.
Interface for pyramid data-object.
virtual ITensor * get_pyramid_level(size_t index) const =0
Retrieves a level of the pyramid as a ITensor pointer.
~NEGaussianPyramidHalf()
Default destructor.
void run() override
Run the kernels contained in the function.
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
float scale() const
Return the scale factor of the pyramid.
void configure(const ITensor *input, IPyramid *pyramid, BorderMode border_mode, uint8_t constant_border_value) override
Initialise the function's source, destinations and border mode.
1 channel, 1 S16 per channel
NEGaussianPyramid()
Default constructor.
#define ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
NEGaussianPyramidHalf()
Constructor.
Store the Pyramid's metadata.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
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.
size_t width() const
Return the width of the 0th level tensor.
size_t num_levels() const
Return the number of the pyramid levels.
size_t height() const
Return the height of the 0th level tensor.
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.
static IScheduler & get()
Access the scheduler singleton.