aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/CL/functions/CLHarrisCorners.cpp
diff options
context:
space:
mode:
authorGiorgio Arena <giorgio.arena@arm.com>2017-06-27 17:26:37 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:35:24 +0000
commitfc2817dc0436ef2d5064df0a061aafd3d324d894 (patch)
tree26dd232132dbe61d79ad627236b42438c2e3cc7b /src/runtime/CL/functions/CLHarrisCorners.cpp
parentbbd9fb95daa08d6da67c567b40ca2cd032f7a2d3 (diff)
downloadComputeLibrary-fc2817dc0436ef2d5064df0a061aafd3d324d894.tar.gz
COMPMID-424 NEON/CL Harris Corners validation tests.
Change-Id: I82d2a73f515a8d45d16b9ddb702fea51ae05c82e Reviewed-on: http://mpd-gerrit.cambridge.arm.com/79687 Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Moritz Pflanzer <moritz.pflanzer@arm.com>
Diffstat (limited to 'src/runtime/CL/functions/CLHarrisCorners.cpp')
-rw-r--r--src/runtime/CL/functions/CLHarrisCorners.cpp29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/runtime/CL/functions/CLHarrisCorners.cpp b/src/runtime/CL/functions/CLHarrisCorners.cpp
index 87d573a7ad..8f9fcdc58f 100644
--- a/src/runtime/CL/functions/CLHarrisCorners.cpp
+++ b/src/runtime/CL/functions/CLHarrisCorners.cpp
@@ -42,8 +42,20 @@
using namespace arm_compute;
-CLHarrisCorners::CLHarrisCorners()
- : _sobel(), _harris_score(), _non_max_suppr(), _candidates(), _sort_euclidean(), _border_gx(), _border_gy(), _gx(), _gy(), _score(), _nonmax(), _corners_list(), _num_corner_candidates(0),
+CLHarrisCorners::CLHarrisCorners() // NOLINT
+ : _sobel(nullptr),
+ _harris_score(),
+ _non_max_suppr(),
+ _candidates(),
+ _sort_euclidean(),
+ _border_gx(),
+ _border_gy(),
+ _gx(),
+ _gy(),
+ _score(),
+ _nonmax(),
+ _corners_list(nullptr),
+ _num_corner_candidates(0),
_corners(nullptr)
{
}
@@ -62,6 +74,7 @@ void CLHarrisCorners::configure(ICLImage *input, float threshold, float min_dist
const TensorShape shape = input->info()->tensor_shape();
const DataType dt = (gradient_size < 7) ? DataType::S16 : DataType::S32;
TensorInfo tensor_info(shape, 1, dt);
+
_gx.allocator()->init(tensor_info);
_gy.allocator()->init(tensor_info);
@@ -99,10 +112,6 @@ void CLHarrisCorners::configure(ICLImage *input, float threshold, float min_dist
ARM_COMPUTE_ERROR("Gradient size not implemented");
}
- // Configure border filling before harris score
- _border_gx.configure(&_gx, BorderSize(block_size / 2), border_mode, constant_border_value);
- _border_gy.configure(&_gy, BorderSize(block_size / 2), border_mode, constant_border_value);
-
// Normalization factor
const float norm_factor = 1.0f / (255.0f * pow(4.0f, gradient_size / 2) * block_size);
const float pow4_normalization_factor = pow(norm_factor, 4);
@@ -110,8 +119,12 @@ void CLHarrisCorners::configure(ICLImage *input, float threshold, float min_dist
// Set/init Harris Score kernel accordingly with block_size
_harris_score.configure(&_gx, &_gy, &_score, block_size, pow4_normalization_factor, threshold, sensitivity, border_mode == BorderMode::UNDEFINED);
+ // Configure border filling using harris score kernel's block size
+ _border_gx.configure(&_gx, _harris_score.border_size(), border_mode, PixelValue(constant_border_value));
+ _border_gy.configure(&_gy, _harris_score.border_size(), border_mode, PixelValue(constant_border_value));
+
// Init non-maxima suppression function
- _non_max_suppr.configure(&_score, &_nonmax, border_mode == BorderMode::UNDEFINED);
+ _non_max_suppr.configure(&_score, &_nonmax, border_mode);
// Init corner candidates kernel
_candidates.configure(&_nonmax, _corners_list.get(), &_num_corner_candidates);
@@ -144,7 +157,7 @@ void CLHarrisCorners::run()
CLScheduler::get().enqueue(_harris_score, false);
// Run non-maxima suppression
- CLScheduler::get().enqueue(_non_max_suppr);
+ _non_max_suppr.run();
// Run corner candidate kernel
_nonmax.map(true);