aboutsummaryrefslogtreecommitdiff
path: root/src/core/HOGInfo.cpp
diff options
context:
space:
mode:
authorJohn Richardson <john.richardson@arm.com>2018-01-09 11:17:00 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:49:16 +0000
commit684cb0f29d23fbe418e5e5347234abf9eccef363 (patch)
tree60731b6bb63b1a0dc997107d3bd55d8b4b82626b /src/core/HOGInfo.cpp
parent7da29b6b12ff319ed2b6e2c46588dfa1991556fb (diff)
downloadComputeLibrary-684cb0f29d23fbe418e5e5347234abf9eccef363.tar.gz
COMPMID-596: Port HOGDetector to new validation
Change-Id: I73231fc71c5166268e6c909b7930b7e034f3794e Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/118876 Reviewed-by: Anthony Barbier <anthony.barbier@arm.com> Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/HOGInfo.cpp')
-rw-r--r--src/core/HOGInfo.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/HOGInfo.cpp b/src/core/HOGInfo.cpp
index 73f4c42041..4f99455b56 100644
--- a/src/core/HOGInfo.cpp
+++ b/src/core/HOGInfo.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018 ARM Limited.
+ * Copyright (c) 2016-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -61,7 +61,7 @@ void HOGInfo::init(const Size2D &cell_size, const Size2D &block_size, const Size
_phase_type = phase_type;
// Compute descriptor size. +1 takes into account of the bias
- _descriptor_size = num_cells_per_block().area() * num_blocks_per_image(_detection_window_size).area() * _num_bins + 1;
+ _descriptor_size = num_cells_per_block().area() * num_block_positions_per_image(_detection_window_size).area() * _num_bins + 1;
}
Size2D HOGInfo::num_cells_per_block() const
@@ -80,8 +80,10 @@ Size2D HOGInfo::num_cells_per_block_stride() const
_block_stride.height / _cell_size.height);
}
-Size2D HOGInfo::num_blocks_per_image(const Size2D &image_size) const
+Size2D HOGInfo::num_block_positions_per_image(const Size2D &image_size) const
{
+ ARM_COMPUTE_ERROR_ON(_block_stride.width == 0 || _block_stride.height == 0);
+
return Size2D(((image_size.width - _block_size.width) / _block_stride.width) + 1,
((image_size.height - _block_size.height) / _block_stride.height) + 1);
}