blob: 7eec9e9599a8eee29e22da7ab1fa0233833cbf97 [file] [log] [blame]
<!-- HTML header for doxygen 1.8.9.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines -->
<title>Compute Library: src/core/CL/cl_kernels/optical_flow_pyramid_lk.cl File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Compute Library
&#160;<span id="projectnumber">17.10</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.xhtml"><span>Main&#160;Page</span></a></li>
<li><a href="pages.xhtml"><span>Related&#160;Pages</span></a></li>
<li><a href="namespaces.xhtml"><span>Namespaces</span></a></li>
<li><a href="annotated.xhtml"><span>Data&#160;Structures</span></a></li>
<li class="current"><a href="files.xhtml"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.xhtml"><span>File&#160;List</span></a></li>
<li><a href="globals.xhtml"><span>Globals</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('optical__flow__pyramid__lk_8cl.xhtml','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(11)"><span class="SelectionMark">&#160;</span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">optical_flow_pyramid_lk.cl File Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="helpers_8h_source.xhtml">helpers.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="types_8h_source.xhtml">types.h</a>&quot;</code><br/>
</div>
<p><a href="optical__flow__pyramid__lk_8cl_source.xhtml">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_internal_keypoint.xhtml">InternalKeypoint</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a0f3927d942874a04e6464bdb946de046"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="optical__flow__pyramid__lk_8cl.xhtml#a0f3927d942874a04e6464bdb946de046">DETERMINANT_THR</a>&#160;&#160;&#160;1.0e-07f</td></tr>
<tr class="memdesc:a0f3927d942874a04e6464bdb946de046"><td class="mdescLeft">&#160;</td><td class="mdescRight">Threshold for the determinant. <a href="#a0f3927d942874a04e6464bdb946de046">More...</a><br/></td></tr>
<tr class="separator:a0f3927d942874a04e6464bdb946de046"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3955a0fbedb5b3eae9a38801fb01bac5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="optical__flow__pyramid__lk_8cl.xhtml#a3955a0fbedb5b3eae9a38801fb01bac5">EIGENVALUE_THR</a>&#160;&#160;&#160;1.0e-04f</td></tr>
<tr class="memdesc:a3955a0fbedb5b3eae9a38801fb01bac5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Thresholds for minimum eigenvalue. <a href="#a3955a0fbedb5b3eae9a38801fb01bac5">More...</a><br/></td></tr>
<tr class="separator:a3955a0fbedb5b3eae9a38801fb01bac5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aab6bf9cc4b300f72d07a2ebe9939f376"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="optical__flow__pyramid__lk_8cl.xhtml#aab6bf9cc4b300f72d07a2ebe9939f376">W_BITS</a>&#160;&#160;&#160;(14)</td></tr>
<tr class="memdesc:aab6bf9cc4b300f72d07a2ebe9939f376"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constants used for Lucas-Kanade Algorithm. <a href="#aab6bf9cc4b300f72d07a2ebe9939f376">More...</a><br/></td></tr>
<tr class="separator:aab6bf9cc4b300f72d07a2ebe9939f376"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1852457538f524c42f96b66882bd9b35"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="optical__flow__pyramid__lk_8cl.xhtml#a1852457538f524c42f96b66882bd9b35">FLT_SCALE</a>&#160;&#160;&#160;(1.0f / (float)(1 &lt;&lt; 20))</td></tr>
<tr class="separator:a1852457538f524c42f96b66882bd9b35"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae0b2360d4b8e961bf2709b0663fd9f2a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="optical__flow__pyramid__lk_8cl.xhtml#ae0b2360d4b8e961bf2709b0663fd9f2a">D0</a>&#160;&#160;&#160;((float)(1 &lt;&lt; <a class="el" href="optical__flow__pyramid__lk_8cl.xhtml#aab6bf9cc4b300f72d07a2ebe9939f376">W_BITS</a>))</td></tr>
<tr class="separator:ae0b2360d4b8e961bf2709b0663fd9f2a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a52deba56234661c77d4b9573d5175ae2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="optical__flow__pyramid__lk_8cl.xhtml#a52deba56234661c77d4b9573d5175ae2">D1</a>&#160;&#160;&#160;(1.0f / (float)(1 &lt;&lt; (W_BITS - 5)))</td></tr>
<tr class="separator:a52deba56234661c77d4b9573d5175ae2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ad3a2575d8a9005ddf8ce79dda76918f8"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="struct_internal_keypoint.xhtml">InternalKeypoint</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="optical__flow__pyramid__lk_8cl.xhtml#ad3a2575d8a9005ddf8ce79dda76918f8">InternalKeypoint</a></td></tr>
<tr class="separator:ad3a2575d8a9005ddf8ce79dda76918f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a73bd536f33d9707d1165a0fce16db833"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="optical__flow__pyramid__lk_8cl.xhtml#a73bd536f33d9707d1165a0fce16db833">init_level</a> (__global float4 *old_points_internal, __global float4 *new_points_internal, const float scale)</td></tr>
<tr class="memdesc:a73bd536f33d9707d1165a0fce16db833"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the internal new points array when the level of pyramid is NOT equal to max. <a href="#a73bd536f33d9707d1165a0fce16db833">More...</a><br/></td></tr>
<tr class="separator:a73bd536f33d9707d1165a0fce16db833"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a324194275a47768c0460d19b16b477db"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="optical__flow__pyramid__lk_8cl.xhtml#a324194275a47768c0460d19b16b477db">init_level_max</a> (__global <a class="el" href="struct_keypoint.xhtml">Keypoint</a> *old_points, __global <a class="el" href="struct_internal_keypoint.xhtml">InternalKeypoint</a> *old_points_internal, __global <a class="el" href="struct_internal_keypoint.xhtml">InternalKeypoint</a> *new_points_internal, const float scale)</td></tr>
<tr class="memdesc:a324194275a47768c0460d19b16b477db"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the internal new points array when the level of pyramid is equal to max. <a href="#a324194275a47768c0460d19b16b477db">More...</a><br/></td></tr>
<tr class="separator:a324194275a47768c0460d19b16b477db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b777fd3d432419912e4dbc94fe9d3f5"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="optical__flow__pyramid__lk_8cl.xhtml#a4b777fd3d432419912e4dbc94fe9d3f5">init_level_max_initial_estimate</a> (__global <a class="el" href="struct_keypoint.xhtml">Keypoint</a> *old_points, __global <a class="el" href="struct_keypoint.xhtml">Keypoint</a> *new_points_estimates, __global <a class="el" href="struct_internal_keypoint.xhtml">InternalKeypoint</a> *old_points_internal, __global <a class="el" href="struct_internal_keypoint.xhtml">InternalKeypoint</a> *new_points_internal, const float scale)</td></tr>
<tr class="memdesc:a4b777fd3d432419912e4dbc94fe9d3f5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the new_points array when the level of pyramid is equal to max and if use_initial_estimate = 1. <a href="#a4b777fd3d432419912e4dbc94fe9d3f5">More...</a><br/></td></tr>
<tr class="separator:a4b777fd3d432419912e4dbc94fe9d3f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0beafe52e6ef0247d036f06bd6da622a"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="optical__flow__pyramid__lk_8cl.xhtml#a0beafe52e6ef0247d036f06bd6da622a">finalize</a> (__global <a class="el" href="struct_internal_keypoint.xhtml">InternalKeypoint</a> *new_points_internal, __global <a class="el" href="struct_keypoint.xhtml">Keypoint</a> *new_points)</td></tr>
<tr class="memdesc:a0beafe52e6ef0247d036f06bd6da622a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Truncates the coordinates stored in new_points array. <a href="#a0beafe52e6ef0247d036f06bd6da622a">More...</a><br/></td></tr>
<tr class="separator:a0beafe52e6ef0247d036f06bd6da622a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae1961d0f636da631c35ffaf096187840"><td class="memItemLeft" align="right" valign="top">void __kernel&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="optical__flow__pyramid__lk_8cl.xhtml#ae1961d0f636da631c35ffaf096187840">lktracker_stage0</a> (__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)</td></tr>
<tr class="memdesc:ae1961d0f636da631c35ffaf096187840"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes A11, A12, A22, min_eig, ival, ixval and iyval at level 0th of the pyramid. <a href="#ae1961d0f636da631c35ffaf096187840">More...</a><br/></td></tr>
<tr class="separator:ae1961d0f636da631c35ffaf096187840"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a97401877f0071dbe2443c697b29d80e0"><td class="memItemLeft" align="right" valign="top">void __kernel&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="optical__flow__pyramid__lk_8cl.xhtml#a97401877f0071dbe2443c697b29d80e0">lktracker_stage1</a> (__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_iteration, const int term_epsilon)</td></tr>
<tr class="memdesc:a97401877f0071dbe2443c697b29d80e0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the motion vector for a given keypoint. <a href="#a97401877f0071dbe2443c697b29d80e0">More...</a><br/></td></tr>
<tr class="separator:a97401877f0071dbe2443c697b29d80e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="ae0b2360d4b8e961bf2709b0663fd9f2a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define D0&#160;&#160;&#160;((float)(1 &lt;&lt; <a class="el" href="optical__flow__pyramid__lk_8cl.xhtml#aab6bf9cc4b300f72d07a2ebe9939f376">W_BITS</a>))</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00059">59</a> of file <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml">optical_flow_pyramid_lk.cl</a>.</p>
<p>Referenced by <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00207">lktracker_stage0()</a>, and <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00358">lktracker_stage1()</a>.</p>
</div>
</div>
<a class="anchor" id="a52deba56234661c77d4b9573d5175ae2"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define D1&#160;&#160;&#160;(1.0f / (float)(1 &lt;&lt; (W_BITS - 5)))</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00060">60</a> of file <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml">optical_flow_pyramid_lk.cl</a>.</p>
<p>Referenced by <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00207">lktracker_stage0()</a>, and <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00358">lktracker_stage1()</a>.</p>
</div>
</div>
<a class="anchor" id="a0f3927d942874a04e6464bdb946de046"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define DETERMINANT_THR&#160;&#160;&#160;1.0e-07f</td>
</tr>
</table>
</div><div class="memdoc">
<p>Threshold for the determinant. </p>
<p>Used for lost tracking criteria </p>
<p>Definition at line <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00051">51</a> of file <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml">optical_flow_pyramid_lk.cl</a>.</p>
<p>Referenced by <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00358">lktracker_stage1()</a>.</p>
</div>
</div>
<a class="anchor" id="a3955a0fbedb5b3eae9a38801fb01bac5"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define EIGENVALUE_THR&#160;&#160;&#160;1.0e-04f</td>
</tr>
</table>
</div><div class="memdoc">
<p>Thresholds for minimum eigenvalue. </p>
<p>Used for lost tracking criteria </p>
<p>Definition at line <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00054">54</a> of file <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml">optical_flow_pyramid_lk.cl</a>.</p>
<p>Referenced by <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00358">lktracker_stage1()</a>.</p>
</div>
</div>
<a class="anchor" id="a1852457538f524c42f96b66882bd9b35"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define FLT_SCALE&#160;&#160;&#160;(1.0f / (float)(1 &lt;&lt; 20))</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00058">58</a> of file <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml">optical_flow_pyramid_lk.cl</a>.</p>
<p>Referenced by <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00207">lktracker_stage0()</a>, and <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00358">lktracker_stage1()</a>.</p>
</div>
</div>
<a class="anchor" id="aab6bf9cc4b300f72d07a2ebe9939f376"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define W_BITS&#160;&#160;&#160;(14)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Constants used for Lucas-Kanade Algorithm. </p>
<p>Definition at line <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00057">57</a> of file <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml">optical_flow_pyramid_lk.cl</a>.</p>
</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="ad3a2575d8a9005ddf8ce79dda76918f8"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef struct <a class="el" href="struct_internal_keypoint.xhtml">InternalKeypoint</a> <a class="el" href="struct_internal_keypoint.xhtml">InternalKeypoint</a></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a0beafe52e6ef0247d036f06bd6da622a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">__kernel void finalize </td>
<td>(</td>
<td class="paramtype">__global <a class="el" href="struct_internal_keypoint.xhtml">InternalKeypoint</a> *&#160;</td>
<td class="paramname"><em>new_points_internal</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">__global <a class="el" href="struct_keypoint.xhtml">Keypoint</a> *&#160;</td>
<td class="paramname"><em>new_points</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Truncates the coordinates stored in new_points array. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">new_points_internal</td><td>An array of estimate key points that are defined at the new_images high resolution pyramid. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">new_points</td><td>An array of internal key points that are defined at the new_images high resolution pyramid. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00157">157</a> of file <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml">optical_flow_pyramid_lk.cl</a>.</p>
<p>References <a class="el" href="_toolchain_support_8h_source.xhtml#l00228">arm_compute::support::cpp11::round()</a>, <a class="el" href="types_8h_source.xhtml#l00042">Keypoint::tracking_status</a>, <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00046">InternalKeypoint::tracking_status</a>, <a class="el" href="types_8h_source.xhtml#l00037">Keypoint::x</a>, <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00044">InternalKeypoint::x</a>, <a class="el" href="types_8h_source.xhtml#l00038">Keypoint::y</a>, and <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00045">InternalKeypoint::y</a>.</p>
<div class="fragment"><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;{</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <span class="keywordtype">int</span> idx = get_global_id(0);</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <span class="comment">// Load internal keypoint</span></div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <a class="code" href="struct_internal_keypoint.xhtml">InternalKeypoint</a> new_point_internal = new_points_internal[idx];</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160;</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; <span class="comment">// Calculate output point</span></div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <a class="code" href="struct_keypoint.xhtml">Keypoint</a> new_point;</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; new_point.<a class="code" href="struct_keypoint.xhtml#a6150e0515f7202e2fb518f7206ed97dc">x</a> = <a class="code" href="namespacearm__compute_1_1support_1_1cpp11.xhtml#ab71c35ca207b916a9f8b0336ab88484e">round</a>(new_point_internal.<a class="code" href="struct_internal_keypoint.xhtml#ad0da36b2558901e21e7a30f6c227a45e">x</a>);</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; new_point.<a class="code" href="struct_keypoint.xhtml#a0a2f84ed7838f07779ae24c5a9086d33">y</a> = <a class="code" href="namespacearm__compute_1_1support_1_1cpp11.xhtml#ab71c35ca207b916a9f8b0336ab88484e">round</a>(new_point_internal.<a class="code" href="struct_internal_keypoint.xhtml#aa4f0d3eebc3c443f9be81bf48561a217">y</a>);</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; new_point.<a class="code" href="struct_keypoint.xhtml#a7edfed755585d6095522904dbe0ec4d8">tracking_status</a> = new_point_internal.<a class="code" href="struct_internal_keypoint.xhtml#a08361efa212a9ab04a5965766ea942d5">tracking_status</a>;</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160;</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; <span class="comment">// Store new point</span></div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; new_points[idx] = new_point;</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160;}</div>
<div class="ttc" id="struct_internal_keypoint_xhtml_ad0da36b2558901e21e7a30f6c227a45e"><div class="ttname"><a href="struct_internal_keypoint.xhtml#ad0da36b2558901e21e7a30f6c227a45e">InternalKeypoint::x</a></div><div class="ttdeci">float x</div><div class="ttdoc">The x coordinate. </div><div class="ttdef"><b>Definition:</b> <a href="optical__flow__pyramid__lk_8cl_source.xhtml#l00044">optical_flow_pyramid_lk.cl:44</a></div></div>
<div class="ttc" id="struct_internal_keypoint_xhtml_a08361efa212a9ab04a5965766ea942d5"><div class="ttname"><a href="struct_internal_keypoint.xhtml#a08361efa212a9ab04a5965766ea942d5">InternalKeypoint::tracking_status</a></div><div class="ttdeci">float tracking_status</div><div class="ttdoc">A zero indicates a lost point. </div><div class="ttdef"><b>Definition:</b> <a href="optical__flow__pyramid__lk_8cl_source.xhtml#l00046">optical_flow_pyramid_lk.cl:46</a></div></div>
<div class="ttc" id="struct_keypoint_xhtml"><div class="ttname"><a href="struct_keypoint.xhtml">Keypoint</a></div><div class="ttdef"><b>Definition:</b> <a href="types_8h_source.xhtml#l00035">types.h:35</a></div></div>
<div class="ttc" id="struct_keypoint_xhtml_a0a2f84ed7838f07779ae24c5a9086d33"><div class="ttname"><a href="struct_keypoint.xhtml#a0a2f84ed7838f07779ae24c5a9086d33">Keypoint::y</a></div><div class="ttdeci">int y</div><div class="ttdoc">The y coordinate. </div><div class="ttdef"><b>Definition:</b> <a href="types_8h_source.xhtml#l00038">types.h:38</a></div></div>
<div class="ttc" id="struct_internal_keypoint_xhtml"><div class="ttname"><a href="struct_internal_keypoint.xhtml">InternalKeypoint</a></div><div class="ttdef"><b>Definition:</b> <a href="optical__flow__pyramid__lk_8cl_source.xhtml#l00042">optical_flow_pyramid_lk.cl:42</a></div></div>
<div class="ttc" id="namespacearm__compute_1_1support_1_1cpp11_xhtml_ab71c35ca207b916a9f8b0336ab88484e"><div class="ttname"><a href="namespacearm__compute_1_1support_1_1cpp11.xhtml#ab71c35ca207b916a9f8b0336ab88484e">arm_compute::support::cpp11::round</a></div><div class="ttdeci">T round(T value)</div><div class="ttdoc">Round floating-point value with half value rounding away from zero. </div><div class="ttdef"><b>Definition:</b> <a href="_toolchain_support_8h_source.xhtml#l00228">ToolchainSupport.h:228</a></div></div>
<div class="ttc" id="struct_keypoint_xhtml_a7edfed755585d6095522904dbe0ec4d8"><div class="ttname"><a href="struct_keypoint.xhtml#a7edfed755585d6095522904dbe0ec4d8">Keypoint::tracking_status</a></div><div class="ttdeci">int tracking_status</div><div class="ttdoc">A zero indicates a lost point. </div><div class="ttdef"><b>Definition:</b> <a href="types_8h_source.xhtml#l00042">types.h:42</a></div></div>
<div class="ttc" id="struct_keypoint_xhtml_a6150e0515f7202e2fb518f7206ed97dc"><div class="ttname"><a href="struct_keypoint.xhtml#a6150e0515f7202e2fb518f7206ed97dc">Keypoint::x</a></div><div class="ttdeci">int x</div><div class="ttdoc">The x coordinate. </div><div class="ttdef"><b>Definition:</b> <a href="types_8h_source.xhtml#l00037">types.h:37</a></div></div>
<div class="ttc" id="struct_internal_keypoint_xhtml_aa4f0d3eebc3c443f9be81bf48561a217"><div class="ttname"><a href="struct_internal_keypoint.xhtml#aa4f0d3eebc3c443f9be81bf48561a217">InternalKeypoint::y</a></div><div class="ttdeci">float y</div><div class="ttdoc">The y coordinate. </div><div class="ttdef"><b>Definition:</b> <a href="optical__flow__pyramid__lk_8cl_source.xhtml#l00045">optical_flow_pyramid_lk.cl:45</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a73bd536f33d9707d1165a0fce16db833"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">__kernel void init_level </td>
<td>(</td>
<td class="paramtype">__global float4 *&#160;</td>
<td class="paramname"><em>old_points_internal</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">__global float4 *&#160;</td>
<td class="paramname"><em>new_points_internal</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const float&#160;</td>
<td class="paramname"><em>scale</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Initializes the internal new points array when the level of pyramid is NOT equal to max. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in,out]</td><td class="paramname">old_points_internal</td><td>An array of internal key points that are defined at the old_images high resolution pyramid. </td></tr>
<tr><td class="paramdir">[in,out]</td><td class="paramname">new_points_internal</td><td>An array of internal key points that are defined at the new_images high resolution pyramid. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">scale</td><td>Scale factor to apply for the new_point coordinates. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00068">68</a> of file <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml">optical_flow_pyramid_lk.cl</a>.</p>
<div class="fragment"><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;{</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keywordtype">int</span> idx = get_global_id(0);</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <span class="comment">// Get old and new keypoints</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; float4 old_point = old_points_internal[idx];</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; float4 new_point = new_points_internal[idx];</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="comment">// Scale accordingly with the pyramid_scale</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; old_point.xy *= (float2)(2.0f);</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; new_point.xy *= (float2)(2.0f);</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; old_points_internal[idx] = old_point;</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; new_points_internal[idx] = new_point;</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a324194275a47768c0460d19b16b477db"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">__kernel void init_level_max </td>
<td>(</td>
<td class="paramtype">__global <a class="el" href="struct_keypoint.xhtml">Keypoint</a> *&#160;</td>
<td class="paramname"><em>old_points</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">__global <a class="el" href="struct_internal_keypoint.xhtml">InternalKeypoint</a> *&#160;</td>
<td class="paramname"><em>old_points_internal</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">__global <a class="el" href="struct_internal_keypoint.xhtml">InternalKeypoint</a> *&#160;</td>
<td class="paramname"><em>new_points_internal</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const float&#160;</td>
<td class="paramname"><em>scale</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Initializes the internal new points array when the level of pyramid is equal to max. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">old_points</td><td>An array of key points that are defined at the old_images high resolution pyramid. </td></tr>
<tr><td class="paramdir">[in,out]</td><td class="paramname">old_points_internal</td><td>An array of internal key points that are defined at the old_images high resolution pyramid. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">new_points_internal</td><td>An array of internal key points that are defined at the new_images high resolution pyramid. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">scale</td><td>Scale factor to apply for the new_point coordinates. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00094">94</a> of file <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml">optical_flow_pyramid_lk.cl</a>.</p>
<p>References <a class="el" href="_c_p_p_2_scale_8cpp_source.xhtml#l00039">arm_compute::test::validation::reference::scale()</a>, <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00046">InternalKeypoint::tracking_status</a>, <a class="el" href="types_8h_source.xhtml#l00037">Keypoint::x</a>, <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00044">InternalKeypoint::x</a>, <a class="el" href="types_8h_source.xhtml#l00038">Keypoint::y</a>, and <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00045">InternalKeypoint::y</a>.</p>
<div class="fragment"><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;{</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="keywordtype">int</span> idx = get_global_id(0);</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <a class="code" href="struct_keypoint.xhtml">Keypoint</a> old_point = old_points[idx];</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <span class="comment">// Get old keypoint to track</span></div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <a class="code" href="struct_internal_keypoint.xhtml">InternalKeypoint</a> old_point_internal;</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; old_point_internal.<a class="code" href="struct_internal_keypoint.xhtml#ad0da36b2558901e21e7a30f6c227a45e">x</a> = old_point.<a class="code" href="struct_keypoint.xhtml#a6150e0515f7202e2fb518f7206ed97dc">x</a> * <a class="code" href="namespacearm__compute_1_1test_1_1validation_1_1reference.xhtml#a2c08fc82f2e4b9733cd0dacd6eabe579">scale</a>;</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; old_point_internal.<a class="code" href="struct_internal_keypoint.xhtml#aa4f0d3eebc3c443f9be81bf48561a217">y</a> = old_point.<a class="code" href="struct_keypoint.xhtml#a0a2f84ed7838f07779ae24c5a9086d33">y</a> * <a class="code" href="namespacearm__compute_1_1test_1_1validation_1_1reference.xhtml#a2c08fc82f2e4b9733cd0dacd6eabe579">scale</a>;</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; old_point_internal.<a class="code" href="struct_internal_keypoint.xhtml#a08361efa212a9ab04a5965766ea942d5">tracking_status</a> = 1.f;</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="comment">// Store internal keypoints</span></div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; old_points_internal[idx] = old_point_internal;</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; new_points_internal[idx] = old_point_internal;</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;}</div>
<div class="ttc" id="struct_internal_keypoint_xhtml_ad0da36b2558901e21e7a30f6c227a45e"><div class="ttname"><a href="struct_internal_keypoint.xhtml#ad0da36b2558901e21e7a30f6c227a45e">InternalKeypoint::x</a></div><div class="ttdeci">float x</div><div class="ttdoc">The x coordinate. </div><div class="ttdef"><b>Definition:</b> <a href="optical__flow__pyramid__lk_8cl_source.xhtml#l00044">optical_flow_pyramid_lk.cl:44</a></div></div>
<div class="ttc" id="struct_internal_keypoint_xhtml_a08361efa212a9ab04a5965766ea942d5"><div class="ttname"><a href="struct_internal_keypoint.xhtml#a08361efa212a9ab04a5965766ea942d5">InternalKeypoint::tracking_status</a></div><div class="ttdeci">float tracking_status</div><div class="ttdoc">A zero indicates a lost point. </div><div class="ttdef"><b>Definition:</b> <a href="optical__flow__pyramid__lk_8cl_source.xhtml#l00046">optical_flow_pyramid_lk.cl:46</a></div></div>
<div class="ttc" id="struct_keypoint_xhtml"><div class="ttname"><a href="struct_keypoint.xhtml">Keypoint</a></div><div class="ttdef"><b>Definition:</b> <a href="types_8h_source.xhtml#l00035">types.h:35</a></div></div>
<div class="ttc" id="struct_keypoint_xhtml_a0a2f84ed7838f07779ae24c5a9086d33"><div class="ttname"><a href="struct_keypoint.xhtml#a0a2f84ed7838f07779ae24c5a9086d33">Keypoint::y</a></div><div class="ttdeci">int y</div><div class="ttdoc">The y coordinate. </div><div class="ttdef"><b>Definition:</b> <a href="types_8h_source.xhtml#l00038">types.h:38</a></div></div>
<div class="ttc" id="struct_internal_keypoint_xhtml"><div class="ttname"><a href="struct_internal_keypoint.xhtml">InternalKeypoint</a></div><div class="ttdef"><b>Definition:</b> <a href="optical__flow__pyramid__lk_8cl_source.xhtml#l00042">optical_flow_pyramid_lk.cl:42</a></div></div>
<div class="ttc" id="namespacearm__compute_1_1test_1_1validation_1_1reference_xhtml_a2c08fc82f2e4b9733cd0dacd6eabe579"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation_1_1reference.xhtml#a2c08fc82f2e4b9733cd0dacd6eabe579">arm_compute::test::validation::reference::scale</a></div><div class="ttdeci">SimpleTensor&lt; T &gt; scale(const SimpleTensor&lt; T &gt; &amp;in, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, T constant_border_value)</div><div class="ttdef"><b>Definition:</b> <a href="_c_p_p_2_scale_8cpp_source.xhtml#l00039">Scale.cpp:39</a></div></div>
<div class="ttc" id="struct_keypoint_xhtml_a6150e0515f7202e2fb518f7206ed97dc"><div class="ttname"><a href="struct_keypoint.xhtml#a6150e0515f7202e2fb518f7206ed97dc">Keypoint::x</a></div><div class="ttdeci">int x</div><div class="ttdoc">The x coordinate. </div><div class="ttdef"><b>Definition:</b> <a href="types_8h_source.xhtml#l00037">types.h:37</a></div></div>
<div class="ttc" id="struct_internal_keypoint_xhtml_aa4f0d3eebc3c443f9be81bf48561a217"><div class="ttname"><a href="struct_internal_keypoint.xhtml#aa4f0d3eebc3c443f9be81bf48561a217">InternalKeypoint::y</a></div><div class="ttdeci">float y</div><div class="ttdoc">The y coordinate. </div><div class="ttdef"><b>Definition:</b> <a href="optical__flow__pyramid__lk_8cl_source.xhtml#l00045">optical_flow_pyramid_lk.cl:45</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a4b777fd3d432419912e4dbc94fe9d3f5"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">__kernel void init_level_max_initial_estimate </td>
<td>(</td>
<td class="paramtype">__global <a class="el" href="struct_keypoint.xhtml">Keypoint</a> *&#160;</td>
<td class="paramname"><em>old_points</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">__global <a class="el" href="struct_keypoint.xhtml">Keypoint</a> *&#160;</td>
<td class="paramname"><em>new_points_estimates</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">__global <a class="el" href="struct_internal_keypoint.xhtml">InternalKeypoint</a> *&#160;</td>
<td class="paramname"><em>old_points_internal</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">__global <a class="el" href="struct_internal_keypoint.xhtml">InternalKeypoint</a> *&#160;</td>
<td class="paramname"><em>new_points_internal</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const float&#160;</td>
<td class="paramname"><em>scale</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Initializes the new_points array when the level of pyramid is equal to max and if use_initial_estimate = 1. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">old_points</td><td>An array of key points that are defined at the old_images high resolution pyramid. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">new_points_estimates</td><td>An array of estimate key points that are defined at the old_images high resolution pyramid. </td></tr>
<tr><td class="paramdir">[in,out]</td><td class="paramname">old_points_internal</td><td>An array of internal key points that are defined at the old_images high resolution pyramid. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">new_points_internal</td><td>An array of internal key points that are defined at the new_images high resolution pyramid. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">scale</td><td>Scale factor to apply for the new_point coordinates. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00123">123</a> of file <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml">optical_flow_pyramid_lk.cl</a>.</p>
<p>References <a class="el" href="_c_p_p_2_scale_8cpp_source.xhtml#l00039">arm_compute::test::validation::reference::scale()</a>, <a class="el" href="types_8h_source.xhtml#l00042">Keypoint::tracking_status</a>, <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00046">InternalKeypoint::tracking_status</a>, <a class="el" href="types_8h_source.xhtml#l00037">Keypoint::x</a>, <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00044">InternalKeypoint::x</a>, <a class="el" href="types_8h_source.xhtml#l00038">Keypoint::y</a>, and <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00045">InternalKeypoint::y</a>.</p>
<div class="fragment"><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;{</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="keywordtype">int</span> idx = get_global_id(0);</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <a class="code" href="struct_keypoint.xhtml">Keypoint</a> old_point = old_points[idx];</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <a class="code" href="struct_keypoint.xhtml">Keypoint</a> new_point_estimate = new_points_estimates[idx];</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <a class="code" href="struct_internal_keypoint.xhtml">InternalKeypoint</a> old_point_internal;</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <a class="code" href="struct_internal_keypoint.xhtml">InternalKeypoint</a> new_point_internal;</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <span class="comment">// Get old keypoint to track</span></div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; old_point_internal.<a class="code" href="struct_internal_keypoint.xhtml#ad0da36b2558901e21e7a30f6c227a45e">x</a> = old_point.<a class="code" href="struct_keypoint.xhtml#a6150e0515f7202e2fb518f7206ed97dc">x</a> * <a class="code" href="namespacearm__compute_1_1test_1_1validation_1_1reference.xhtml#a2c08fc82f2e4b9733cd0dacd6eabe579">scale</a>;</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; old_point_internal.<a class="code" href="struct_internal_keypoint.xhtml#aa4f0d3eebc3c443f9be81bf48561a217">y</a> = old_point.<a class="code" href="struct_keypoint.xhtml#a0a2f84ed7838f07779ae24c5a9086d33">y</a> * <a class="code" href="namespacearm__compute_1_1test_1_1validation_1_1reference.xhtml#a2c08fc82f2e4b9733cd0dacd6eabe579">scale</a>;</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; old_point_internal.<a class="code" href="struct_internal_keypoint.xhtml#a08361efa212a9ab04a5965766ea942d5">tracking_status</a> = 1.f;</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <span class="comment">// Get new keypoint to track</span></div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; new_point_internal.<a class="code" href="struct_internal_keypoint.xhtml#ad0da36b2558901e21e7a30f6c227a45e">x</a> = new_point_estimate.<a class="code" href="struct_keypoint.xhtml#a6150e0515f7202e2fb518f7206ed97dc">x</a> * <a class="code" href="namespacearm__compute_1_1test_1_1validation_1_1reference.xhtml#a2c08fc82f2e4b9733cd0dacd6eabe579">scale</a>;</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; new_point_internal.<a class="code" href="struct_internal_keypoint.xhtml#aa4f0d3eebc3c443f9be81bf48561a217">y</a> = new_point_estimate.<a class="code" href="struct_keypoint.xhtml#a0a2f84ed7838f07779ae24c5a9086d33">y</a> * <a class="code" href="namespacearm__compute_1_1test_1_1validation_1_1reference.xhtml#a2c08fc82f2e4b9733cd0dacd6eabe579">scale</a>;</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; new_point_internal.<a class="code" href="struct_internal_keypoint.xhtml#a08361efa212a9ab04a5965766ea942d5">tracking_status</a> = new_point_estimate.<a class="code" href="struct_keypoint.xhtml#a7edfed755585d6095522904dbe0ec4d8">tracking_status</a>;</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="comment">// Store internal keypoints</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; old_points_internal[idx] = old_point_internal;</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; new_points_internal[idx] = new_point_internal;</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160;}</div>
<div class="ttc" id="struct_internal_keypoint_xhtml_ad0da36b2558901e21e7a30f6c227a45e"><div class="ttname"><a href="struct_internal_keypoint.xhtml#ad0da36b2558901e21e7a30f6c227a45e">InternalKeypoint::x</a></div><div class="ttdeci">float x</div><div class="ttdoc">The x coordinate. </div><div class="ttdef"><b>Definition:</b> <a href="optical__flow__pyramid__lk_8cl_source.xhtml#l00044">optical_flow_pyramid_lk.cl:44</a></div></div>
<div class="ttc" id="struct_internal_keypoint_xhtml_a08361efa212a9ab04a5965766ea942d5"><div class="ttname"><a href="struct_internal_keypoint.xhtml#a08361efa212a9ab04a5965766ea942d5">InternalKeypoint::tracking_status</a></div><div class="ttdeci">float tracking_status</div><div class="ttdoc">A zero indicates a lost point. </div><div class="ttdef"><b>Definition:</b> <a href="optical__flow__pyramid__lk_8cl_source.xhtml#l00046">optical_flow_pyramid_lk.cl:46</a></div></div>
<div class="ttc" id="struct_keypoint_xhtml"><div class="ttname"><a href="struct_keypoint.xhtml">Keypoint</a></div><div class="ttdef"><b>Definition:</b> <a href="types_8h_source.xhtml#l00035">types.h:35</a></div></div>
<div class="ttc" id="struct_keypoint_xhtml_a0a2f84ed7838f07779ae24c5a9086d33"><div class="ttname"><a href="struct_keypoint.xhtml#a0a2f84ed7838f07779ae24c5a9086d33">Keypoint::y</a></div><div class="ttdeci">int y</div><div class="ttdoc">The y coordinate. </div><div class="ttdef"><b>Definition:</b> <a href="types_8h_source.xhtml#l00038">types.h:38</a></div></div>
<div class="ttc" id="struct_internal_keypoint_xhtml"><div class="ttname"><a href="struct_internal_keypoint.xhtml">InternalKeypoint</a></div><div class="ttdef"><b>Definition:</b> <a href="optical__flow__pyramid__lk_8cl_source.xhtml#l00042">optical_flow_pyramid_lk.cl:42</a></div></div>
<div class="ttc" id="struct_keypoint_xhtml_a7edfed755585d6095522904dbe0ec4d8"><div class="ttname"><a href="struct_keypoint.xhtml#a7edfed755585d6095522904dbe0ec4d8">Keypoint::tracking_status</a></div><div class="ttdeci">int tracking_status</div><div class="ttdoc">A zero indicates a lost point. </div><div class="ttdef"><b>Definition:</b> <a href="types_8h_source.xhtml#l00042">types.h:42</a></div></div>
<div class="ttc" id="namespacearm__compute_1_1test_1_1validation_1_1reference_xhtml_a2c08fc82f2e4b9733cd0dacd6eabe579"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation_1_1reference.xhtml#a2c08fc82f2e4b9733cd0dacd6eabe579">arm_compute::test::validation::reference::scale</a></div><div class="ttdeci">SimpleTensor&lt; T &gt; scale(const SimpleTensor&lt; T &gt; &amp;in, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, T constant_border_value)</div><div class="ttdef"><b>Definition:</b> <a href="_c_p_p_2_scale_8cpp_source.xhtml#l00039">Scale.cpp:39</a></div></div>
<div class="ttc" id="struct_keypoint_xhtml_a6150e0515f7202e2fb518f7206ed97dc"><div class="ttname"><a href="struct_keypoint.xhtml#a6150e0515f7202e2fb518f7206ed97dc">Keypoint::x</a></div><div class="ttdeci">int x</div><div class="ttdoc">The x coordinate. </div><div class="ttdef"><b>Definition:</b> <a href="types_8h_source.xhtml#l00037">types.h:37</a></div></div>
<div class="ttc" id="struct_internal_keypoint_xhtml_aa4f0d3eebc3c443f9be81bf48561a217"><div class="ttname"><a href="struct_internal_keypoint.xhtml#aa4f0d3eebc3c443f9be81bf48561a217">InternalKeypoint::y</a></div><div class="ttdeci">float y</div><div class="ttdoc">The y coordinate. </div><div class="ttdef"><b>Definition:</b> <a href="optical__flow__pyramid__lk_8cl_source.xhtml#l00045">optical_flow_pyramid_lk.cl:45</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="ae1961d0f636da631c35ffaf096187840"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void __kernel lktracker_stage0 </td>
<td>(</td>
<td class="paramtype">__global uchar *&#160;</td>
<td class="paramname"><em>old_image_ptr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint&#160;</td>
<td class="paramname"><em>old_image_stride_x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint&#160;</td>
<td class="paramname"><em>old_image_step_x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint&#160;</td>
<td class="paramname"><em>old_image_stride_y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint&#160;</td>
<td class="paramname"><em>old_image_step_y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint&#160;</td>
<td class="paramname"><em>old_image_offset_first_element_in_bytes</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">__global uchar *&#160;</td>
<td class="paramname"><em>old_scharr_gx_ptr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint&#160;</td>
<td class="paramname"><em>old_scharr_gx_stride_x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint&#160;</td>
<td class="paramname"><em>old_scharr_gx_step_x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint&#160;</td>
<td class="paramname"><em>old_scharr_gx_stride_y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint&#160;</td>
<td class="paramname"><em>old_scharr_gx_step_y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint&#160;</td>
<td class="paramname"><em>old_scharr_gx_offset_first_element_in_bytes</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">__global uchar *&#160;</td>
<td class="paramname"><em>old_scharr_gy_ptr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint&#160;</td>
<td class="paramname"><em>old_scharr_gy_stride_x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint&#160;</td>
<td class="paramname"><em>old_scharr_gy_step_x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint&#160;</td>
<td class="paramname"><em>old_scharr_gy_stride_y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint&#160;</td>
<td class="paramname"><em>old_scharr_gy_step_y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint&#160;</td>
<td class="paramname"><em>old_scharr_gy_offset_first_element_in_bytes</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">__global float4 *&#160;</td>
<td class="paramname"><em>old_points</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">__global float4 *&#160;</td>
<td class="paramname"><em>new_points</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">__global float4 *&#160;</td>
<td class="paramname"><em>coeff</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">__global short4 *&#160;</td>
<td class="paramname"><em>iold_val</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const int&#160;</td>
<td class="paramname"><em>window_dimension</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const int&#160;</td>
<td class="paramname"><em>window_dimension_pow2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const int&#160;</td>
<td class="paramname"><em>half_window</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const float3&#160;</td>
<td class="paramname"><em>border_limits</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const float&#160;</td>
<td class="paramname"><em>eig_const</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const int&#160;</td>
<td class="paramname"><em>level0</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Computes A11, A12, A22, min_eig, ival, ixval and iyval at level 0th of the pyramid. </p>
<p>These values will be used in step 1.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">old_image_ptr</td><td>Pointer to the input old image. Supported data types: U8 </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">old_image_stride_x</td><td>Stride of the input old image in X dimension (in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">old_image_step_x</td><td>old_image_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">old_image_stride_y</td><td>Stride of the input old image in Y dimension (in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">old_image_step_y</td><td>old_image_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">old_image_offset_first_element_in_bytes</td><td>The offset of the first element in the input old image </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">old_scharr_gx_ptr</td><td>Pointer to the input scharr x image. Supported data types: S16 </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">old_scharr_gx_stride_x</td><td>Stride of the input scharr x image in X dimension (in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">old_scharr_gx_step_x</td><td>old_scharr_gx_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">old_scharr_gx_stride_y</td><td>Stride of the input scharr x image in Y dimension (in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">old_scharr_gx_step_y</td><td>old_scharr_gx_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">old_scharr_gx_offset_first_element_in_bytes</td><td>The offset of the first element in the input scharr x image </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">old_scharr_gy_ptr</td><td>Pointer to the input scharr y image. Supported data types: S16 </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">old_scharr_gy_stride_x</td><td>Stride of the input scharr y image in X dimension (in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">old_scharr_gy_step_x</td><td>old_scharr_gy_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">old_scharr_gy_stride_y</td><td>Stride of the input scharr y image in Y dimension (in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">old_scharr_gy_step_y</td><td>old_scharr_gy_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">old_scharr_gy_offset_first_element_in_bytes</td><td>The offset of the first element in the input scharr y image </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">old_points</td><td>An array of key points. Those key points are defined at the old_images high resolution pyramid </td></tr>
<tr><td class="paramdir">[in,out]</td><td class="paramname">new_points</td><td>An output array of key points. Those key points are defined at the new_images high resolution pyramid </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">coeff</td><td>It stores | A11 | A12 | A22 | min_eig | for each keypoint </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">iold_val</td><td>It stores | ival | ixval | iyval | dummy | for each point in the window centered on old_keypoint </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">window_dimension</td><td>The size of the window on which to perform the algorithm </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">window_dimension_pow2</td><td>The squared size of the window on which to perform the algorithm </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">half_window</td><td>The half size of the window on which to perform the algorithm </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">border_limits</td><td>It stores the right border limit (width - window_dimension - 1, height - window_dimension - 1,) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">eig_const</td><td>1.0f / (float)(2.0f * window_dimension * window_dimension) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">level0</td><td>It is set to 1 if level 0 of the pyramid </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00207">207</a> of file <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml">optical_flow_pyramid_lk.cl</a>.</p>
<p>References <a class="el" href="helpers_8h_source.xhtml#l00099">CONVERT_TO_IMAGE_STRUCT_NO_STEP</a>, <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00059">D0</a>, <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00060">D1</a>, <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00058">FLT_SCALE</a>, <a class="el" href="helpers_8h_source.xhtml#l00295">offset()</a>, and <a class="el" href="_toolchain_support_8h_source.xhtml#l00228">arm_compute::support::cpp11::round()</a>.</p>
<div class="fragment"><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160;{</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <span class="keywordtype">int</span> idx = get_global_id(0);</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160;</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; <a class="code" href="struct_image.xhtml">Image</a> old_image = <a class="code" href="helpers_8h.xhtml#a4334a4a76f8e9628c0fb9e1acf616e2a">CONVERT_TO_IMAGE_STRUCT_NO_STEP</a>(old_image);</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; <a class="code" href="struct_image.xhtml">Image</a> old_scharr_gx = <a class="code" href="helpers_8h.xhtml#a4334a4a76f8e9628c0fb9e1acf616e2a">CONVERT_TO_IMAGE_STRUCT_NO_STEP</a>(old_scharr_gx);</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; <a class="code" href="struct_image.xhtml">Image</a> old_scharr_gy = <a class="code" href="helpers_8h.xhtml#a4334a4a76f8e9628c0fb9e1acf616e2a">CONVERT_TO_IMAGE_STRUCT_NO_STEP</a>(old_scharr_gy);</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160;</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <span class="comment">// Get old keypoint</span></div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; float2 old_keypoint = old_points[idx].xy - (float2)half_window;</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160;</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; <span class="comment">// Get the floor value</span></div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; float2 iold_keypoint = floor(old_keypoint);</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160;</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; <span class="comment">// Check if using the window dimension we can go out of boundary in the following for loops. If so, invalidate the tracked point</span></div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; <span class="keywordflow">if</span>(any(iold_keypoint &lt; border_limits.zz) || any(iold_keypoint &gt;= border_limits.xy))</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; {</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; <span class="keywordflow">if</span>(level0 == 1)</div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; {</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; <span class="comment">// Invalidate tracked point as we are at level 0</span></div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; new_points[idx].s2 = 0.0f;</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; }</div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160;</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; <span class="comment">// Not valid coordinate. It sets min_eig to 0.0f</span></div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; coeff[idx].s3 = 0.0f;</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160;</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; }</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160;</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; <span class="comment">// Compute weight for the bilinear interpolation</span></div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; float2 ab = old_keypoint - iold_keypoint;</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160;</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; <span class="comment">// Weight used for Bilinear-Interpolation on Scharr images</span></div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; <span class="comment">// w_scharr.s0 = (1.0f - ab.x) * (1.0f - ab.y)</span></div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; <span class="comment">// w_scharr.s1 = ab.x * (1.0f - ab.y)</span></div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; <span class="comment">// w_scharr.s2 = (1.0f - ab.x) * ab.y</span></div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; <span class="comment">// w_scharr.s3 = ab.x * ab.y</span></div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160;</div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; float4 w_scharr;</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; w_scharr.s3 = ab.x * ab.y;</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; w_scharr.s0 = w_scharr.s3 + 1.0f - ab.x - ab.y;</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; w_scharr.s12 = ab - (float2)w_scharr.s3;</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160;</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; <span class="comment">// Weight used for Bilinear-Interpolation on Old and New images</span></div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160; <span class="comment">// w.s0 = round(w_scharr.s0 * D0)</span></div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; <span class="comment">// w.s1 = round(w_scharr.s1 * D0)</span></div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160; <span class="comment">// w.s2 = round(w_scharr.s2 * D0)</span></div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160; <span class="comment">// w.s3 = w.s3 = D0 - w.s0 - w.s1 - w.s2</span></div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160;</div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160; float4 w;</div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; w = <a class="code" href="namespacearm__compute_1_1support_1_1cpp11.xhtml#ab71c35ca207b916a9f8b0336ab88484e">round</a>(w_scharr * (float4)<a class="code" href="optical__flow__pyramid__lk_8cl.xhtml#ae0b2360d4b8e961bf2709b0663fd9f2a">D0</a>);</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; w.s3 = <a class="code" href="optical__flow__pyramid__lk_8cl.xhtml#ae0b2360d4b8e961bf2709b0663fd9f2a">D0</a> - w.s0 - w.s1 - w.s2; <span class="comment">// Added for matching VX implementation</span></div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160;</div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160; <span class="comment">// G.s0 = A11, G.s1 = A12, G.s2 = A22, G.s3 = min_eig</span></div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; int4 iG = (int4)0;</div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160;</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; <span class="comment">// Window offset</span></div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160; <span class="keywordtype">int</span> window_offset = idx * window_dimension_pow2;</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160;</div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160; <span class="comment">// Compute Spatial Gradient Matrix G</span></div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; <span class="keywordflow">for</span>(ushort ky = 0; ky &lt; window_dimension; ++ky)</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; {</div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; <span class="keywordtype">int</span> offset_y = iold_keypoint.y + ky;</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; <span class="keywordflow">for</span>(ushort kx = 0; kx &lt; window_dimension; ++kx)</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; {</div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160; <span class="keywordtype">int</span> offset_x = iold_keypoint.x + kx;</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; float4 px;</div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160;</div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; <span class="comment">// Load values from old_image for computing the bilinear interpolation</span></div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160; px = convert_float4((uchar4)(vload2(0, <a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&amp;old_image, offset_x, offset_y)),</div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160; vload2(0, <a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&amp;old_image, offset_x, offset_y + 1))));</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160;</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; <span class="comment">// old_i.s0 = ival, old_i.s1 = ixval, old_i.s2 = iyval, old_i.s3 = dummy</span></div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; float4 old_i;</div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160;</div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; <span class="comment">// Compute bilinear interpolation (with D1 scale factor) for ival</span></div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160; old_i.s0 = dot(px, w) * <a class="code" href="optical__flow__pyramid__lk_8cl.xhtml#a52deba56234661c77d4b9573d5175ae2">D1</a>;</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160;</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; <span class="comment">// Load values from old_scharr_gx for computing the bilinear interpolation</span></div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160; px = convert_float4((short4)(vload2(0, (__global <span class="keywordtype">short</span> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&amp;old_scharr_gx, offset_x, offset_y)),</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160; vload2(0, (__global <span class="keywordtype">short</span> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&amp;old_scharr_gx, offset_x, offset_y + 1))));</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160;</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160; <span class="comment">// Compute bilinear interpolation for ixval</span></div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160; old_i.s1 = dot(px, w_scharr);</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160;</div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160; <span class="comment">// Load values from old_scharr_gy for computing the bilinear interpolation</span></div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160; px = convert_float4((short4)(vload2(0, (__global <span class="keywordtype">short</span> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&amp;old_scharr_gy, offset_x, offset_y)),</div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160; vload2(0, (__global <span class="keywordtype">short</span> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&amp;old_scharr_gy, offset_x, offset_y + 1))));</div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160;</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160; <span class="comment">// Compute bilinear interpolation for iyval</span></div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160; old_i.s2 = dot(px, w_scharr);</div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160;</div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160; <span class="comment">// Rounding (it could be omitted. Used just for matching the VX implementation)</span></div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160; int4 iold = convert_int4(<a class="code" href="namespacearm__compute_1_1support_1_1cpp11.xhtml#ab71c35ca207b916a9f8b0336ab88484e">round</a>(old_i));</div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160;</div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160; <span class="comment">// Accumulate values in the Spatial Gradient Matrix</span></div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160; iG.s0 += (int)(iold.s1 * iold.s1);</div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160; iG.s1 += (int)(iold.s1 * iold.s2);</div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160; iG.s2 += (int)(iold.s2 * iold.s2);</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160;</div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160; <span class="comment">// Store ival, ixval and iyval</span></div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160; iold_val[window_offset + kx] = convert_short4(iold);</div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160; }</div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160; window_offset += window_dimension;</div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160; }</div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160;</div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160; <span class="comment">// Scale iA11, iA12 and iA22</span></div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160; float4 <a class="code" href="namespacearm__compute.xhtml#a1ce9b523fd4f3b5bbcadcd796183455aadfcf28d0734569a6a693bc8194de62bf">G</a> = convert_float4(iG) * (float4)<a class="code" href="optical__flow__pyramid__lk_8cl.xhtml#a1852457538f524c42f96b66882bd9b35">FLT_SCALE</a>;</div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160;</div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>&#160; <span class="comment">// Compute minimum eigen value</span></div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160; G.s3 = (float)(G.s2 + G.s0 - sqrt(pown(G.s0 - G.s2, 2) + 4.0f * G.s1 * G.s1)) * eig_const;</div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>&#160;</div>
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>&#160; <span class="comment">// Store A11. A11, A22 and min_eig</span></div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>&#160; coeff[idx] = G;</div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>&#160;}</div>
<div class="ttc" id="optical__flow__pyramid__lk_8cl_xhtml_ae0b2360d4b8e961bf2709b0663fd9f2a"><div class="ttname"><a href="optical__flow__pyramid__lk_8cl.xhtml#ae0b2360d4b8e961bf2709b0663fd9f2a">D0</a></div><div class="ttdeci">#define D0</div><div class="ttdef"><b>Definition:</b> <a href="optical__flow__pyramid__lk_8cl_source.xhtml#l00059">optical_flow_pyramid_lk.cl:59</a></div></div>
<div class="ttc" id="helpers_8h_xhtml_a4334a4a76f8e9628c0fb9e1acf616e2a"><div class="ttname"><a href="helpers_8h.xhtml#a4334a4a76f8e9628c0fb9e1acf616e2a">CONVERT_TO_IMAGE_STRUCT_NO_STEP</a></div><div class="ttdeci">#define CONVERT_TO_IMAGE_STRUCT_NO_STEP(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00099">helpers.h:99</a></div></div>
<div class="ttc" id="helpers_8h_xhtml_a009469e4d9b8fce3b6d5e97d2077827d"><div class="ttname"><a href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a></div><div class="ttdeci">__global uchar * offset(const Image *img, int x, int y)</div><div class="ttdoc">Get the pointer position of a Image. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00295">helpers.h:295</a></div></div>
<div class="ttc" id="optical__flow__pyramid__lk_8cl_xhtml_a52deba56234661c77d4b9573d5175ae2"><div class="ttname"><a href="optical__flow__pyramid__lk_8cl.xhtml#a52deba56234661c77d4b9573d5175ae2">D1</a></div><div class="ttdeci">#define D1</div><div class="ttdef"><b>Definition:</b> <a href="optical__flow__pyramid__lk_8cl_source.xhtml#l00060">optical_flow_pyramid_lk.cl:60</a></div></div>
<div class="ttc" id="struct_image_xhtml"><div class="ttname"><a href="struct_image.xhtml">Image</a></div><div class="ttdoc">Structure to hold Image information. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00134">helpers.h:134</a></div></div>
<div class="ttc" id="optical__flow__pyramid__lk_8cl_xhtml_a1852457538f524c42f96b66882bd9b35"><div class="ttname"><a href="optical__flow__pyramid__lk_8cl.xhtml#a1852457538f524c42f96b66882bd9b35">FLT_SCALE</a></div><div class="ttdeci">#define FLT_SCALE</div><div class="ttdef"><b>Definition:</b> <a href="optical__flow__pyramid__lk_8cl_source.xhtml#l00058">optical_flow_pyramid_lk.cl:58</a></div></div>
<div class="ttc" id="namespacearm__compute_1_1support_1_1cpp11_xhtml_ab71c35ca207b916a9f8b0336ab88484e"><div class="ttname"><a href="namespacearm__compute_1_1support_1_1cpp11.xhtml#ab71c35ca207b916a9f8b0336ab88484e">arm_compute::support::cpp11::round</a></div><div class="ttdeci">T round(T value)</div><div class="ttdoc">Round floating-point value with half value rounding away from zero. </div><div class="ttdef"><b>Definition:</b> <a href="_toolchain_support_8h_source.xhtml#l00228">ToolchainSupport.h:228</a></div></div>
<div class="ttc" id="namespacearm__compute_xhtml_a1ce9b523fd4f3b5bbcadcd796183455aadfcf28d0734569a6a693bc8194de62bf"><div class="ttname"><a href="namespacearm__compute.xhtml#a1ce9b523fd4f3b5bbcadcd796183455aadfcf28d0734569a6a693bc8194de62bf">arm_compute::Channel::G</a></div><div class="ttdoc">Green channel. </div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a97401877f0071dbe2443c697b29d80e0"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void __kernel lktracker_stage1 </td>
<td>(</td>
<td class="paramtype">__global uchar *&#160;</td>
<td class="paramname"><em>new_image_ptr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint&#160;</td>
<td class="paramname"><em>new_image_stride_x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint&#160;</td>
<td class="paramname"><em>new_image_step_x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint&#160;</td>
<td class="paramname"><em>new_image_stride_y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint&#160;</td>
<td class="paramname"><em>new_image_step_y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint&#160;</td>
<td class="paramname"><em>new_image_offset_first_element_in_bytes</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">__global float4 *&#160;</td>
<td class="paramname"><em>new_points</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">__global float4 *&#160;</td>
<td class="paramname"><em>coeff</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">__global short4 *&#160;</td>
<td class="paramname"><em>iold_val</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const int&#160;</td>
<td class="paramname"><em>window_dimension</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const int&#160;</td>
<td class="paramname"><em>window_dimension_pow2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const int&#160;</td>
<td class="paramname"><em>half_window</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const int&#160;</td>
<td class="paramname"><em>num_iterations</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const float&#160;</td>
<td class="paramname"><em>epsilon</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const float3&#160;</td>
<td class="paramname"><em>border_limits</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const float&#160;</td>
<td class="paramname"><em>eig_const</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const int&#160;</td>
<td class="paramname"><em>level0</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const int&#160;</td>
<td class="paramname"><em>term_iteration</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const int&#160;</td>
<td class="paramname"><em>term_epsilon</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Computes the motion vector for a given keypoint. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">new_image_ptr</td><td>Pointer to the input new image. Supported data types: U8 </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">new_image_stride_x</td><td>Stride of the input new image in X dimension (in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">new_image_step_x</td><td>new_image_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">new_image_stride_y</td><td>Stride of the input new image in Y dimension (in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">new_image_step_y</td><td>new_image_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">new_image_offset_first_element_in_bytes</td><td>The offset of the first element in the input new image </td></tr>
<tr><td class="paramdir">[in,out]</td><td class="paramname">new_points</td><td>An output array of key points. Those key points are defined at the new_images high resolution pyramid </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">coeff</td><td>The | A11 | A12 | A22 | min_eig | for each keypoint </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">iold_val</td><td>The | ival | ixval | iyval | dummy | for each point in the window centered on old_keypoint </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">window_dimension</td><td>The size of the window on which to perform the algorithm </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">window_dimension_pow2</td><td>The squared size of the window on which to perform the algorithm </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">half_window</td><td>The half size of the window on which to perform the algorithm </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">num_iterations</td><td>The maximum number of iterations </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">epsilon</td><td>The value for terminating the algorithm. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">border_limits</td><td>It stores the right border limit (width - window_dimension - 1, height - window_dimension - 1,) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">eig_const</td><td>1.0f / (float)(2.0f * window_dimension * window_dimension) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">level0</td><td>It is set to 1 if level of pyramid = 0 </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">term_iteration</td><td>It is set to 1 if termination = VX_TERM_CRITERIA_ITERATIONS </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">term_epsilon</td><td>It is set to 1 if termination = VX_TERM_CRITERIA_EPSILON </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00358">358</a> of file <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml">optical_flow_pyramid_lk.cl</a>.</p>
<p>References <a class="el" href="helpers_8h_source.xhtml#l00099">CONVERT_TO_IMAGE_STRUCT_NO_STEP</a>, <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00059">D0</a>, <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00060">D1</a>, <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00051">DETERMINANT_THR</a>, <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00054">EIGENVALUE_THR</a>, <a class="el" href="optical__flow__pyramid__lk_8cl_source.xhtml#l00058">FLT_SCALE</a>, <a class="el" href="helpers_8h_source.xhtml#l00295">offset()</a>, and <a class="el" href="_toolchain_support_8h_source.xhtml#l00228">arm_compute::support::cpp11::round()</a>.</p>
<div class="fragment"><div class="line"><a name="l00373"></a><span class="lineno"> 373</span>&#160;{</div>
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>&#160; <span class="keywordtype">int</span> idx = get_global_id(0);</div>
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>&#160; <a class="code" href="struct_image.xhtml">Image</a> new_image = <a class="code" href="helpers_8h.xhtml#a4334a4a76f8e9628c0fb9e1acf616e2a">CONVERT_TO_IMAGE_STRUCT_NO_STEP</a>(new_image);</div>
<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>&#160;</div>
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>&#160; <span class="comment">// G.s0 = A11, G.s1 = A12, G.s2 = A22, G.s3 = min_eig</span></div>
<div class="line"><a name="l00378"></a><span class="lineno"> 378</span>&#160; float4 <a class="code" href="namespacearm__compute.xhtml#a1ce9b523fd4f3b5bbcadcd796183455aadfcf28d0734569a6a693bc8194de62bf">G</a> = coeff[idx];</div>
<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>&#160;</div>
<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>&#160; <span class="comment">// Determinant</span></div>
<div class="line"><a name="l00381"></a><span class="lineno"> 381</span>&#160; <span class="keywordtype">float</span> D = G.s0 * G.s2 - G.s1 * G.s1;</div>
<div class="line"><a name="l00382"></a><span class="lineno"> 382</span>&#160;</div>
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>&#160; <span class="comment">// Check if it is a good point to track</span></div>
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>&#160; <span class="keywordflow">if</span>(G.s3 &lt; <a class="code" href="optical__flow__pyramid__lk_8cl.xhtml#a3955a0fbedb5b3eae9a38801fb01bac5">EIGENVALUE_THR</a> || D &lt; <a class="code" href="optical__flow__pyramid__lk_8cl.xhtml#a0f3927d942874a04e6464bdb946de046">DETERMINANT_THR</a>)</div>
<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>&#160; {</div>
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>&#160; <span class="keywordflow">if</span>(level0 == 1)</div>
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>&#160; {</div>
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>&#160; <span class="comment">// Invalidate tracked point as we are at level 0</span></div>
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>&#160; new_points[idx].s2 = 0;</div>
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span>&#160; }</div>
<div class="line"><a name="l00391"></a><span class="lineno"> 391</span>&#160;</div>
<div class="line"><a name="l00392"></a><span class="lineno"> 392</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>&#160; }</div>
<div class="line"><a name="l00394"></a><span class="lineno"> 394</span>&#160;</div>
<div class="line"><a name="l00395"></a><span class="lineno"> 395</span>&#160; <span class="comment">// Compute inverse</span></div>
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span>&#160; <span class="comment">//D = native_recip(D);</span></div>
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>&#160; D = 1.0 / D;</div>
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>&#160;</div>
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>&#160; <span class="comment">// Get new keypoint</span></div>
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>&#160; float2 new_keypoint = new_points[idx].xy - (float)half_window;</div>
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>&#160;</div>
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>&#160; <span class="comment">// Get new point</span></div>
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>&#160; float2 out_new_point = new_points[idx].xy;</div>
<div class="line"><a name="l00404"></a><span class="lineno"> 404</span>&#160;</div>
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span>&#160; <span class="comment">// Keep delta obtained in the previous iteration</span></div>
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span>&#160; float2 prev_delta = (float2)0.0f;</div>
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>&#160;</div>
<div class="line"><a name="l00408"></a><span class="lineno"> 408</span>&#160; <span class="keywordtype">int</span> j = 0;</div>
<div class="line"><a name="l00409"></a><span class="lineno"> 409</span>&#160; <span class="keywordflow">while</span>(j &lt; num_iterations)</div>
<div class="line"><a name="l00410"></a><span class="lineno"> 410</span>&#160; {</div>
<div class="line"><a name="l00411"></a><span class="lineno"> 411</span>&#160; <span class="comment">// Get the floor value</span></div>
<div class="line"><a name="l00412"></a><span class="lineno"> 412</span>&#160; float2 inew_keypoint = floor(new_keypoint);</div>
<div class="line"><a name="l00413"></a><span class="lineno"> 413</span>&#160;</div>
<div class="line"><a name="l00414"></a><span class="lineno"> 414</span>&#160; <span class="comment">// Check if using the window dimension we can go out of boundary in the following for loops. If so, invalidate the tracked point</span></div>
<div class="line"><a name="l00415"></a><span class="lineno"> 415</span>&#160; <span class="keywordflow">if</span>(any(inew_keypoint &lt; border_limits.zz) || any(inew_keypoint &gt;= border_limits.xy))</div>
<div class="line"><a name="l00416"></a><span class="lineno"> 416</span>&#160; {</div>
<div class="line"><a name="l00417"></a><span class="lineno"> 417</span>&#160; <span class="keywordflow">if</span>(level0 == 1)</div>
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>&#160; {</div>
<div class="line"><a name="l00419"></a><span class="lineno"> 419</span>&#160; <span class="comment">// Invalidate tracked point as we are at level 0</span></div>
<div class="line"><a name="l00420"></a><span class="lineno"> 420</span>&#160; new_points[idx].s2 = 0.0f;</div>
<div class="line"><a name="l00421"></a><span class="lineno"> 421</span>&#160; }</div>
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span>&#160; <span class="keywordflow">else</span></div>
<div class="line"><a name="l00423"></a><span class="lineno"> 423</span>&#160; {</div>
<div class="line"><a name="l00424"></a><span class="lineno"> 424</span>&#160; new_points[idx].xy = out_new_point;</div>
<div class="line"><a name="l00425"></a><span class="lineno"> 425</span>&#160; }</div>
<div class="line"><a name="l00426"></a><span class="lineno"> 426</span>&#160;</div>
<div class="line"><a name="l00427"></a><span class="lineno"> 427</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00428"></a><span class="lineno"> 428</span>&#160; }</div>
<div class="line"><a name="l00429"></a><span class="lineno"> 429</span>&#160;</div>
<div class="line"><a name="l00430"></a><span class="lineno"> 430</span>&#160; <span class="comment">// Compute weight for the bilinear interpolation</span></div>
<div class="line"><a name="l00431"></a><span class="lineno"> 431</span>&#160; float2 ab = new_keypoint - inew_keypoint;</div>
<div class="line"><a name="l00432"></a><span class="lineno"> 432</span>&#160;</div>
<div class="line"><a name="l00433"></a><span class="lineno"> 433</span>&#160; <span class="comment">// Weight used for Bilinear-Interpolation on Old and New images</span></div>
<div class="line"><a name="l00434"></a><span class="lineno"> 434</span>&#160; <span class="comment">// w.s0 = round((1.0f - ab.x) * (1.0f - ab.y) * D0)</span></div>
<div class="line"><a name="l00435"></a><span class="lineno"> 435</span>&#160; <span class="comment">// w.s1 = round(ab.x * (1.0f - ab.y) * D0)</span></div>
<div class="line"><a name="l00436"></a><span class="lineno"> 436</span>&#160; <span class="comment">// w.s2 = round((1.0f - ab.x) * ab.y * D0)</span></div>
<div class="line"><a name="l00437"></a><span class="lineno"> 437</span>&#160; <span class="comment">// w.s3 = D0 - w.s0 - w.s1 - w.s2</span></div>
<div class="line"><a name="l00438"></a><span class="lineno"> 438</span>&#160;</div>
<div class="line"><a name="l00439"></a><span class="lineno"> 439</span>&#160; float4 w;</div>
<div class="line"><a name="l00440"></a><span class="lineno"> 440</span>&#160; w.s3 = ab.x * ab.y;</div>
<div class="line"><a name="l00441"></a><span class="lineno"> 441</span>&#160; w.s0 = w.s3 + 1.0f - ab.x - ab.y;</div>
<div class="line"><a name="l00442"></a><span class="lineno"> 442</span>&#160; w.s12 = ab - (float2)w.s3;</div>
<div class="line"><a name="l00443"></a><span class="lineno"> 443</span>&#160; w = <a class="code" href="namespacearm__compute_1_1support_1_1cpp11.xhtml#ab71c35ca207b916a9f8b0336ab88484e">round</a>(w * (float4)<a class="code" href="optical__flow__pyramid__lk_8cl.xhtml#ae0b2360d4b8e961bf2709b0663fd9f2a">D0</a>);</div>
<div class="line"><a name="l00444"></a><span class="lineno"> 444</span>&#160; w.s3 = <a class="code" href="optical__flow__pyramid__lk_8cl.xhtml#ae0b2360d4b8e961bf2709b0663fd9f2a">D0</a> - w.s0 - w.s1 - w.s2;</div>
<div class="line"><a name="l00445"></a><span class="lineno"> 445</span>&#160;</div>
<div class="line"><a name="l00446"></a><span class="lineno"> 446</span>&#160; <span class="comment">// Mismatch vector</span></div>
<div class="line"><a name="l00447"></a><span class="lineno"> 447</span>&#160; int2 ib = 0;</div>
<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>&#160;</div>
<div class="line"><a name="l00449"></a><span class="lineno"> 449</span>&#160; <span class="comment">// Old val offset</span></div>
<div class="line"><a name="l00450"></a><span class="lineno"> 450</span>&#160; <span class="keywordtype">int</span> old_val_offset = idx * window_dimension_pow2;</div>
<div class="line"><a name="l00451"></a><span class="lineno"> 451</span>&#160;</div>
<div class="line"><a name="l00452"></a><span class="lineno"> 452</span>&#160; <span class="keywordflow">for</span>(<span class="keywordtype">int</span> ky = 0; ky &lt; window_dimension; ++ky)</div>
<div class="line"><a name="l00453"></a><span class="lineno"> 453</span>&#160; {</div>
<div class="line"><a name="l00454"></a><span class="lineno"> 454</span>&#160; <span class="keywordflow">for</span>(<span class="keywordtype">int</span> kx = 0; kx &lt; window_dimension; ++kx)</div>
<div class="line"><a name="l00455"></a><span class="lineno"> 455</span>&#160; {</div>
<div class="line"><a name="l00456"></a><span class="lineno"> 456</span>&#160; <span class="comment">// ival, ixval and iyval have been computed in the previous stage</span></div>
<div class="line"><a name="l00457"></a><span class="lineno"> 457</span>&#160; int4 old_ival = convert_int4(iold_val[old_val_offset]);</div>
<div class="line"><a name="l00458"></a><span class="lineno"> 458</span>&#160;</div>
<div class="line"><a name="l00459"></a><span class="lineno"> 459</span>&#160; <span class="comment">// Load values from old_image for computing the bilinear interpolation</span></div>
<div class="line"><a name="l00460"></a><span class="lineno"> 460</span>&#160; float4 px = convert_float4((uchar4)(vload2(0, <a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&amp;new_image, inew_keypoint.x + kx, inew_keypoint.y + ky)),</div>
<div class="line"><a name="l00461"></a><span class="lineno"> 461</span>&#160; vload2(0, <a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&amp;new_image, inew_keypoint.x + kx, inew_keypoint.y + ky + 1))));</div>
<div class="line"><a name="l00462"></a><span class="lineno"> 462</span>&#160;</div>
<div class="line"><a name="l00463"></a><span class="lineno"> 463</span>&#160; <span class="comment">// Compute bilinear interpolation on new image</span></div>
<div class="line"><a name="l00464"></a><span class="lineno"> 464</span>&#160; <span class="keywordtype">int</span> jval = (int)<a class="code" href="namespacearm__compute_1_1support_1_1cpp11.xhtml#ab71c35ca207b916a9f8b0336ab88484e">round</a>(dot(px, w) * <a class="code" href="optical__flow__pyramid__lk_8cl.xhtml#a52deba56234661c77d4b9573d5175ae2">D1</a>);</div>
<div class="line"><a name="l00465"></a><span class="lineno"> 465</span>&#160;</div>
<div class="line"><a name="l00466"></a><span class="lineno"> 466</span>&#160; <span class="comment">// Compute luminance difference</span></div>
<div class="line"><a name="l00467"></a><span class="lineno"> 467</span>&#160; <span class="keywordtype">int</span> diff = (int)(jval - old_ival.s0);</div>
<div class="line"><a name="l00468"></a><span class="lineno"> 468</span>&#160;</div>
<div class="line"><a name="l00469"></a><span class="lineno"> 469</span>&#160; <span class="comment">// Accumulate values in mismatch vector</span></div>
<div class="line"><a name="l00470"></a><span class="lineno"> 470</span>&#160; ib += (diff * old_ival.s12);</div>
<div class="line"><a name="l00471"></a><span class="lineno"> 471</span>&#160;</div>
<div class="line"><a name="l00472"></a><span class="lineno"> 472</span>&#160; <span class="comment">// Update old val offset</span></div>
<div class="line"><a name="l00473"></a><span class="lineno"> 473</span>&#160; old_val_offset++;</div>
<div class="line"><a name="l00474"></a><span class="lineno"> 474</span>&#160; }</div>
<div class="line"><a name="l00475"></a><span class="lineno"> 475</span>&#160; }</div>
<div class="line"><a name="l00476"></a><span class="lineno"> 476</span>&#160;</div>
<div class="line"><a name="l00477"></a><span class="lineno"> 477</span>&#160; float2 b = convert_float2(ib) * (float2)<a class="code" href="optical__flow__pyramid__lk_8cl.xhtml#a1852457538f524c42f96b66882bd9b35">FLT_SCALE</a>;</div>
<div class="line"><a name="l00478"></a><span class="lineno"> 478</span>&#160;</div>
<div class="line"><a name="l00479"></a><span class="lineno"> 479</span>&#160; <span class="comment">// Optical Flow</span></div>
<div class="line"><a name="l00480"></a><span class="lineno"> 480</span>&#160; float2 delta;</div>
<div class="line"><a name="l00481"></a><span class="lineno"> 481</span>&#160;</div>
<div class="line"><a name="l00482"></a><span class="lineno"> 482</span>&#160; delta.x = (float)((G.s1 * b.y - G.s2 * b.x) * D);</div>
<div class="line"><a name="l00483"></a><span class="lineno"> 483</span>&#160; delta.y = (float)((G.s1 * b.x - G.s0 * b.y) * D);</div>
<div class="line"><a name="l00484"></a><span class="lineno"> 484</span>&#160;</div>
<div class="line"><a name="l00485"></a><span class="lineno"> 485</span>&#160; <span class="comment">// Update new point coordinate</span></div>
<div class="line"><a name="l00486"></a><span class="lineno"> 486</span>&#160; new_keypoint += delta;</div>
<div class="line"><a name="l00487"></a><span class="lineno"> 487</span>&#160;</div>
<div class="line"><a name="l00488"></a><span class="lineno"> 488</span>&#160; out_new_point = new_keypoint + (float2)half_window;</div>
<div class="line"><a name="l00489"></a><span class="lineno"> 489</span>&#160;</div>
<div class="line"><a name="l00490"></a><span class="lineno"> 490</span>&#160; <span class="keywordflow">if</span>(term_epsilon == 1)</div>
<div class="line"><a name="l00491"></a><span class="lineno"> 491</span>&#160; {</div>
<div class="line"><a name="l00492"></a><span class="lineno"> 492</span>&#160; <span class="keywordtype">float</span> mag2 = dot(delta, delta);</div>
<div class="line"><a name="l00493"></a><span class="lineno"> 493</span>&#160;</div>
<div class="line"><a name="l00494"></a><span class="lineno"> 494</span>&#160; <span class="keywordflow">if</span>(mag2 &lt;= epsilon)</div>
<div class="line"><a name="l00495"></a><span class="lineno"> 495</span>&#160; {</div>
<div class="line"><a name="l00496"></a><span class="lineno"> 496</span>&#160; new_points[idx].xy = out_new_point;</div>
<div class="line"><a name="l00497"></a><span class="lineno"> 497</span>&#160;</div>
<div class="line"><a name="l00498"></a><span class="lineno"> 498</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00499"></a><span class="lineno"> 499</span>&#160; }</div>
<div class="line"><a name="l00500"></a><span class="lineno"> 500</span>&#160; }</div>
<div class="line"><a name="l00501"></a><span class="lineno"> 501</span>&#160;</div>
<div class="line"><a name="l00502"></a><span class="lineno"> 502</span>&#160; <span class="comment">// Check convergence analyzing the previous delta</span></div>
<div class="line"><a name="l00503"></a><span class="lineno"> 503</span>&#160; <span class="keywordflow">if</span>(j &gt; 0 &amp;&amp; all(fabs(delta + prev_delta) &lt; (float2)0.01f))</div>
<div class="line"><a name="l00504"></a><span class="lineno"> 504</span>&#160; {</div>
<div class="line"><a name="l00505"></a><span class="lineno"> 505</span>&#160; out_new_point -= delta * (float2)0.5f;</div>
<div class="line"><a name="l00506"></a><span class="lineno"> 506</span>&#160;</div>
<div class="line"><a name="l00507"></a><span class="lineno"> 507</span>&#160; new_points[idx].xy = out_new_point;</div>
<div class="line"><a name="l00508"></a><span class="lineno"> 508</span>&#160;</div>
<div class="line"><a name="l00509"></a><span class="lineno"> 509</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00510"></a><span class="lineno"> 510</span>&#160; }</div>
<div class="line"><a name="l00511"></a><span class="lineno"> 511</span>&#160;</div>
<div class="line"><a name="l00512"></a><span class="lineno"> 512</span>&#160; <span class="comment">// Update previous delta</span></div>
<div class="line"><a name="l00513"></a><span class="lineno"> 513</span>&#160; prev_delta = delta;</div>
<div class="line"><a name="l00514"></a><span class="lineno"> 514</span>&#160;</div>
<div class="line"><a name="l00515"></a><span class="lineno"> 515</span>&#160; <span class="keywordflow">if</span>(term_iteration == 1)</div>
<div class="line"><a name="l00516"></a><span class="lineno"> 516</span>&#160; {</div>
<div class="line"><a name="l00517"></a><span class="lineno"> 517</span>&#160; j++;</div>
<div class="line"><a name="l00518"></a><span class="lineno"> 518</span>&#160; }</div>
<div class="line"><a name="l00519"></a><span class="lineno"> 519</span>&#160; }</div>
<div class="line"><a name="l00520"></a><span class="lineno"> 520</span>&#160;</div>
<div class="line"><a name="l00521"></a><span class="lineno"> 521</span>&#160; new_points[idx].xy = out_new_point;</div>
<div class="line"><a name="l00522"></a><span class="lineno"> 522</span>&#160;}</div>
<div class="ttc" id="optical__flow__pyramid__lk_8cl_xhtml_ae0b2360d4b8e961bf2709b0663fd9f2a"><div class="ttname"><a href="optical__flow__pyramid__lk_8cl.xhtml#ae0b2360d4b8e961bf2709b0663fd9f2a">D0</a></div><div class="ttdeci">#define D0</div><div class="ttdef"><b>Definition:</b> <a href="optical__flow__pyramid__lk_8cl_source.xhtml#l00059">optical_flow_pyramid_lk.cl:59</a></div></div>
<div class="ttc" id="helpers_8h_xhtml_a4334a4a76f8e9628c0fb9e1acf616e2a"><div class="ttname"><a href="helpers_8h.xhtml#a4334a4a76f8e9628c0fb9e1acf616e2a">CONVERT_TO_IMAGE_STRUCT_NO_STEP</a></div><div class="ttdeci">#define CONVERT_TO_IMAGE_STRUCT_NO_STEP(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00099">helpers.h:99</a></div></div>
<div class="ttc" id="optical__flow__pyramid__lk_8cl_xhtml_a3955a0fbedb5b3eae9a38801fb01bac5"><div class="ttname"><a href="optical__flow__pyramid__lk_8cl.xhtml#a3955a0fbedb5b3eae9a38801fb01bac5">EIGENVALUE_THR</a></div><div class="ttdeci">#define EIGENVALUE_THR</div><div class="ttdoc">Thresholds for minimum eigenvalue. </div><div class="ttdef"><b>Definition:</b> <a href="optical__flow__pyramid__lk_8cl_source.xhtml#l00054">optical_flow_pyramid_lk.cl:54</a></div></div>
<div class="ttc" id="optical__flow__pyramid__lk_8cl_xhtml_a0f3927d942874a04e6464bdb946de046"><div class="ttname"><a href="optical__flow__pyramid__lk_8cl.xhtml#a0f3927d942874a04e6464bdb946de046">DETERMINANT_THR</a></div><div class="ttdeci">#define DETERMINANT_THR</div><div class="ttdoc">Threshold for the determinant. </div><div class="ttdef"><b>Definition:</b> <a href="optical__flow__pyramid__lk_8cl_source.xhtml#l00051">optical_flow_pyramid_lk.cl:51</a></div></div>
<div class="ttc" id="helpers_8h_xhtml_a009469e4d9b8fce3b6d5e97d2077827d"><div class="ttname"><a href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a></div><div class="ttdeci">__global uchar * offset(const Image *img, int x, int y)</div><div class="ttdoc">Get the pointer position of a Image. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00295">helpers.h:295</a></div></div>
<div class="ttc" id="optical__flow__pyramid__lk_8cl_xhtml_a52deba56234661c77d4b9573d5175ae2"><div class="ttname"><a href="optical__flow__pyramid__lk_8cl.xhtml#a52deba56234661c77d4b9573d5175ae2">D1</a></div><div class="ttdeci">#define D1</div><div class="ttdef"><b>Definition:</b> <a href="optical__flow__pyramid__lk_8cl_source.xhtml#l00060">optical_flow_pyramid_lk.cl:60</a></div></div>
<div class="ttc" id="struct_image_xhtml"><div class="ttname"><a href="struct_image.xhtml">Image</a></div><div class="ttdoc">Structure to hold Image information. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00134">helpers.h:134</a></div></div>
<div class="ttc" id="optical__flow__pyramid__lk_8cl_xhtml_a1852457538f524c42f96b66882bd9b35"><div class="ttname"><a href="optical__flow__pyramid__lk_8cl.xhtml#a1852457538f524c42f96b66882bd9b35">FLT_SCALE</a></div><div class="ttdeci">#define FLT_SCALE</div><div class="ttdef"><b>Definition:</b> <a href="optical__flow__pyramid__lk_8cl_source.xhtml#l00058">optical_flow_pyramid_lk.cl:58</a></div></div>
<div class="ttc" id="namespacearm__compute_1_1support_1_1cpp11_xhtml_ab71c35ca207b916a9f8b0336ab88484e"><div class="ttname"><a href="namespacearm__compute_1_1support_1_1cpp11.xhtml#ab71c35ca207b916a9f8b0336ab88484e">arm_compute::support::cpp11::round</a></div><div class="ttdeci">T round(T value)</div><div class="ttdoc">Round floating-point value with half value rounding away from zero. </div><div class="ttdef"><b>Definition:</b> <a href="_toolchain_support_8h_source.xhtml#l00228">ToolchainSupport.h:228</a></div></div>
<div class="ttc" id="namespacearm__compute_xhtml_a1ce9b523fd4f3b5bbcadcd796183455aadfcf28d0734569a6a693bc8194de62bf"><div class="ttname"><a href="namespacearm__compute.xhtml#a1ce9b523fd4f3b5bbcadcd796183455aadfcf28d0734569a6a693bc8194de62bf">arm_compute::Channel::G</a></div><div class="ttdoc">Green channel. </div></div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_55b5a5006e943fb664ff8cff3cfe7768.xhtml">src</a></li><li class="navelem"><a class="el" href="dir_f6c3ae42d7e27145d0a3c3e38ca1c000.xhtml">core</a></li><li class="navelem"><a class="el" href="dir_1b7ae9123c88e650426d50d95c19d414.xhtml">CL</a></li><li class="navelem"><a class="el" href="dir_b7c3d80b0dadb2139bc73b7161751c12.xhtml">cl_kernels</a></li><li class="navelem"><a class="el" href="optical__flow__pyramid__lk_8cl.xhtml">optical_flow_pyramid_lk.cl</a></li>
<li class="footer">Generated on Thu Oct 12 2017 14:26:35 for Compute Library by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
</ul>
</div>
</body>
</html>