Compute Library  18.05
CLCannyEdge.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 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_CLCANNYEDGE_H__
25 #define __ARM_COMPUTE_CLCANNYEDGE_H__
26 
28 
34 
35 #include <memory>
36 
37 namespace arm_compute
38 {
39 class ICLTensor;
40 
50 class CLCannyEdge : public IFunction
51 {
52 public:
54  CLCannyEdge(std::shared_ptr<IMemoryManager> memory_manager = nullptr);
66  void configure(ICLTensor *input, ICLTensor *output, int32_t upper_thr, int32_t lower_thr, int32_t gradient_size, int32_t norm_type,
67  BorderMode border_mode, uint8_t constant_border_value = 0);
68 
69  // Inherited methods overridden:
70  virtual void run() override;
71 
72 private:
73  CLMemoryGroup _memory_group;
74  std::unique_ptr<IFunction> _sobel;
75  CLGradientKernel _gradient;
76  CLFillBorderKernel _border_mag_gradient;
77  CLEdgeNonMaxSuppressionKernel _non_max_suppr;
78  CLEdgeTraceKernel _edge_trace;
79  CLImage _gx;
80  CLImage _gy;
81  CLImage _mag;
82  CLImage _phase;
83  CLImage _nonmax;
84  CLImage _visited, _recorded, _l1_list_counter, _l1_stack;
85 };
86 }
87 
88 #endif /* __ARM_COMPUTE_CLCANNYEDGE_H__ */
BorderMode
Methods available to handle borders.
Definition: Types.h:283
Base class for all functions.
Definition: IFunction.h:30
OpenCL kernel to perform Gradient computation.
Basic function to execute canny edge on OpenCL.
Definition: CLCannyEdge.h:50
This file contains all available output stages for GEMMLowp on OpenCL.
virtual void run() override
Run the kernels contained in the function.
CLCannyEdge(std::shared_ptr< IMemoryManager > memory_manager=nullptr)
Constructor.
void configure(ICLTensor *input, ICLTensor *output, int32_t upper_thr, int32_t lower_thr, int32_t gradient_size, int32_t norm_type, BorderMode border_mode, uint8_t constant_border_value=0)
Initialise the function&#39;s source, destination, thresholds, gradient size, normalization type and bord...
Interface for filling the border of a kernel.
Interface for OpenCL tensor.
Definition: ICLTensor.h:40
OpenCL kernel to perform Edge tracing.
OpenCL kernel to perform Non-Maxima suppression for Canny Edge.
Basic implementation of the OpenCL tensor interface.
Definition: CLTensor.h:39