olena-2.0-31-gf82caaa Add test for Harris corner detection.

* tests/detection/corner/Makefile.am (check_PROGRAMS): Add harris. (harris_SOURCES): add harris. (MOSTLYCLEANFILES): add harris-result * tests/detection/corner/harris.cc: New. --- milena/ChangeLog | 9 +++++++++ milena/tests/detection/corner/Makefile.am | 10 ++++++++-- .../detection/corner/{moravec.cc => harris.cc} | 16 +++++++++++----- 3 files changed, 28 insertions(+), 7 deletions(-) copy milena/tests/detection/corner/{moravec.cc => harris.cc} (80%) diff --git a/milena/ChangeLog b/milena/ChangeLog index 808624f..b88c960 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,14 @@ 2012-10-04 Jonathan Fabrizio <jonathan@lrde.epita.fr> + Add test for Harris corner detection. + + * tests/detection/corner/Makefile.am (check_PROGRAMS): Add harris. + (harris_SOURCES): add harris. + (MOSTLYCLEANFILES): add harris-result + * tests/detection/corner/harris.cc: New. + +2012-10-04 Jonathan Fabrizio <jonathan@lrde.epita.fr> + Add Harris corner detection. * mln/detection/corner/harris.hh: New. diff --git a/milena/tests/detection/corner/Makefile.am b/milena/tests/detection/corner/Makefile.am index 1a185a6..eb70108 100644 --- a/milena/tests/detection/corner/Makefile.am +++ b/milena/tests/detection/corner/Makefile.am @@ -16,9 +16,15 @@ include $(top_srcdir)/milena/tests/tests.mk -check_PROGRAMS = moravec +check_PROGRAMS = \ +moravec \ +harris + moravec_SOURCES = moravec.cc +harris_SOURCES = harris.cc TESTS = $(check_PROGRAMS) -MOSTLYCLEANFILES = moravec-result.ppm +MOSTLYCLEANFILES = \ +moravec-result.ppm \ +harris-result.ppm diff --git a/milena/tests/detection/corner/moravec.cc b/milena/tests/detection/corner/harris.cc similarity index 80% copy from milena/tests/detection/corner/moravec.cc copy to milena/tests/detection/corner/harris.cc index 850d2a0..343168c 100644 --- a/milena/tests/detection/corner/moravec.cc +++ b/milena/tests/detection/corner/harris.cc @@ -23,7 +23,7 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#include <mln/detection/corner/moravec.hh> +#include <mln/detection/corner/harris.hh> #include <mln/value/rgb8.hh> #include <mln/value/int_u8.hh> #include <mln/io/essential.hh> @@ -44,12 +44,18 @@ int main() p_array<point2d> corners; io::pgm::load(input, MLN_TESTS_IMG_DIR "/test_corner_detection.pgm"); - corners = mln::detection::corner::moravec(input); + corners = mln::detection::corner::harris(input); output = mln::data::convert(value::rgb8(), input); - mln_assertion(corners.nsites() == 1); - mln_assertion(corners[0] == point2d(39,64)); data::fill( (output | corners).rw(), literal::red); - io::ppm::save(output, "moravec-result.ppm"); + io::ppm::save(output, "harris-result.ppm"); + + { + bool points_ok = false; + mln_assertion(corners.nsites() == 2); + if (corners[0] == point2d(39,64) && corners[1] == point2d(41,66)) points_ok = true; + else if (corners[1] == point2d(39,64) && corners[0] == point2d(41,66)) points_ok = true; + mln_assertion(points_ok); + } } -- 1.7.2.5
participants (1)
-
Jonathan Fabrizio