aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/Validation.h
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2017-12-11 16:59:29 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:42:33 +0000
commit5962f137e4d0291fee336967b333e2bbc7ae3f8a (patch)
tree91cbd083597eac5cd7e5d3f2a71bc70bf999fad4 /tests/validation/Validation.h
parentff850937ddfd3095b3cbe32e5c255817e5ccfeda (diff)
downloadComputeLibrary-5962f137e4d0291fee336967b333e2bbc7ae3f8a.tar.gz
COMPMID-556: Allow missing keypoint tolerance HarrisCorners
Change-Id: Ic38489023e2da2344d7d654b7a29357bb2362bfa Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/112766 Tested-by: BSG Visual Compute Jenkins server to access repositories on http://mpd-gerrit.cambridge.arm.com <bsgcomp@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests/validation/Validation.h')
-rw-r--r--tests/validation/Validation.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/validation/Validation.h b/tests/validation/Validation.h
index 4a96dd34b6..1f81d38acd 100644
--- a/tests/validation/Validation.h
+++ b/tests/validation/Validation.h
@@ -231,7 +231,8 @@ bool validate(T target, T reference, U tolerance = AbsoluteTolerance<T>());
/** Validate key points. */
template <typename T, typename U, typename V = AbsoluteTolerance<float>>
-void validate_keypoints(T target_first, T target_last, U reference_first, U reference_last, V tolerance = AbsoluteTolerance<float>());
+void validate_keypoints(T target_first, T target_last, U reference_first, U reference_last, V tolerance = AbsoluteTolerance<float>(),
+ float allowed_missing_percentage = 5.f, float allowed_mismatch_percentage = 5.f);
template <typename T>
struct compare_base
@@ -483,16 +484,16 @@ std::pair<int64_t, int64_t> compare_keypoints(T first1, T last1, U first2, U las
if(point == last2)
{
++num_missing;
+ ARM_COMPUTE_TEST_INFO("Key point not found" << *first1)
ARM_COMPUTE_TEST_INFO("keypoint1 = " << *first1)
- ARM_COMPUTE_EXPECT_FAIL("Key point not found", framework::LogLevel::DEBUG);
}
else if(!validate(point->tracking_status, first1->tracking_status) || !validate(point->strength, first1->strength, tolerance) || !validate(point->scale, first1->scale)
|| !validate(point->orientation, first1->orientation) || !validate(point->error, first1->error))
{
++num_mismatches;
+ ARM_COMPUTE_TEST_INFO("Mismatching keypoint")
ARM_COMPUTE_TEST_INFO("keypoint1 = " << *first1)
ARM_COMPUTE_TEST_INFO("keypoint2 = " << *point)
- ARM_COMPUTE_EXPECT_FAIL("Mismatching keypoint", framework::LogLevel::DEBUG);
}
++first1;
@@ -502,13 +503,12 @@ std::pair<int64_t, int64_t> compare_keypoints(T first1, T last1, U first2, U las
}
template <typename T, typename U, typename V>
-void validate_keypoints(T target_first, T target_last, U reference_first, U reference_last, V tolerance)
+void validate_keypoints(T target_first, T target_last, U reference_first, U reference_last, V tolerance,
+ float allowed_missing_percentage, float allowed_mismatch_percentage)
{
const int64_t num_elements_target = std::distance(target_first, target_last);
const int64_t num_elements_reference = std::distance(reference_first, reference_last);
- ARM_COMPUTE_EXPECT_EQUAL(num_elements_target, num_elements_reference, framework::LogLevel::ERRORS);
-
int64_t num_missing = 0;
int64_t num_mismatches = 0;
@@ -520,10 +520,10 @@ void validate_keypoints(T target_first, T target_last, U reference_first, U refe
const float percent_mismatches = static_cast<float>(num_mismatches) / num_elements_reference * 100.f;
ARM_COMPUTE_TEST_INFO(num_missing << " keypoints (" << std::fixed << std::setprecision(2) << percent_missing << "%) are missing in target");
- ARM_COMPUTE_EXPECT_EQUAL(num_missing, 0, framework::LogLevel::ERRORS);
+ ARM_COMPUTE_EXPECT(percent_missing <= allowed_missing_percentage, framework::LogLevel::ERRORS);
ARM_COMPUTE_TEST_INFO(num_mismatches << " keypoints (" << std::fixed << std::setprecision(2) << percent_mismatches << "%) mismatched");
- ARM_COMPUTE_EXPECT_EQUAL(num_mismatches, 0, framework::LogLevel::ERRORS);
+ ARM_COMPUTE_EXPECT(percent_mismatches <= allowed_mismatch_percentage, framework::LogLevel::ERRORS);
}
if(num_elements_target > 0)
@@ -533,7 +533,7 @@ void validate_keypoints(T target_first, T target_last, U reference_first, U refe
const float percent_missing = static_cast<float>(num_missing) / num_elements_target * 100.f;
ARM_COMPUTE_TEST_INFO(num_missing << " keypoints (" << std::fixed << std::setprecision(2) << percent_missing << "%) are not part of target");
- ARM_COMPUTE_EXPECT_EQUAL(num_missing, 0, framework::LogLevel::ERRORS);
+ ARM_COMPUTE_EXPECT(percent_missing <= allowed_missing_percentage, framework::LogLevel::ERRORS);
}
}