diff options
author | Moritz Pflanzer <moritz.pflanzer@arm.com> | 2017-09-24 12:09:41 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:35:24 +0000 |
commit | 6c6597c1e17c32c6ad861780eee454a7deecfb75 (patch) | |
tree | 5df015557262a83e5e84a5fa365544bb1aa66762 /tests/validation/Helpers.h | |
parent | c26ecf8ca13205cab2ce43d9f971e1569808e5bc (diff) | |
download | ComputeLibrary-6c6597c1e17c32c6ad861780eee454a7deecfb75.tar.gz |
COMPMID-500: Move HarrisCorners to new validation
Change-Id: I4e21ad98d029e360010c5927f04b716527700a00
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/88888
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Diffstat (limited to 'tests/validation/Helpers.h')
-rw-r--r-- | tests/validation/Helpers.h | 56 |
1 files changed, 15 insertions, 41 deletions
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 <random> #include <type_traits> @@ -136,47 +138,7 @@ std::pair<T, T> 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<uint8_t> 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<TensorShape> &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. |