21.02
|
Go to the source code of this file.
Macros | |
#define | LOAD_AND_SET_MASK(ptr, a, stride, dark, bright, dark_mask, bright_mask) |
Load a pixel and set the mask values. More... | |
#define | CHECK_CORNER(bright_mask, dark_mask, isCorner) |
Checks if a pixel is a corner. More... | |
Functions | |
uchar | compute_strength (uchar candidate_pixel, __global unsigned char *ptr, unsigned int stride, unsigned char threshold) |
__kernel void | fast_corners (__global uchar *input_ptr, uint input_stride_x, uint input_step_x, uint input_stride_y, uint input_step_y, uint input_offset_first_element_in_bytes, __global uchar *output_ptr, uint output_stride_x, uint output_step_x, uint output_stride_y, uint output_step_y, uint output_offset_first_element_in_bytes, float threshold_value) |
Fast corners implementation. More... | |
__kernel void | copy_to_keypoint (__global uchar *input_ptr, uint input_stride_x, uint input_step_x, uint input_stride_y, uint input_step_y, uint input_offset_first_element_in_bytes, uint max_num_points, uint offset, __global uint *num_of_points, __global Keypoint *out) |
Copy result to Keypoint buffer and count number of corners. More... | |
Variables | |
constant int | offsets_s [16][2] |
#define CHECK_CORNER | ( | bright_mask, | |
dark_mask, | |||
isCorner | |||
) |
Checks if a pixel is a corner.
Pixel is considerred as a corner if the 9 continuous pixels in the Bresenham circle are bright or dark.
[in] | bright_mask | The mask recording postions of bright pixels |
[in] | dark_mask | The mask recording postions of dark pixels |
[out] | isCorner | Indicate whether candidate pixel is corner |
Definition at line 82 of file fast_corners.cl.
Referenced by compute_strength(), and fast_corners().
#define LOAD_AND_SET_MASK | ( | ptr, | |
a, | |||
stride, | |||
dark, | |||
bright, | |||
dark_mask, | |||
bright_mask | |||
) |
Load a pixel and set the mask values.
[in] | ptr | The pointer to the starting address of source image |
[in] | a | Index to indicate the position in the Bresenham circle |
[in] | stride | Stride of source image in x dimension |
[in] | dark | The left end of the threshold range |
[in] | bright | The right end of the threshold range |
[out] | dark_mask | The bit-set mask records dark pixels. Its bit is set as 1 if the corresponding pixel is dark |
[out] | bright_mask | The bit-set mask records bright pixels. Its bit is set as 1 if the corresponding pixel is bright |
Definition at line 68 of file fast_corners.cl.
Referenced by compute_strength(), and fast_corners().
uchar compute_strength | ( | uchar | candidate_pixel, |
__global unsigned char * | ptr, | ||
unsigned int | stride, | ||
unsigned char | threshold | ||
) |
Definition at line 98 of file fast_corners.cl.
References arm_compute::wrapper::add_sat(), arm_compute::test::validation::b, CHECK_CORNER, LOAD_AND_SET_MASK, arm_compute::wrapper::sub_sat(), and arm_compute::test::validation::reference::threshold().
Referenced by fast_corners().
__kernel void copy_to_keypoint | ( | __global uchar * | input_ptr, |
uint | input_stride_x, | ||
uint | input_step_x, | ||
uint | input_stride_y, | ||
uint | input_step_y, | ||
uint | input_offset_first_element_in_bytes, | ||
uint | max_num_points, | ||
uint | offset, | ||
__global uint * | num_of_points, | ||
__global Keypoint * | out | ||
) |
Copy result to Keypoint buffer and count number of corners.
[in] | input_ptr | Pointer to the image with calculated strenghs. Supported data types: U8 |
[in] | input_stride_x | Stride of the first source image in X dimension (in bytes) |
[in] | input_step_x | input_stride_x * number of elements along X processed per workitem(in bytes) |
[in] | input_stride_y | Stride of the first source image in Y dimension (in bytes) |
[in] | input_step_y | input_stride_y * number of elements along Y processed per workitem(in bytes) |
[in] | input_offset_first_element_in_bytes | The offset of the first element in the first source image |
[in] | max_num_points | The maximum number of keypoints the array can hold |
[out] | offset | The number of skipped pixels in x dimension |
[out] | num_of_points | Number of points found |
[out] | out | The keypoints found |
Definition at line 230 of file fast_corners.cl.
References CONVERT_TO_IMAGE_STRUCT, and arm_compute::test::validation::input.
__kernel void fast_corners | ( | __global uchar * | input_ptr, |
uint | input_stride_x, | ||
uint | input_step_x, | ||
uint | input_stride_y, | ||
uint | input_step_y, | ||
uint | input_offset_first_element_in_bytes, | ||
__global uchar * | output_ptr, | ||
uint | output_stride_x, | ||
uint | output_step_x, | ||
uint | output_stride_y, | ||
uint | output_step_y, | ||
uint | output_offset_first_element_in_bytes, | ||
float | threshold_value | ||
) |
Fast corners implementation.
Calculates and returns the strength of each pixel.
The algorithm loops through the 16 pixels in the Bresenham circle and set low 16 bit of masks if corresponding pixel is bright or dark. It then copy the low 16 bit to the high 16 bit of the masks. Right shift the bit to check whether the 9 continuous bits from the LSB are set.
[in] | input_ptr | Pointer to the first source image. Supported data types: U8 |
[in] | input_stride_x | Stride of the first source image in X dimension (in bytes) |
[in] | input_step_x | input_stride_x * number of elements along X processed per workitem(in bytes) |
[in] | input_stride_y | Stride of the first source image in Y dimension (in bytes) |
[in] | input_step_y | input_stride_y * number of elements along Y processed per workitem(in bytes) |
[in] | input_offset_first_element_in_bytes | The offset of the first element in the first source image |
[out] | output_ptr | Pointer to the first source image. Supported data types: U8 |
[in] | output_stride_x | Stride of the first source image in X dimension (in bytes) |
[in] | output_step_x | output_stride_x * number of elements along X processed per workitem(in bytes) |
[in] | output_stride_y | Stride of the first source image in Y dimension (in bytes) |
[in] | output_step_y | output_stride_y * number of elements along Y processed per workitem(in bytes) |
[in] | output_offset_first_element_in_bytes | The offset of the first element in the first source image |
[in] | threshold_value | Threshold value. |
Definition at line 155 of file fast_corners.cl.
References arm_compute::wrapper::add_sat(), CHECK_CORNER, compute_strength(), CONVERT_TO_IMAGE_STRUCT, arm_compute::test::validation::input, input_stride_y, LOAD_AND_SET_MASK, Image::ptr, arm_compute::wrapper::sub_sat(), and arm_compute::test::validation::reference::threshold().
constant int offsets_s[16][2] |
Definition at line 37 of file fast_corners.cl.