Commit 05014efe authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Add a new example in Scribo.

	* scribo/src/primitive/extract/Makefile.am: Add a new target.

	* scribo/src/primitive/extract/lines_pattern.cc: New.

git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4712 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 696cae71
2009-11-03 Guillaume Lazzara <z@lrde.epita.fr>
Add a new example in Scribo.
* scribo/src/primitive/extract/Makefile.am: Add a new target.
* scribo/src/primitive/extract/lines_pattern.cc: New.
2009-11-03 Guillaume Lazzara <z@lrde.epita.fr>
First draft of multiscale Sauvola's binarization.
......
......@@ -25,11 +25,13 @@ bin_PROGRAMS = \
extract_discontinued_vlines \
extract_discontinued_hlines \
extract_thick_vlines \
extract_thick_hlines
extract_thick_hlines \
lines_pattern
extract_discontinued_lines_SOURCES = extract_discontinued_lines.cc
extract_discontinued_vlines_SOURCES = extract_discontinued_vlines.cc
extract_discontinued_hlines_SOURCES = extract_discontinued_hlines.cc
extract_thick_vlines_SOURCES = extract_thick_vlines.cc
extract_thick_hlines_SOURCES = extract_thick_hlines.cc
lines_pattern_SOURCES = lines_pattern.cc
// Copyright (C) 2009 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.
#include <mln/core/image/image2d.hh>
#include <mln/io/pbm/all.hh>
#include <mln/pw/all.hh>
#include <mln/data/fill.hh>
#include <mln/core/image/dmorph/image_if.hh>
#include <scribo/primitive/extract/lines_h_pattern.hh>
#include <scribo/primitive/extract/lines_v_pattern.hh>
#include <scribo/debug/usage.hh>
const char *args_desc[][2] =
{
{ "input.pbm", "A binary image." },
{ "length", " Minimum line length. (Common value : 51)" },
{ "delta", " Distance between the object pixel and the background pixel (Common value : 5)" },
{0, 0}
};
int main(int argc, char *argv[])
{
using namespace mln;
if (argc != 5)
return scribo::debug::usage(argv,
"Extract horizontal lines patterns",
"input.pbm length delta output.pbm",
args_desc,
"A binary image of lines.");
trace::entering("main");
image2d<bool> input;
io::pbm::load(input, argv[1]);
image2d<bool>
h_lines = scribo::primitive::extract::lines_h_pattern(input,
atoi(argv[2]),
atoi(argv[3]));
image2d<bool>
v_lines = scribo::primitive::extract::lines_v_pattern(input,
atoi(argv[2]),
atoi(argv[3]));
data::fill((v_lines | pw::value(h_lines)).rw(), true);
io::pbm::save(v_lines, argv[4]);
trace::exiting("main");
}
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