58 float strength_thresh,
59 float pow4_normalization_factor)
66 float4 gx2 = (float4)0.0f;
67 float4 gy2 = (float4)0.0f;
68 float4 gxgy = (float4)0.0f;
76 float4 l_gx = convert_float4(temp_gx.s0123);
77 float4 m_gx = convert_float4(temp_gx.s1234);
78 float4 r_gx = convert_float4(temp_gx.s2345);
80 float4 l_gy = convert_float4(temp_gy.s0123);
81 float4 m_gy = convert_float4(temp_gy.s1234);
82 float4 r_gy = convert_float4(temp_gy.s2345);
84 gx2 += (l_gx * l_gx) + (m_gx * m_gx) + (r_gx * r_gx);
85 gy2 += (l_gy * l_gy) + (m_gy * m_gy) + (r_gy * r_gy);
86 gxgy += (l_gx * l_gy) + (m_gx * m_gy) + (r_gx * r_gy);
92 l_gx = convert_float4(temp_gx.s0123);
93 m_gx = convert_float4(temp_gx.s1234);
94 r_gx = convert_float4(temp_gx.s2345);
96 l_gy = convert_float4(temp_gy.s0123);
97 m_gy = convert_float4(temp_gy.s1234);
98 r_gy = convert_float4(temp_gy.s2345);
100 gx2 += (l_gx * l_gx) + (m_gx * m_gx) + (r_gx * r_gx);
101 gy2 += (l_gy * l_gy) + (m_gy * m_gy) + (r_gy * r_gy);
102 gxgy += (l_gx * l_gy) + (m_gx * m_gy) + (r_gx * r_gy);
108 l_gx = convert_float4(temp_gx.s0123);
109 m_gx = convert_float4(temp_gx.s1234);
110 r_gx = convert_float4(temp_gx.s2345);
112 l_gy = convert_float4(temp_gy.s0123);
113 m_gy = convert_float4(temp_gy.s1234);
114 r_gy = convert_float4(temp_gy.s2345);
116 gx2 += (l_gx * l_gx) + (m_gx * m_gx) + (r_gx * r_gx);
117 gy2 += (l_gy * l_gy) + (m_gy * m_gy) + (r_gy * r_gy);
118 gxgy += (l_gx * l_gy) + (m_gx * m_gy) + (r_gx * r_gy);
121 float4 trace = gx2 + gy2;
122 float4 det = gx2 * gy2 - (gxgy * gxgy);
125 float4 mc = (det - (sensitivity * (trace * trace))) * pow4_normalization_factor;
127 mc = select(0.0f, mc, mc > (float4)strength_thresh);
129 vstore4(mc, 0, (__global
float *)vc.
ptr);
150 float4 gx = convert_float4(temp_gx.s0123);
151 float4 gy = convert_float4(temp_gy.s0123);
156 gx = convert_float4(temp_gx.s1234);
157 gy = convert_float4(temp_gy.s1234);
162 gx = convert_float4(temp_gx.s2345);
163 gy = convert_float4(temp_gy.s2345);
168 gx = convert_float4(temp_gx.s3456);
169 gy = convert_float4(temp_gy.s3456);
174 gx = convert_float4(temp_gx.s4567);
175 gy = convert_float4(temp_gy.s4567);
180 return (float16)(gx2, gy2, gxgy, (float4)0);
215 float strength_thresh,
216 float pow4_normalization_factor)
223 float16 res = (float16)0.0f;
226 for(
int i = -2; i < 3; i++)
231 float4 gx2 = res.s0123;
232 float4 gy2 = res.s4567;
233 float4 gxgy = res.s89AB;
236 float4 trace = gx2 + gy2;
237 float4 det = gx2 * gy2 - (gxgy * gxgy);
240 float4 mc = (det - (sensitivity * (trace * trace))) * pow4_normalization_factor;
242 mc = select(0.0f, mc, mc > (float4)strength_thresh);
244 vstore4(mc, 0, (__global
float *)vc.
ptr);
269 float4 gx = convert_float4(temp_gx0.s0123);
270 float4 gy = convert_float4(temp_gy0.s0123);
275 gx = convert_float4(temp_gx0.s1234);
276 gy = convert_float4(temp_gy0.s1234);
281 gx = convert_float4(temp_gx0.s2345);
282 gy = convert_float4(temp_gy0.s2345);
287 gx = convert_float4(temp_gx0.s3456);
288 gy = convert_float4(temp_gy0.s3456);
293 gx = convert_float4(temp_gx0.s4567);
294 gy = convert_float4(temp_gy0.s4567);
311 return (float16)(gx2, gy2, gxgy, (float4)0);
346 float strength_thresh,
347 float pow4_normalization_factor)
354 float16 res = (float16)0.0f;
357 for(
int i = -3; i < 4; i++)
362 float4 gx2 = res.s0123;
363 float4 gy2 = res.s4567;
364 float4 gxgy = res.s89AB;
367 float4 trace = gx2 + gy2;
368 float4 det = gx2 * gy2 - (gxgy * gxgy);
371 float4 mc = (det - (sensitivity * (trace * trace))) * pow4_normalization_factor;
373 mc = select(0.0f, mc, mc > (float4)strength_thresh);
375 vstore4(mc, 0, (__global
float *)vc.
ptr);
__kernel void harris_score_7x7(__global uchar *src_gx_ptr, uint src_gx_stride_x, uint src_gx_step_x, uint src_gx_stride_y, uint src_gx_step_y, uint src_gx_offset_first_element_in_bytes, __global uchar *src_gy_ptr, uint src_gy_stride_x, uint src_gy_step_x, uint src_gy_stride_y, uint src_gy_step_y, uint src_gy_offset_first_element_in_bytes, __global uchar *vc_ptr, uint vc_stride_x, uint vc_step_x, uint vc_stride_y, uint vc_step_y, uint vc_offset_first_element_in_bytes, float sensitivity, float strength_thresh, float pow4_normalization_factor)
Function running harris score on 7x7 block size.
#define IMAGE_DECLARATION(name)
float16 harris_score_1x5(Image *src_gx, Image *src_gy, int row)
Function for calculating harris score 1x5.
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
#define CONVERT_TO_IMAGE_STRUCT(name)
#define VEC_DATA_TYPE(type, size)
__kernel void harris_score_3x3(__global uchar *src_gx_ptr, uint src_gx_stride_x, uint src_gx_step_x, uint src_gx_stride_y, uint src_gx_step_y, uint src_gx_offset_first_element_in_bytes, __global uchar *src_gy_ptr, uint src_gy_stride_x, uint src_gy_step_x, uint src_gy_stride_y, uint src_gy_step_y, uint src_gy_offset_first_element_in_bytes, __global uchar *vc_ptr, uint vc_stride_x, uint vc_step_x, uint vc_stride_y, uint vc_step_y, uint vc_offset_first_element_in_bytes, float sensitivity, float strength_thresh, float pow4_normalization_factor)
Function running harris score on 3x3 block size.
Structure to hold Image information.
__global uchar * ptr
Pointer to the starting postion of the buffer.
__kernel void harris_score_5x5(__global uchar *src_gx_ptr, uint src_gx_stride_x, uint src_gx_step_x, uint src_gx_stride_y, uint src_gx_step_y, uint src_gx_offset_first_element_in_bytes, __global uchar *src_gy_ptr, uint src_gy_stride_x, uint src_gy_step_x, uint src_gy_stride_y, uint src_gy_step_y, uint src_gy_offset_first_element_in_bytes, __global uchar *vc_ptr, uint vc_stride_x, uint vc_step_x, uint vc_stride_y, uint vc_step_y, uint vc_offset_first_element_in_bytes, float sensitivity, float strength_thresh, float pow4_normalization_factor)
Function running harris score on 5x5 block size.
float16 harris_score_1x7(Image *src_gx, Image *src_gy, int row)
Function for calculating harris score 1x7.