Compute Library
18.05
|
Go to the source code of this file.
Data Structures | |
struct | InternalKeypoint |
Macros | |
#define | DETERMINANT_THR 1.0e-07f |
Threshold for the determinant. More... | |
#define | EIGENVALUE_THR 1.0e-04f |
Thresholds for minimum eigenvalue. More... | |
#define | W_BITS (14) |
Constants used for Lucas-Kanade Algorithm. More... | |
#define | FLT_SCALE (1.0f / (float)(1 << 20)) |
#define | D0 ((float)(1 << W_BITS)) |
#define | D1 (1.0f / (float)(1 << (W_BITS - 5))) |
Typedefs | |
typedef struct InternalKeypoint | InternalKeypoint |
Functions | |
__kernel void | init_level (__global float4 *old_points_internal, __global float4 *new_points_internal, const float scale) |
Initializes the internal new points array when the level of pyramid is NOT equal to max. More... | |
__kernel void | init_level_max (__global Keypoint *old_points, __global InternalKeypoint *old_points_internal, __global InternalKeypoint *new_points_internal, const float scale) |
Initializes the internal new points array when the level of pyramid is equal to max. More... | |
__kernel void | init_level_max_initial_estimate (__global Keypoint *old_points, __global Keypoint *new_points_estimates, __global InternalKeypoint *old_points_internal, __global InternalKeypoint *new_points_internal, const float scale) |
Initializes the new_points array when the level of pyramid is equal to max and if use_initial_estimate = 1. More... | |
__kernel void | finalize (__global InternalKeypoint *new_points_internal, __global Keypoint *new_points) |
Truncates the coordinates stored in new_points array. More... | |
void __kernel | lktracker_stage0 (__global uchar *old_image_ptr, uint old_image_stride_x, uint old_image_step_x, uint old_image_stride_y, uint old_image_step_y, uint old_image_offset_first_element_in_bytes, __global uchar *old_scharr_gx_ptr, uint old_scharr_gx_stride_x, uint old_scharr_gx_step_x, uint old_scharr_gx_stride_y, uint old_scharr_gx_step_y, uint old_scharr_gx_offset_first_element_in_bytes, __global uchar *old_scharr_gy_ptr, uint old_scharr_gy_stride_x, uint old_scharr_gy_step_x, uint old_scharr_gy_stride_y, uint old_scharr_gy_step_y, uint old_scharr_gy_offset_first_element_in_bytes, __global float4 *old_points, __global float4 *new_points, __global float4 *coeff, __global short4 *iold_val, const int window_dimension, const int window_dimension_pow2, const int half_window, const float3 border_limits, const float eig_const, const int level0) |
Computes A11, A12, A22, min_eig, ival, ixval and iyval at level 0th of the pyramid. More... | |
void __kernel | lktracker_stage1 (__global uchar *new_image_ptr, uint new_image_stride_x, uint new_image_step_x, uint new_image_stride_y, uint new_image_step_y, uint new_image_offset_first_element_in_bytes, __global float4 *new_points, __global float4 *coeff, __global short4 *iold_val, const int window_dimension, const int window_dimension_pow2, const int half_window, const int num_iterations, const float epsilon, const float3 border_limits, const float eig_const, const int level0, const int term_epsilon) |
Computes the motion vector for a given keypoint. More... | |
#define D0 ((float)(1 << W_BITS)) |
Definition at line 59 of file optical_flow_pyramid_lk.cl.
Referenced by lktracker_stage0(), and lktracker_stage1().
#define D1 (1.0f / (float)(1 << (W_BITS - 5))) |
Definition at line 60 of file optical_flow_pyramid_lk.cl.
Referenced by lktracker_stage0(), and lktracker_stage1().
#define DETERMINANT_THR 1.0e-07f |
Threshold for the determinant.
Used for lost tracking criteria
Definition at line 51 of file optical_flow_pyramid_lk.cl.
Referenced by lktracker_stage1().
#define EIGENVALUE_THR 1.0e-04f |
Thresholds for minimum eigenvalue.
Used for lost tracking criteria
Definition at line 54 of file optical_flow_pyramid_lk.cl.
Referenced by lktracker_stage1().
#define FLT_SCALE (1.0f / (float)(1 << 20)) |
Definition at line 58 of file optical_flow_pyramid_lk.cl.
Referenced by lktracker_stage0(), and lktracker_stage1().
#define W_BITS (14) |
Constants used for Lucas-Kanade Algorithm.
Definition at line 57 of file optical_flow_pyramid_lk.cl.
typedef struct InternalKeypoint InternalKeypoint |
__kernel void finalize | ( | __global InternalKeypoint * | new_points_internal, |
__global Keypoint * | new_points | ||
) |
Truncates the coordinates stored in new_points array.
[in] | new_points_internal | An array of estimate key points that are defined at the new_images high resolution pyramid. |
[out] | new_points | An array of internal key points that are defined at the new_images high resolution pyramid. |
Definition at line 157 of file optical_flow_pyramid_lk.cl.
References Keypoint::error, Keypoint::orientation, arm_compute::round(), Keypoint::scale, Keypoint::strength, Keypoint::tracking_status, InternalKeypoint::tracking_status, Keypoint::x, InternalKeypoint::x, Keypoint::y, and InternalKeypoint::y.
__kernel void init_level | ( | __global float4 * | old_points_internal, |
__global float4 * | new_points_internal, | ||
const float | scale | ||
) |
Initializes the internal new points array when the level of pyramid is NOT equal to max.
[in,out] | old_points_internal | An array of internal key points that are defined at the old_images high resolution pyramid. |
[in,out] | new_points_internal | An array of internal key points that are defined at the new_images high resolution pyramid. |
[in] | scale | Scale factor to apply for the new_point coordinates. |
Definition at line 68 of file optical_flow_pyramid_lk.cl.
__kernel void init_level_max | ( | __global Keypoint * | old_points, |
__global InternalKeypoint * | old_points_internal, | ||
__global InternalKeypoint * | new_points_internal, | ||
const float | scale | ||
) |
Initializes the internal new points array when the level of pyramid is equal to max.
[in] | old_points | An array of key points that are defined at the old_images high resolution pyramid. |
[in,out] | old_points_internal | An array of internal key points that are defined at the old_images high resolution pyramid. |
[out] | new_points_internal | An array of internal key points that are defined at the new_images high resolution pyramid. |
[in] | scale | Scale factor to apply for the new_point coordinates. |
Definition at line 94 of file optical_flow_pyramid_lk.cl.
References arm_compute::test::validation::scale, InternalKeypoint::tracking_status, Keypoint::x, InternalKeypoint::x, Keypoint::y, and InternalKeypoint::y.
__kernel void init_level_max_initial_estimate | ( | __global Keypoint * | old_points, |
__global Keypoint * | new_points_estimates, | ||
__global InternalKeypoint * | old_points_internal, | ||
__global InternalKeypoint * | new_points_internal, | ||
const float | scale | ||
) |
Initializes the new_points array when the level of pyramid is equal to max and if use_initial_estimate = 1.
[in] | old_points | An array of key points that are defined at the old_images high resolution pyramid. |
[in] | new_points_estimates | An array of estimate key points that are defined at the old_images high resolution pyramid. |
[in,out] | old_points_internal | An array of internal key points that are defined at the old_images high resolution pyramid. |
[out] | new_points_internal | An array of internal key points that are defined at the new_images high resolution pyramid. |
[in] | scale | Scale factor to apply for the new_point coordinates. |
Definition at line 123 of file optical_flow_pyramid_lk.cl.
References arm_compute::test::validation::scale, Keypoint::tracking_status, InternalKeypoint::tracking_status, Keypoint::x, InternalKeypoint::x, Keypoint::y, and InternalKeypoint::y.
void __kernel lktracker_stage0 | ( | __global uchar * | old_image_ptr, |
uint | old_image_stride_x, | ||
uint | old_image_step_x, | ||
uint | old_image_stride_y, | ||
uint | old_image_step_y, | ||
uint | old_image_offset_first_element_in_bytes, | ||
__global uchar * | old_scharr_gx_ptr, | ||
uint | old_scharr_gx_stride_x, | ||
uint | old_scharr_gx_step_x, | ||
uint | old_scharr_gx_stride_y, | ||
uint | old_scharr_gx_step_y, | ||
uint | old_scharr_gx_offset_first_element_in_bytes, | ||
__global uchar * | old_scharr_gy_ptr, | ||
uint | old_scharr_gy_stride_x, | ||
uint | old_scharr_gy_step_x, | ||
uint | old_scharr_gy_stride_y, | ||
uint | old_scharr_gy_step_y, | ||
uint | old_scharr_gy_offset_first_element_in_bytes, | ||
__global float4 * | old_points, | ||
__global float4 * | new_points, | ||
__global float4 * | coeff, | ||
__global short4 * | iold_val, | ||
const int | window_dimension, | ||
const int | window_dimension_pow2, | ||
const int | half_window, | ||
const float3 | border_limits, | ||
const float | eig_const, | ||
const int | level0 | ||
) |
Computes A11, A12, A22, min_eig, ival, ixval and iyval at level 0th of the pyramid.
These values will be used in step 1.
[in] | old_image_ptr | Pointer to the input old image. Supported data types: U8 |
[in] | old_image_stride_x | Stride of the input old image in X dimension (in bytes) |
[in] | old_image_step_x | old_image_stride_x * number of elements along X processed per workitem(in bytes) |
[in] | old_image_stride_y | Stride of the input old image in Y dimension (in bytes) |
[in] | old_image_step_y | old_image_stride_y * number of elements along Y processed per workitem(in bytes) |
[in] | old_image_offset_first_element_in_bytes | The offset of the first element in the input old image |
[in] | old_scharr_gx_ptr | Pointer to the input scharr x image. Supported data types: S16 |
[in] | old_scharr_gx_stride_x | Stride of the input scharr x image in X dimension (in bytes) |
[in] | old_scharr_gx_step_x | old_scharr_gx_stride_x * number of elements along X processed per workitem(in bytes) |
[in] | old_scharr_gx_stride_y | Stride of the input scharr x image in Y dimension (in bytes) |
[in] | old_scharr_gx_step_y | old_scharr_gx_stride_y * number of elements along Y processed per workitem(in bytes) |
[in] | old_scharr_gx_offset_first_element_in_bytes | The offset of the first element in the input scharr x image |
[in] | old_scharr_gy_ptr | Pointer to the input scharr y image. Supported data types: S16 |
[in] | old_scharr_gy_stride_x | Stride of the input scharr y image in X dimension (in bytes) |
[in] | old_scharr_gy_step_x | old_scharr_gy_stride_x * number of elements along X processed per workitem(in bytes) |
[in] | old_scharr_gy_stride_y | Stride of the input scharr y image in Y dimension (in bytes) |
[in] | old_scharr_gy_step_y | old_scharr_gy_stride_y * number of elements along Y processed per workitem(in bytes) |
[in] | old_scharr_gy_offset_first_element_in_bytes | The offset of the first element in the input scharr y image |
[in] | old_points | An array of key points. Those key points are defined at the old_images high resolution pyramid |
[in,out] | new_points | An output array of key points. Those key points are defined at the new_images high resolution pyramid |
[out] | coeff | It stores | A11 | A12 | A22 | min_eig | for each keypoint |
[out] | iold_val | It stores | ival | ixval | iyval | dummy | for each point in the window centered on old_keypoint |
[in] | window_dimension | The size of the window on which to perform the algorithm |
[in] | window_dimension_pow2 | The squared size of the window on which to perform the algorithm |
[in] | half_window | The half size of the window on which to perform the algorithm |
[in] | border_limits | It stores the right border limit (width - window_dimension - 1, height - window_dimension - 1,) |
[in] | eig_const | 1.0f / (float)(2.0f * window_dimension * window_dimension) |
[in] | level0 | It is set to 1 if level 0 of the pyramid |
Definition at line 211 of file optical_flow_pyramid_lk.cl.
References CONVERT_TO_IMAGE_STRUCT_NO_STEP, D0, D1, FLT_SCALE, offset(), and arm_compute::round().
void __kernel lktracker_stage1 | ( | __global uchar * | new_image_ptr, |
uint | new_image_stride_x, | ||
uint | new_image_step_x, | ||
uint | new_image_stride_y, | ||
uint | new_image_step_y, | ||
uint | new_image_offset_first_element_in_bytes, | ||
__global float4 * | new_points, | ||
__global float4 * | coeff, | ||
__global short4 * | iold_val, | ||
const int | window_dimension, | ||
const int | window_dimension_pow2, | ||
const int | half_window, | ||
const int | num_iterations, | ||
const float | epsilon, | ||
const float3 | border_limits, | ||
const float | eig_const, | ||
const int | level0, | ||
const int | term_epsilon | ||
) |
Computes the motion vector for a given keypoint.
[in] | new_image_ptr | Pointer to the input new image. Supported data types: U8 |
[in] | new_image_stride_x | Stride of the input new image in X dimension (in bytes) |
[in] | new_image_step_x | new_image_stride_x * number of elements along X processed per workitem(in bytes) |
[in] | new_image_stride_y | Stride of the input new image in Y dimension (in bytes) |
[in] | new_image_step_y | new_image_stride_y * number of elements along Y processed per workitem(in bytes) |
[in] | new_image_offset_first_element_in_bytes | The offset of the first element in the input new image |
[in,out] | new_points | An output array of key points. Those key points are defined at the new_images high resolution pyramid |
[in] | coeff | The | A11 | A12 | A22 | min_eig | for each keypoint |
[in] | iold_val | The | ival | ixval | iyval | dummy | for each point in the window centered on old_keypoint |
[in] | window_dimension | The size of the window on which to perform the algorithm |
[in] | window_dimension_pow2 | The squared size of the window on which to perform the algorithm |
[in] | half_window | The half size of the window on which to perform the algorithm |
[in] | num_iterations | The maximum number of iterations |
[in] | epsilon | The value for terminating the algorithm. |
[in] | border_limits | It stores the right border limit (width - window_dimension - 1, height - window_dimension - 1,) |
[in] | eig_const | 1.0f / (float)(2.0f * window_dimension * window_dimension) |
[in] | level0 | It is set to 1 if level of pyramid = 0 |
[in] | term_epsilon | It is set to 1 if termination = TERM_CRITERIA_EPSILON |
Definition at line 361 of file optical_flow_pyramid_lk.cl.
References arm_compute::test::validation::b, CONVERT_TO_IMAGE_STRUCT_NO_STEP, D0, D1, DETERMINANT_THR, EIGENVALUE_THR, FLT_SCALE, offset(), and arm_compute::round().