diff options
author | John Richardson <john.richardson@arm.com> | 2017-09-05 11:21:56 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:35:24 +0000 |
commit | f89a49f7bdd8d03400060488596c8757745e19cf (patch) | |
tree | 7e98eb703794e2bce9b9f2fbcbfc9c29714cf8fe /tests/validation_old/TensorOperations.h | |
parent | f3aeee133c1c9c98c6828e935cf4f9801fbda9e1 (diff) | |
download | ComputeLibrary-f89a49f7bdd8d03400060488596c8757745e19cf.tar.gz |
COMPMID-503: Move MinMaxLocation to new validation
Change-Id: I2d518b3a3f15e2c4786488593dac244c1d74a0f9
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/86533
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Moritz Pflanzer <moritz.pflanzer@arm.com>
Diffstat (limited to 'tests/validation_old/TensorOperations.h')
-rw-r--r-- | tests/validation_old/TensorOperations.h | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/tests/validation_old/TensorOperations.h b/tests/validation_old/TensorOperations.h index 04a79f0de3..af17ea8dfd 100644 --- a/tests/validation_old/TensorOperations.h +++ b/tests/validation_old/TensorOperations.h @@ -406,72 +406,6 @@ void harris_corners(Tensor<T1> &in, Tensor<T2> &Gx, Tensor<T2> &Gy, Tensor<T3> & } } -template <typename T> -void compute_min_max(const Tensor<T> &in, void *min, void *max) -{ - using type = typename std::conditional<std::is_same<T, float>::value, float, int32_t>::type; - - // Set min and max to first pixel - type tmp_min = static_cast<type>(in[0]); - type tmp_max = static_cast<type>(in[0]); - - // Look for min and max values - for(int i = 1; i < in.num_elements(); ++i) - { - if(static_cast<type>(in[i]) < tmp_min) - { - tmp_min = static_cast<type>(in[i]); - } - if(static_cast<type>(in[i]) > tmp_max) - { - tmp_max = static_cast<type>(in[i]); - } - } - - *static_cast<type *>(min) = tmp_min; - *static_cast<type *>(max) = tmp_max; -} - -// Min max location -template <typename T1> -void min_max_location(const Tensor<T1> &in, void *min, void *max, IArray<Coordinates2D> &min_loc, IArray<Coordinates2D> &max_loc, uint32_t &min_count, uint32_t &max_count) -{ - const size_t width = in.shape().x(); - - compute_min_max(in, min, max); - - using type = typename std::conditional<std::is_same<T1, float>::value, float, int32_t>::type; - - type min_value = *static_cast<type *>(min); - type max_value = *static_cast<type *>(max); - - min_count = 0; - max_count = 0; - for(int i = 0; i < in.num_elements(); ++i) - { - if(static_cast<type>(in[i]) == min_value) - { - Coordinates2D min_coord; - min_coord.x = static_cast<int32_t>(i % width); - min_coord.y = static_cast<int32_t>(i / width); - - min_loc.push_back(min_coord); - - min_count++; - } - if(static_cast<type>(in[i]) == max_value) - { - Coordinates2D max_coord; - max_coord.x = static_cast<int32_t>(i % width); - max_coord.y = static_cast<int32_t>(i / width); - - max_loc.push_back(max_coord); - - max_count++; - } - } -} - // Integral Image void integral_image(const Tensor<uint8_t> &in, Tensor<uint32_t> &out) { |