aboutsummaryrefslogtreecommitdiff
path: root/tests/Utils.h
diff options
context:
space:
mode:
authorJohn Richardson <john.richardson@arm.com>2017-11-27 14:35:09 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:42:33 +0000
commit25f23680b211b6dd27c006cb9575e816e8f80bb5 (patch)
treef46132851600739d8d05f7bf8e3b9b0896bd39bf /tests/Utils.h
parent1d25ed54a948639d1894c8b021940df70005d519 (diff)
downloadComputeLibrary-25f23680b211b6dd27c006cb9575e816e8f80bb5.tar.gz
COMPMID-589: Port HOGDescriptor to new validation
Change-Id: I2021612e61de1b82aaeb49249d06929c7fceb15f Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/115216 Reviewed-by: Pablo Tello <pablo.tello@arm.com> Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests/Utils.h')
-rw-r--r--tests/Utils.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/tests/Utils.h b/tests/Utils.h
index d5c0a36ba2..5814965a40 100644
--- a/tests/Utils.h
+++ b/tests/Utils.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017, 2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -27,6 +27,8 @@
#include "arm_compute/core/Coordinates.h"
#include "arm_compute/core/Error.h"
#include "arm_compute/core/FixedPoint.h"
+#include "arm_compute/core/HOGInfo.h"
+#include "arm_compute/core/Size2D.h"
#include "arm_compute/core/TensorInfo.h"
#include "arm_compute/core/TensorShape.h"
#include "arm_compute/core/Types.h"
@@ -494,6 +496,30 @@ inline T create_tensor(const TensorShape &shape, Format format)
return tensor;
}
+/** Create and initialize a HOG (Histogram of Oriented Gradients) of the given type.
+ *
+ * @param[in] cell_size Cell size in pixels
+ * @param[in] block_size Block size in pixels. Must be a multiple of cell_size.
+ * @param[in] detection_window_size Detection window size in pixels. Must be a multiple of block_size and block_stride.
+ * @param[in] block_stride Distance in pixels between 2 consecutive blocks along the x and y direction. Must be a multiple of cell size
+ * @param[in] num_bins Number of histogram bins for each cell
+ * @param[in] normalization_type (Optional) Normalization type to use for each block
+ * @param[in] l2_hyst_threshold (Optional) Threshold used for L2HYS_NORM normalization method
+ * @param[in] phase_type (Optional) Type of @ref PhaseType
+ *
+ * @return Initialized HOG of given type.
+ */
+template <typename T>
+inline T create_HOG(const Size2D &cell_size, const Size2D &block_size, const Size2D &detection_window_size, const Size2D &block_stride, size_t num_bins,
+ HOGNormType normalization_type = HOGNormType::L2HYS_NORM, float l2_hyst_threshold = 0.2f, PhaseType phase_type = PhaseType::UNSIGNED)
+{
+ T hog;
+ HOGInfo hog_info(cell_size, block_size, block_size, block_stride, num_bins, normalization_type, l2_hyst_threshold, phase_type);
+ hog.init(hog_info);
+
+ return hog;
+}
+
/** Create a vector of random ROIs.
*
* @param[in] shape The shape of the input tensor.