37 internal_init(info,
false);
42 internal_init(info,
true);
58 const std::array<float, 4> c_orbscale = { 0.5f,
61 SCALE_PYRAMID_ORB *SCALE_PYRAMID_ORB * SCALE_PYRAMID_ORB
73 _pyramid[i].allocator()->init(tensor_info);
77 float orb_scale = c_orbscale[(i + 1) % 4];
78 w =
static_cast<int>(std::ceil(static_cast<float>(ref_w) * orb_scale));
79 h =
static_cast<int>(std::ceil(static_cast<float>(ref_h) * orb_scale));
81 if(0 == ((i + 1) % 4))
89 w = (w + 1) * _info.
scale();
90 h = (h + 1) * _info.
scale();
94 tensor_shape.
set(0, w);
95 tensor_shape.
set(1, h);
101 for(
size_t i = 0; i < _info.
num_levels(); ++i)
103 _pyramid[i].allocator()->allocate();
116 return &_pyramid[index];
constexpr float SCALE_PYRAMID_ORB
Constant value used to indicate a ORB scaled pyramid.
const TensorShape & tensor_shape() const
Return the TensorShape of the o-th level tensor.
Tensor * get_pyramid_level(size_t index) const override
Retrieves a level of the pyramid as a ITensor pointer.
Format format() const
Return the image format of all tensor in the pyramid.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
bool auto_padding() override
Update the offset to the first element and the strides to automatically computed values.
Copyright (c) 2017-2021 Arm Limited.
void init(const PyramidInfo &info)
Initialize pyramid data-object using the given Pyramid's metadata.
void init_auto_padding(const PyramidInfo &info)
Initialize pyramid data-object using the given Pyramid's metadata.
Basic implementation of the tensor interface.
float scale() const
Return the scale factor of the pyramid.
void allocate()
Allocate the planes in the pyramid.
const PyramidInfo * info() const override
Interface to be implemented by the child class to return the Pyramid's metadata.
Store the Pyramid's metadata.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
Store the tensor's metadata.
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.