@@ -47,32 +47,28 @@ class CLGradientKernel : public ICLKernel
47
47
*
48
48
* @note gx, gy and mag must all be the same size (either 16 or 32).
49
49
*
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.
57
55
*/
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);
59
57
60
58
// Inherited methods overridden:
61
59
void run (const Window &window, cl::CommandQueue &queue) override ;
62
- BorderSize border_size () const override ;
63
60
64
61
private:
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 */
70
66
};
71
67
72
68
/* * OpenCL kernel to perform Non-Maxima suppression for Canny Edge.
73
69
*
74
70
* @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.
76
72
*
77
73
* @note Hysteresis is computed in @ref CLEdgeTraceKernel
78
74
*/
@@ -87,24 +83,22 @@ class CLEdgeNonMaxSuppressionKernel : public ICLKernel
87
83
CLEdgeNonMaxSuppressionKernel &operator =(const CLEdgeNonMaxSuppressionKernel &) = delete ;
88
84
/* * Initialise the kernel's sources, destination and border mode.
89
85
*
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.
96
91
*/
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);
98
93
99
94
// Inherited methods overridden:
100
95
void run (const Window &window, cl::CommandQueue &queue) override ;
101
96
BorderSize border_size () const override ;
102
97
103
98
private:
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. */
108
102
};
109
103
110
104
/* * OpenCL kernel to perform Edge tracing.
@@ -120,28 +114,24 @@ class CLEdgeTraceKernel : public ICLKernel
120
114
CLEdgeTraceKernel &operator =(const CLEdgeTraceKernel &) = delete ;
121
115
/* * Initialise the kernel's source, destination and border mode.
122
116
*
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.
137
129
*/
138
130
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);
141
132
142
133
// Inherited methods overridden:
143
134
void run (const Window &window, cl::CommandQueue &queue) override ;
144
- BorderSize border_size () const override ;
145
135
146
136
private:
147
137
const ICLTensor *_input; /* *< Source tensor. */
@@ -152,7 +142,6 @@ class CLEdgeTraceKernel : public ICLKernel
152
142
ICLTensor *_recorded; /* *< Marks recorded elements */
153
143
ICLTensor *_l1_stack; /* *< L1 hysteris stack */
154
144
ICLTensor *_l1_stack_counter; /* *< L1 hysteris stack counter */
155
- unsigned int _pixels_to_skip; /* *< Pixels to skip */
156
145
};
157
146
}
158
147
#endif /* __ARM_COMPUTE_CLCANNYEDGEKERNEL_H__ */
0 commit comments