aboutsummaryrefslogtreecommitdiff
path: root/src/core/NEON/kernels/NELKTrackerKernel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/NEON/kernels/NELKTrackerKernel.cpp')
-rw-r--r--src/core/NEON/kernels/NELKTrackerKernel.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/NEON/kernels/NELKTrackerKernel.cpp b/src/core/NEON/kernels/NELKTrackerKernel.cpp
index 004ecd07ef..83593e7f0d 100644
--- a/src/core/NEON/kernels/NELKTrackerKernel.cpp
+++ b/src/core/NEON/kernels/NELKTrackerKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -356,13 +356,16 @@ void NELKTrackerKernel::configure(const ITensor *input_old, const ITensor *input
_termination = termination;
_use_initial_estimate = use_initial_estimate;
_epsilon = epsilon;
- _num_iterations = num_iterations;
_window_dimension = window_dimension;
_level = level;
_num_levels = num_levels;
_pyramid_scale = pyramid_scale;
_num_levels = num_levels;
+ // Set maximum number of iterations used for convergence
+ const size_t max_iterations = 1000;
+ _num_iterations = (termination == Termination::TERM_CRITERIA_EPSILON) ? max_iterations : num_iterations;
+
Window window;
window.set(Window::DimX, Window::Dimension(0, old_points->num_values()));
window.set(Window::DimY, Window::Dimension(0, 1));
@@ -471,7 +474,7 @@ void NELKTrackerKernel::run(const Window &window, const ThreadInfo &info)
float prev_delta_x = 0.0f;
float prev_delta_y = 0.0f;
- for(unsigned int j = 0; j < _num_iterations || _termination == Termination::TERM_CRITERIA_EPSILON; ++j)
+ for(unsigned int j = 0; j < _num_iterations; ++j)
{
if(is_invalid_keypoint(new_keypoint))
{