From fd6735d7684c7ff4d4951543ebed97cb7a984ae7 Mon Sep 17 00:00:00 2001 From: Davis King Date: Mon, 3 Mar 2014 22:36:26 -0500 Subject: [PATCH] Added more pyramid point transform unit tests --- dlib/test/pyramid_down.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dlib/test/pyramid_down.cpp b/dlib/test/pyramid_down.cpp index 4c9a9516d..5a3e94056 100644 --- a/dlib/test/pyramid_down.cpp +++ b/dlib/test/pyramid_down.cpp @@ -268,12 +268,17 @@ void test_pyramid_down_grayscale2() // make sure the coordinate mapping is invertible when it should be - for (long x = -10; x <= 10; ++x) + for (int l = 0; l < 4; ++l) { - for (long y = -10; y <= 10; ++y) + for (long x = -10; x <= 10; ++x) { - DLIB_TEST_MSG(point(pyr.point_down(pyr.point_up(point(x,y)))) == point(x,y), - point(x,y) << " " << pyr.point_up(point(x,y)) << " " << pyr.point_down(pyr.point_up(point(x,y)))); + for (long y = -10; y <= 10; ++y) + { + DLIB_TEST_MSG(point(pyr.point_down(pyr.point_up(point(x,y),l),l)) == point(x,y), + point(x,y) << " " << pyr.point_up(point(x,y),l) << " " << pyr.point_down(pyr.point_up(point(x,y),l),l)); + DLIB_TEST_MSG(point(pyr.point_down(point(pyr.point_up(point(x,y),l)),l)) == point(x,y), + point(x,y) << " " << pyr.point_up(point(x,y),l) << " " << pyr.point_down(point(pyr.point_up(point(x,y),l)),l)); + } } } }