
* tests/Makefile.am (SUBDIRS): Add detection. (EXTRA_DIST): Add img/test_corner_detection.pgm. * tests/detection/Makefile.am: New. * tests/detection/corner/Makefile.am: New. * tests/img/test_corner_detection.pgm: New. * tests/detection/corner/moravec.cc: New. --- milena/ChangeLog | 11 +++++ milena/tests/Makefile.am | 3 +- milena/tests/{upscaling => detection}/Makefile.am | 5 +- .../{fun/stat => detection/corner}/Makefile.am | 10 ++-- .../corner/moravec.cc} | 42 +++++++++---------- milena/tests/img/test_corner_detection.pgm | Bin 0 -> 16054 bytes 6 files changed, 40 insertions(+), 31 deletions(-) copy milena/tests/{upscaling => detection}/Makefile.am (88%) copy milena/tests/{fun/stat => detection/corner}/Makefile.am (81%) copy milena/tests/{convert/to_qimage_nocopy.cc => detection/corner/moravec.cc} (65%) create mode 100644 milena/tests/img/test_corner_detection.pgm diff --git a/milena/ChangeLog b/milena/ChangeLog index 4468140..fab764c 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,16 @@ 2012-10-03 Jonathan Fabrizio <jonathan@lrde.epita.fr> + Add test for Moravec corner detection. + + * tests/Makefile.am (SUBDIRS): Add detection. + (EXTRA_DIST): Add img/test_corner_detection.pgm. + * tests/detection/Makefile.am: New. + * tests/detection/corner/Makefile.am: New. + * tests/img/test_corner_detection.pgm: New. + * tests/detection/corner/moravec.cc: New. + +2012-10-03 Jonathan Fabrizio <jonathan@lrde.epita.fr> + Add Moravec corner detection. * mln/detection/corner/moravec.hh: New. diff --git a/milena/tests/Makefile.am b/milena/tests/Makefile.am index 3493250..f5fa7ba 100644 --- a/milena/tests/Makefile.am +++ b/milena/tests/Makefile.am @@ -28,6 +28,7 @@ SUBDIRS = \ core \ data \ debug \ + detection \ display \ draw \ estim \ @@ -102,7 +103,7 @@ EXTRA_DIST += \ img/lena_raw.pbm \ img/lena_raw.pgm \ img/test_bw.tif \ + img/test_corner_detection.pgm \ img/test_gl.tif \ img/test_rgb8.tif \ img/tiny.png - diff --git a/milena/tests/upscaling/Makefile.am b/milena/tests/detection/Makefile.am similarity index 88% copy from milena/tests/upscaling/Makefile.am copy to milena/tests/detection/Makefile.am index 3d0016f..769f0af 100644 --- a/milena/tests/upscaling/Makefile.am +++ b/milena/tests/detection/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE). +# Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE). # # This file is part of Olena. # @@ -16,5 +16,4 @@ include $(top_srcdir)/milena/tests/tests.mk -SUBDIRS = \ - art +SUBDIRS = corner diff --git a/milena/tests/fun/stat/Makefile.am b/milena/tests/detection/corner/Makefile.am similarity index 81% copy from milena/tests/fun/stat/Makefile.am copy to milena/tests/detection/corner/Makefile.am index aac5327..1a185a6 100644 --- a/milena/tests/fun/stat/Makefile.am +++ b/milena/tests/detection/corner/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE). +# Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE). # # This file is part of Olena. # @@ -16,9 +16,9 @@ include $(top_srcdir)/milena/tests/tests.mk -check_PROGRAMS = \ - mahalanobis - -mahalanobis_SOURCES = mahalanobis.cc +check_PROGRAMS = moravec +moravec_SOURCES = moravec.cc TESTS = $(check_PROGRAMS) + +MOSTLYCLEANFILES = moravec-result.ppm diff --git a/milena/tests/convert/to_qimage_nocopy.cc b/milena/tests/detection/corner/moravec.cc similarity index 65% copy from milena/tests/convert/to_qimage_nocopy.cc copy to milena/tests/detection/corner/moravec.cc index 506e601..850d2a0 100644 --- a/milena/tests/convert/to_qimage_nocopy.cc +++ b/milena/tests/detection/corner/moravec.cc @@ -1,5 +1,4 @@ -// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE) // // This file is part of Olena. // @@ -24,34 +23,33 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -/// \file -/// -/// Test of mln::convert::to_qimage - -#include <QtGui/QtGui> - -#include "tests/data.hh" - -#include <mln/core/image/image2d.hh> +#include <mln/detection/corner/moravec.hh> #include <mln/value/rgb8.hh> #include <mln/value/int_u8.hh> -#include <mln/io/ppm/load.hh> -#include <mln/io/pgm/load.hh> +#include <mln/io/essential.hh> +#include <mln/core/image/image2d.hh> +#include <mln/core/site_set/p_array.hh> #include <mln/data/convert.hh> +#include <mln/literal/colors.hh> -#include <mln/convert/to_qimage_nocopy.hh> +#include "tests/data.hh" +using namespace mln; int main() { - using namespace mln; + image2d<value::int_u8> input; + image2d<value::rgb8> output; + + p_array<point2d> corners; - { - image2d<value::rgb8> input; - io::ppm::load(input, MLN_IMG_DIR "/picasso.ppm"); - QImage test = convert::to_qimage_nocopy(input); - QImage refpix(MLN_IMG_DIR "/picasso.ppm"); + io::pgm::load(input, MLN_TESTS_IMG_DIR "/test_corner_detection.pgm"); + corners = mln::detection::corner::moravec(input); + + output = mln::data::convert(value::rgb8(), input); + mln_assertion(corners.nsites() == 1); + mln_assertion(corners[0] == point2d(39,64)); - mln_assertion(refpix == test.convertToFormat(refpix.format())); - } + data::fill( (output | corners).rw(), literal::red); + io::ppm::save(output, "moravec-result.ppm"); } diff --git a/milena/tests/img/test_corner_detection.pgm b/milena/tests/img/test_corner_detection.pgm new file mode 100644 index 0000000..a910597 Binary files /dev/null and b/milena/tests/img/test_corner_detection.pgm differ -- 1.7.2.5