@@ -47,32 +47,28 @@ class CLGradientKernel : public ICLKernel
4747 *
4848 * @note gx, gy and mag must all be the same size (either 16 or 32).
4949 *
50- * @param[in] gx Source tensor - Gx component. Data types supported: S16/S32.
51- * @param[in] gy Source tensor - Gy component. Data types supported: Same as gx.
52- * @param[out] magnitude Destination tensor - Magnitude. Data types supported: U16/U32. Must match the pixel size of gx, gy.
53- * @param[out] phase Destination tensor - Quantized phase. Data types supported: U8.
54- * @param[in] norm_type Normalization type. if 1, L1-Norm otherwise L2-Norm.
55- * @param[in] num_pixel_to_skip_prev Number of pixels to skip of previous stage if border_mode = UNDEFINED
56- * @param[in] border_undefined True if the border mode is undefined. False if it's replicate or constant.
50+ * @param[in] gx Source tensor - Gx component. Data types supported: S16/S32.
51+ * @param[in] gy Source tensor - Gy component. Data types supported: Same as gx.
52+ * @param[out] magnitude Destination tensor - Magnitude. Data types supported: U16/U32. Must match the pixel size of gx, gy.
53+ * @param[out] phase Destination tensor - Quantized phase. Data types supported: U8.
54+ * @param[in] norm_type Normalization type. if 1, L1-Norm otherwise L2-Norm.
5755 */
58- void configure (const ICLTensor *gx, const ICLTensor *gy, ICLTensor *magnitude, ICLTensor *phase, int32_t norm_type, int32_t num_pixel_to_skip_prev, bool border_undefined );
56+ void configure (const ICLTensor *gx, const ICLTensor *gy, ICLTensor *magnitude, ICLTensor *phase, int32_t norm_type);
5957
6058 // Inherited methods overridden:
6159 void run (const Window &window, cl::CommandQueue &queue) override ;
62- BorderSize border_size () const override ;
6360
6461private:
65- const ICLTensor *_gx; /* *< Source tensor - Gx component */
66- const ICLTensor *_gy; /* *< Source tensor - Gy component */
67- ICLTensor *_magnitude; /* *< Destination tensor - Magnitude */
68- ICLTensor *_phase; /* *< Destination tensor - Quantized phase */
69- unsigned int _pixels_to_skip; /* *< Pixels to skip around the border. */
62+ const ICLTensor *_gx; /* *< Source tensor - Gx component */
63+ const ICLTensor *_gy; /* *< Source tensor - Gy component */
64+ ICLTensor *_magnitude; /* *< Destination tensor - Magnitude */
65+ ICLTensor *_phase; /* *< Destination tensor - Quantized phase */
7066};
7167
7268/* * OpenCL kernel to perform Non-Maxima suppression for Canny Edge.
7369 *
7470 * @note This kernel is meant to be used alongside CannyEdge and performs a non-maxima suppression using magnitude and phase of input
75- * to characterize points as possible edges.
71+ * to characterize points as possible edges. The output buffer needs to be cleared before this kernel is executed.
7672 *
7773 * @note Hysteresis is computed in @ref CLEdgeTraceKernel
7874 */
@@ -87,24 +83,22 @@ class CLEdgeNonMaxSuppressionKernel : public ICLKernel
8783 CLEdgeNonMaxSuppressionKernel &operator =(const CLEdgeNonMaxSuppressionKernel &) = delete ;
8884 /* * Initialise the kernel's sources, destination and border mode.
8985 *
90- * @param[in] magnitude Source tensor - Magnitude. Data types supported: U16/U32.
91- * @param[in] phase Source tensor - Quantized phase. Data types supported: U8.
92- * @param[out] output Destination tensor
93- * @param[in] lower_thr Lower threshold.
94- * @param[in] num_pixel_to_skip_prev Number of pixels to skip of previous stage if border_mode = UNDEFINED
95- * @param[in] border_undefined True if the border mode is undefined. False if it's replicate or constant.
86+ * @param[in] magnitude Source tensor - Magnitude. Data types supported: U16/U32.
87+ * @param[in] phase Source tensor - Quantized phase. Data types supported: U8.
88+ * @param[out] output Destination tensor. Data types supported: U16/U32.
89+ * @param[in] lower_thr Lower threshold.
90+ * @param[in] border_undefined True if the border mode is undefined. False if it's replicate or constant.
9691 */
97- void configure (const ICLTensor *magnitude, const ICLTensor *phase, ICLTensor *output, int32_t lower_thr, int32_t num_pixel_to_skip_prev, bool border_undefined);
92+ void configure (const ICLTensor *magnitude, const ICLTensor *phase, ICLTensor *output, int32_t lower_thr, bool border_undefined);
9893
9994 // Inherited methods overridden:
10095 void run (const Window &window, cl::CommandQueue &queue) override ;
10196 BorderSize border_size () const override ;
10297
10398private:
104- const ICLTensor *_magnitude; /* *< Source tensor - Magnitude. */
105- const ICLTensor *_phase; /* *< Source tensor - Quantized phase. */
106- ICLTensor *_output; /* *< Destination tensor. */
107- unsigned int _pixels_to_skip; /* *< Pixels to skip around the border. */
99+ const ICLTensor *_magnitude; /* *< Source tensor - Magnitude. */
100+ const ICLTensor *_phase; /* *< Source tensor - Quantized phase. */
101+ ICLTensor *_output; /* *< Destination tensor. */
108102};
109103
110104/* * OpenCL kernel to perform Edge tracing.
@@ -120,28 +114,24 @@ class CLEdgeTraceKernel : public ICLKernel
120114 CLEdgeTraceKernel &operator =(const CLEdgeTraceKernel &) = delete ;
121115 /* * Initialise the kernel's source, destination and border mode.
122116 *
123- * @param[in] input Source tensor. Data types supported: U8.
124- * @param[out] output Destination tensor. Data types supported: U8.
125- * @param[in] upper_thr Upper threshold used for the hysteresis
126- * @param[in] lower_thr Lower threshold used for the hysteresis
127- * @param[in,out] visited Tensor for keeping the visited pixels. Data types supported: U32.
128- * Expected to be initialized to 0 before each run.
129- * @param[in,out] recorded Tensor for keeping the recorded pixels. Data types supported: U32
130- * Expected to be initialized to 0 before each run.
131- * @param[in,out] l1_stack Tensor with the L1 stack for each pixel. Data types supported: S32.
132- * Expected to be initialized to 0 before each run.
133- * @param[in,out] l1_stack_counter Tensor for counting the elements in the L1 stack of each pixel. Data types supported: U8.
134- * Expected to be initialized to 0 before each run.
135- * @param[in] num_pixel_to_skip_prev Number of pixels to skip of previous stage if border_mode = UNDEFINED.
136- public: * @param[in] border_undefined True if the border mode is undefined. False if it's replicate or constant.
117+ * @param[in] input Source tensor. Data types supported: U8.
118+ * @param[out] output Destination tensor. Data types supported: U8.
119+ * @param[in] upper_thr Upper threshold used for the hysteresis
120+ * @param[in] lower_thr Lower threshold used for the hysteresis
121+ * @param[in,out] visited Tensor for keeping the visited pixels. Data types supported: U32.
122+ * Expected to be initialized to 0 before each run.
123+ * @param[in,out] recorded Tensor for keeping the recorded pixels. Data types supported: U32
124+ * Expected to be initialized to 0 before each run.
125+ * @param[in,out] l1_stack Tensor with the L1 stack for each pixel. Data types supported: S32.
126+ * Expected to be initialized to 0 before each run.
127+ * @param[in,out] l1_stack_counter Tensor for counting the elements in the L1 stack of each pixel. Data types supported: U8.
128+ * Expected to be initialized to 0 before each run.
137129 */
138130 void configure (const ICLTensor *input, ICLTensor *output, int32_t upper_thr, int32_t lower_thr,
139- ICLTensor *visited, ICLTensor *recorded, ICLTensor *l1_stack, ICLTensor *l1_stack_counter,
140- int32_t num_pixel_to_skip_prev, bool border_undefined);
131+ ICLTensor *visited, ICLTensor *recorded, ICLTensor *l1_stack, ICLTensor *l1_stack_counter);
141132
142133 // Inherited methods overridden:
143134 void run (const Window &window, cl::CommandQueue &queue) override ;
144- BorderSize border_size () const override ;
145135
146136private:
147137 const ICLTensor *_input; /* *< Source tensor. */
@@ -152,7 +142,6 @@ class CLEdgeTraceKernel : public ICLKernel
152142 ICLTensor *_recorded; /* *< Marks recorded elements */
153143 ICLTensor *_l1_stack; /* *< L1 hysteris stack */
154144 ICLTensor *_l1_stack_counter; /* *< L1 hysteris stack counter */
155- unsigned int _pixels_to_skip; /* *< Pixels to skip */
156145};
157146}
158147#endif /* __ARM_COMPUTE_CLCANNYEDGEKERNEL_H__ */
0 commit comments