Commit 080134d6 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Update tools in scribo/src.

	* src/Makefile.am: Add postprocessing subdir.

	* src/postprocessing/Makefile.am,
	* src/postprocessing/fill_object_holes.cc: New.

	* src/preprocessing/denoise.cc: Remove.

	* src/preprocessing/denoise_bg.cc,
	* src/preprocessing/denoise_fg.cc: New.
parent 40d51800
2010-06-03 Guillaume Lazzara <z@lrde.epita.fr>
Update tools in scribo/src.
* src/Makefile.am: Add postprocessing subdir.
* src/postprocessing/Makefile.am,
* src/postprocessing/fill_object_holes.cc: New.
* src/preprocessing/denoise.cc: Remove.
* src/preprocessing/denoise_bg.cc,
* src/preprocessing/denoise_fg.cc: New.
2010-06-03 Guillaume Lazzara <z@lrde.epita.fr>
Add a specific toolchain for Nepomuk integration.
......
# Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE).
# Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
# (LRDE).
#
# This file is part of Olena.
#
......@@ -25,12 +26,12 @@ SUBDIRS = \
primitive \
filter \
misc \
nuxeo_xwiki \
postprocessing \
preprocessing \
table \
text
bin_PROGRAMS = \
bin_PROGRAMS = \
pbm_lines_in_doc
......
# Copyright (C) 2010 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/>.
#
## Process this file through Automake to create Makefile.in.
include $(top_srcdir)/scribo/scribo.mk
bin_PROGRAMS = \
fill_object_holes
fill_object_holes_SOURCES = fill_object_holes.cc
// Copyright (C) 2009, 2010 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 <scribo/debug/usage.hh>
#include <scribo/postprocessing/fill_object_holes.hh>
const char *args_desc[][2] =
{
{ "input.pbm", "A binary image. 'True' for objects, 'False'\
for the background." },
{ "ratio", "The maximum holes size ratio to allow hole filling." },
{0, 0}
};
int main(int argc, char *argv[])
{
using namespace mln;
if (argc != 4)
return scribo::debug::usage(argv,
"Fill object holes.",
"input.pbm ratio output.pbm",
args_desc);
trace::entering("main");
typedef image2d<bool> I;
I input;
io::pbm::load(input, argv[1]);
float ratio = atof(argv[2]);
I output = scribo::postprocessing::fill_object_holes(input, ratio);
io::pbm::save(output, argv[3]);
trace::exiting("main");
}
......@@ -21,13 +21,15 @@
include $(top_srcdir)/scribo/scribo.mk
bin_PROGRAMS = \
denoise \
denoise_bg \
denoise_fg \
homogeneous_contrast \
preprocess \
split_bg_fg \
unskew
denoise_SOURCES = denoise.cc
denoise_bg_SOURCES = denoise_bg.cc
denoise_fg_SOURCES = denoise_fg.cc
homogeneous_contrast_SOURCES = homogeneous_contrast.cc
preprocess_SOURCES = preprocess.cc
split_bg_fg_SOURCES = split_bg_fg.cc
......
......@@ -36,7 +36,6 @@ const char *args_desc[][2] =
{
{ "input.pbm", "A binary image. 'True' for objects, 'False'\
for the background." },
{ "fg_min_card", "The minimum neighbor count to be set to true." },
{ "bg_min_card", "The minimum neighbor count to be set to false." },
{0, 0}
};
......@@ -46,12 +45,11 @@ int main(int argc, char *argv[])
{
using namespace mln;
if (argc != 5)
if (argc != 4)
return scribo::debug::usage(argv,
"Remove noise.",
"input.pbm fg_min_card bg_min_card output.pbm",
args_desc,
"A binary image.");
"Remove noise in background using c4 neighbor.",
"input.pbm bg_min_card output.pbm",
args_desc);
trace::entering("main");
......@@ -59,11 +57,11 @@ int main(int argc, char *argv[])
I input;
io::pbm::load(input, argv[1]);
unsigned fg_min_card = atoi(argv[2]);
unsigned bg_min_card = atoi(argv[3]);
unsigned bg_min_card = atoi(argv[2]);
io::pbm::save(scribo::preprocessing::denoise(input, fg_min_card, bg_min_card),
argv[4]);
I output = scribo::preprocessing::denoise_bg(input, c4(), bg_min_card);
io::pbm::save(output, argv[3]);
trace::exiting("main");
}
// Copyright (C) 2010 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 <scribo/debug/usage.hh>
#include <scribo/preprocessing/denoise.hh>
const char *args_desc[][2] =
{
{ "input.pbm", "A binary image. 'True' for objects, 'False'\
for the background." },
{ "fg_min_card", "The minimum neighbor count to be set to false." },
{0, 0}
};
int main(int argc, char *argv[])
{
using namespace mln;
if (argc != 4)
return scribo::debug::usage(argv,
"Remove noisy objects using c8 neighbors.",
"input.pbm fg_min_card output.pbm",
args_desc);
trace::entering("main");
typedef image2d<bool> I;
I input;
io::pbm::load(input, argv[1]);
unsigned fg_min_card = atoi(argv[2]);
I output = scribo::preprocessing::denoise_fg(input, c8(), fg_min_card);
io::pbm::save(output, argv[3]);
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