Commit 5963d6b5 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

scribo/primitive/extract/lines_discontinued.hh: Fix invalid line reconstruction.

parent f0c488c5
2013-03-05 Guillaume Lazzara <z@lrde.epita.fr>
* scribo/primitive/extract/lines_discontinued.hh: Fix invalid line
reconstruction.
2013-03-05 Guillaume Lazzara <z@lrde.epita.fr>
* scribo/subsampling/bilinear.hh: Update documentation.
......
// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
// (LRDE)
// Copyright (C) 2009, 2010, 2013 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -68,6 +68,8 @@ namespace scribo
* \param[in] rank_k Rank used for filtering.
*
* \return An image in which lines are labeled.
*
* \pre win.length() > 2 * (rank_k + 1)
*/
template <typename I, typename N, typename V, typename W>
component_set<mln_ch_value(I,V)>
......@@ -98,6 +100,8 @@ namespace scribo
mln_precondition(exact(nbh).is_valid());
mln_precondition(exact(win).is_valid());
mln_precondition(win.length() > 2 * (rank_k + 1));
(void) input;
(void) nbh;
(void) win;
......@@ -124,11 +128,11 @@ namespace scribo
const N& nbh = exact(nbh_);
const W& win = exact(win_);
int dil;
if (!(rank_k % 2))
dil = win.length() / 2 + 2 * rank_k + 2;
else
dil = win.length() / 2 + 2 * rank_k + 3;
int dil = win.length() - 2 * (rank_k + 1);
mln_assertion(dil > 0);
if (! (dil % 2)) // Make sure the window have an odd size.
dil += 1;
mln_ch_value(I,bool) filter
= morpho::dilation(morpho::rank_filter(input, win, rank_k), W(dil));
......
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