Compute Library
 21.02
NEGaussianPyramid.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016-2021 Arm Limited.
3  *
4  * SPDX-License-Identifier: MIT
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to
8  * deal in the Software without restriction, including without limitation the
9  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10  * sell copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #ifndef ARM_COMPUTE_NEGAUSSIANPYRAMID_H
25 #define ARM_COMPUTE_NEGAUSSIANPYRAMID_H
26 
28 #include "arm_compute/core/Types.h"
34 
35 #include <cstdint>
36 #include <memory>
37 
38 namespace arm_compute
39 {
40 class ITensor;
41 class NEGaussianPyramidHorKernel;
42 class NEGaussianPyramidVertKernel;
43 class NEFillBorderKernel;
44 
45 /** Common interface for all Gaussian pyramid functions
46  *
47  * @deprecated This function is deprecated and is intended to be removed in 21.05 release
48  *
49  */
51 {
52 public:
53  /** Default constructor */
55  /** Prevent instances of this class from being copied (As this class contains pointers) */
56  NEGaussianPyramid(const NEGaussianPyramid &) = delete;
57  /** Prevent instances of this class from being copied (As this class contains pointers) */
59  /** Allow instances of this class to be moved */
61  /** Allow instances of this class to be moved */
63  /** Default destructor */
64  virtual ~NEGaussianPyramid() = default;
65 
66  /** Initialise the function's source, destinations and border mode.
67  *
68  * @param[in] input Source tensor. Data type supported: U8.
69  * @param[out] pyramid Destination pyramid tensors, Data type supported at each level: U8.
70  * @param[in] border_mode Border mode to use.
71  * @param[in] constant_border_value (Optional) Constant value to use for borders if border_mode is set to CONSTANT.
72  *
73  */
74  virtual void configure(const ITensor *input, IPyramid *pyramid, BorderMode border_mode, uint8_t constant_border_value) = 0;
75 
76 protected:
77  const ITensor *_input;
78  IPyramid *_pyramid;
79  Pyramid _tmp;
80 };
81 
82 /** Basic function to execute gaussian pyramid with HALF scale factor. This function calls the following Neon kernels:
83  *
84  * -# @ref NEFillBorderKernel (executed if border_mode == CONSTANT or border_mode == REPLICATE)
85  * -# @ref NEGaussianPyramidHorKernel
86  * -# @ref NEGaussianPyramidVertKernel
87  *
88  * @deprecated This function is deprecated and is intended to be removed in 21.05 release
89  *
90  *
91  */
93 {
94 public:
95  /** Constructor */
97  /** Prevent instances of this class from being copied (As this class contains pointers) */
99  /** Prevent instances of this class from being copied (As this class contains pointers) */
101  /** Allow instances of this class to be moved */
103  /** Allow instances of this class to be moved */
105  /** Default destructor */
107 
108  // Inherited methods overridden:
109  void configure(const ITensor *input, IPyramid *pyramid, BorderMode border_mode, uint8_t constant_border_value) override;
110  void run() override;
111 
112 private:
113  std::vector<std::unique_ptr<NEFillBorderKernel>> _horizontal_border_handler;
114  std::vector<std::unique_ptr<NEFillBorderKernel>> _vertical_border_handler;
115  std::vector<std::unique_ptr<NEGaussianPyramidHorKernel>> _horizontal_reduction;
116  std::vector<std::unique_ptr<NEGaussianPyramidVertKernel>> _vertical_reduction;
117 };
118 
119 /** Basic function to execute gaussian pyramid with ORB scale factor. This function calls the following Neon kernels and functions:
120  *
121  * -# @ref NEFillBorderKernel (executed if border_mode == CONSTANT or border_mode == REPLICATE)
122  * -# @ref NEGaussian5x5
123  * -# @ref NEScaleKernel
124  *
125  * @deprecated This function is deprecated and is intended to be removed in 21.05 release
126  *
127  *
128  */
130 {
131 public:
132  /** Constructor */
134  /** Prevent instances of this class from being copied (As this class contains pointers) */
135  NEGaussianPyramidOrb(const NEGaussianPyramidOrb &) = delete;
136  /** Prevent instances of this class from being copied (As this class contains pointers) */
138  /** Allow instances of this class to be moved */
140  /** Allow instances of this class to be moved */
142  /** Default destructor */
144 
145  // Inherited methods overridden:
146  void configure(const ITensor *input, IPyramid *pyramid, BorderMode border_mode, uint8_t constant_border_value) override;
147  void run() override;
148 
149 private:
150  std::vector<NEGaussian5x5> _gaus5x5;
151  std::vector<NEScale> _scale_nearest;
152 };
153 } // namespace arm_compute
154 #endif /*ARM_COMPUTE_NEGAUSSIANPYRAMID_H */
BorderMode
Methods available to handle borders.
Definition: Types.h:265
Base class for all functions.
Definition: IFunction.h:30
Basic function to execute gaussian pyramid with ORB scale factor.
virtual void configure(const ITensor *input, IPyramid *pyramid, BorderMode border_mode, uint8_t constant_border_value)=0
Initialise the function&#39;s source, destinations and border mode.
virtual ~NEGaussianPyramid()=default
Default destructor.
Interface for Neon tensor.
Definition: ITensor.h:36
Copyright (c) 2017-2021 Arm Limited.
Basic implementation of the pyramid interface.
Definition: Pyramid.h:40
Interface for pyramid data-object.
Definition: IPyramid.h:36
Basic function to execute gaussian pyramid with HALF scale factor.
Common interface for all Gaussian pyramid functions.
NEGaussianPyramid()
Default constructor.
NEGaussianPyramid & operator=(const NEGaussianPyramid &)=delete
Prevent instances of this class from being copied (As this class contains pointers) ...
virtual void run()=0
Run the kernels contained in the function.