Commit 46fe9117 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Add tests for lines_*_pattern routines.

	* tests/primitive/extract/Makefile.am: New targets.

	* tests/primitive/extract/lines_h_pattern.cc,
	* tests/primitive/extract/lines_h_pattern.ref.pbm,
	* tests/primitive/extract/lines_v_pattern.cc,
	* tests/primitive/extract/lines_v_pattern.ref.pbm: New.
parent 6e2cefa4
2013-03-06 Guillaume Lazzara <z@lrde.epita.fr>
Add tests for lines_*_pattern routines.
* tests/primitive/extract/Makefile.am: New targets.
* tests/primitive/extract/lines_h_pattern.cc,
* tests/primitive/extract/lines_h_pattern.ref.pbm,
* tests/primitive/extract/lines_v_pattern.cc,
* tests/primitive/extract/lines_v_pattern.ref.pbm: New.
2013-03-06 Guillaume Lazzara <z@lrde.epita.fr>
Fix wrong line reconstruction with lines_*_pattern routines.
......
......@@ -22,11 +22,13 @@ EXTRA_DIST = \
alignment_2.ref.pbm \
alignment_3.ref.pbm \
alignment_4.ref.pbm \
lines_discontinued.pbm
lines_v_pattern.ref.pbm
check_PROGRAMS = lines_discontinued \
lines_h_discontinued \
lines_v_discontinued
lines_v_discontinued \
lines_v_pattern \
lines_h_pattern
if HAVE_MAGICKXX
......
// Copyright (C) 2013 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
// Olena is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, version 2 of the License.
//
// Olena is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Olena. If not, see <http://www.gnu.org/licenses/>.
//
// As a special exception, you may use this file as part of a free
// software project without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to produce
// an executable, this file does not by itself cause the resulting
// executable to be covered by the GNU General Public License. This
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
// \file
#include <mln/core/image/image2d.hh>
#include <mln/data/compare.hh>
#include <mln/io/pbm/load.hh>
#include <scribo/primitive/extract/lines_h_pattern.hh>
#include "tests/data.hh"
int main()
{
using namespace mln;
using namespace scribo;
image2d<bool> input;
io::pbm::load(input, SCRIBO_IMG_DIR "/lines_discontinued.pbm");
image2d<bool> ref;
io::pbm::load(ref,
SCRIBO_TESTS_DIR "/primitive/extract/lines_h_pattern.ref.pbm");
image2d<bool>
vlines = primitive::extract::lines_h_pattern(input, 51, 3);
mln_assertion(vlines == ref);
}
// Copyright (C) 2013 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
// Olena is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, version 2 of the License.
//
// Olena is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Olena. If not, see <http://www.gnu.org/licenses/>.
//
// As a special exception, you may use this file as part of a free
// software project without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to produce
// an executable, this file does not by itself cause the resulting
// executable to be covered by the GNU General Public License. This
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
// \file
#include <mln/core/image/image2d.hh>
#include <mln/data/compare.hh>
#include <mln/io/pbm/load.hh>
#include <scribo/primitive/extract/lines_v_pattern.hh>
#include "tests/data.hh"
int main()
{
using namespace mln;
using namespace scribo;
image2d<bool> input;
io::pbm::load(input, SCRIBO_IMG_DIR "/lines_discontinued.pbm");
image2d<bool> ref;
io::pbm::load(ref,
SCRIBO_TESTS_DIR "/primitive/extract/lines_v_pattern.ref.pbm");
image2d<bool>
vlines = primitive::extract::lines_v_pattern(input, 51, 5);
mln_assertion(vlines == ref);
}
P4
# Generated by Milena 1.0 http://olena.lrde.epita.fr
# EPITA Research and Development Laboratory (LRDE)
200 200
اااااااااااااااا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€ا€€€€€€€€€€€€
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment