diff options
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) { |