From 6c6597c1e17c32c6ad861780eee454a7deecfb75 Mon Sep 17 00:00:00 2001 From: Moritz Pflanzer Date: Sun, 24 Sep 2017 12:09:41 +0100 Subject: COMPMID-500: Move HarrisCorners to new validation Change-Id: I4e21ad98d029e360010c5927f04b716527700a00 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/88888 Reviewed-by: Anthony Barbier Tested-by: Kaizen --- tests/validation/Helpers.h | 56 +++++++++++++--------------------------------- 1 file changed, 15 insertions(+), 41 deletions(-) (limited to 'tests/validation/Helpers.h') diff --git a/tests/validation/Helpers.h b/tests/validation/Helpers.h index 30c67245a2..eecf976a13 100644 --- a/tests/validation/Helpers.h +++ b/tests/validation/Helpers.h @@ -26,7 +26,9 @@ #include "arm_compute/core/Types.h" #include "arm_compute/core/Utils.h" +#include "support/Half.h" #include "tests/Globals.h" +#include "tests/SimpleTensor.h" #include #include @@ -136,47 +138,7 @@ std::pair get_activation_layer_test_bounds(ActivationLayerInfo::Activation * @param[in] rows Rows (height) of mask * @param[in] pattern Pattern to fill the mask according to */ -inline void fill_mask_from_pattern(uint8_t *mask, int cols, int rows, MatrixPattern pattern) -{ - unsigned int v = 0; - std::mt19937 gen(library->seed()); - std::bernoulli_distribution dist(0.5); - - for(int r = 0; r < rows; ++r) - { - for(int c = 0; c < cols; ++c, ++v) - { - uint8_t val = 0; - - switch(pattern) - { - case MatrixPattern::BOX: - val = 255; - break; - case MatrixPattern::CROSS: - val = ((r == (rows / 2)) || (c == (cols / 2))) ? 255 : 0; - break; - case MatrixPattern::DISK: - val = (((r - rows / 2.0f + 0.5f) * (r - rows / 2.0f + 0.5f)) / ((rows / 2.0f) * (rows / 2.0f)) + ((c - cols / 2.0f + 0.5f) * (c - cols / 2.0f + 0.5f)) / ((cols / 2.0f) * - (cols / 2.0f))) <= 1.0f ? 255 : 0; - break; - case MatrixPattern::OTHER: - val = (dist(gen) ? 0 : 255); - break; - default: - return; - } - - mask[v] = val; - } - } - - if(pattern == MatrixPattern::OTHER) - { - std::uniform_int_distribution distribution_u8(0, ((cols * rows) - 1)); - mask[distribution_u8(gen)] = 255; - } -} +void fill_mask_from_pattern(uint8_t *mask, int cols, int rows, MatrixPattern pattern); /** Calculate output tensor shape give a vector of input tensor to concatenate * @@ -186,6 +148,18 @@ inline void fill_mask_from_pattern(uint8_t *mask, int cols, int rows, MatrixPatt */ TensorShape calculate_depth_concatenate_shape(const std::vector &input_shapes); +/** Parameters of Harris Corners algorithm. */ +struct HarrisCornersParameters +{ + float threshold{ 0.f }; + float sensitivity{ 0.f }; + float min_dist{ 0.f }; + uint8_t constant_border_value{ 0 }; +}; + +/** Generate parameters for Harris Corners algorithm. */ +HarrisCornersParameters harris_corners_parameters(); + /** Helper function to fill the Lut random by a ILutAccessor. * * @param[in,out] table Accessor at the Lut. -- cgit v1.2.1