---
scribo/scribo/toolchain/text_in_picture.hh | 11 +++++++++--
scribo/src/text_in_picture_neg.cc | 3 +++
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/scribo/scribo/toolchain/text_in_picture.hh
b/scribo/scribo/toolchain/text_in_picture.hh
index 19af9e3..18d3a8e 100644
--- a/scribo/scribo/toolchain/text_in_picture.hh
+++ b/scribo/scribo/toolchain/text_in_picture.hh
@@ -103,6 +103,7 @@ namespace scribo
component_set<mln_ch_value(I, value::label_16)>
text_in_picture(const Image<I>& input_rgb_orig,
bool bg_removal, bool multi_scale_bin,
+ unsigned win = 0,
unsigned max_dim_size = 0, unsigned lambda = 0,
const char *debug_outdir = 0);
@@ -136,7 +137,7 @@ namespace scribo
// Group Filtering
bbox_h_ratio = 1.75f;
- bbox_overlap = 0.80f;
+ bbox_overlap = 0.60f;
small_groups = 3;
v_thickness = 8;
regroup_dmax = 30;
@@ -167,6 +168,7 @@ namespace scribo
component_set<mln_ch_value(I, value::label_16)>
text_in_picture(const Image<I>& input_rgb_orig_,
bool bg_removal, bool multi_scale_bin,
+ unsigned win = 0,
unsigned max_dim_size = 0, unsigned lambda = 0,
const char *debug_outdir = 0)
{
@@ -246,7 +248,10 @@ namespace scribo
// Binarize foreground to use it in the processing chain.
timer_.restart();
mln_ch_value(I,bool) input;
- unsigned w = std::min(intensity_ima.nrows() / 3, intensity_ima.ncols() / 3);
+
+ unsigned w = win;
+ if (!w)
+ w = std::min(intensity_ima.nrows() / 3, intensity_ima.ncols() / 3);
if (! w % 2)
++w;
w = std::min(w, conf.sauvola_min_w);
@@ -347,6 +352,8 @@ namespace scribo
hratio_filtered_links = filter::object_links_bbox_h_ratio(merged_links,
conf.bbox_h_ratio);
+ hratio_filtered_links =
+ filter::object_links_bbox_w_ratio(hratio_filtered_links, 3);
diff --git a/scribo/src/text_in_picture_neg.cc b/scribo/src/text_in_picture_neg.cc
index 7d6694a..8b80b43 100644
--- a/scribo/src/text_in_picture_neg.cc
+++ b/scribo/src/text_in_picture_neg.cc
@@ -82,6 +82,7 @@
#include <scribo/filter/object_groups_with_holes.hh>
#include <scribo/filter/object_links_bbox_h_ratio.hh>
+#include <scribo/filter/object_links_bbox_w_ratio.hh>
#include <scribo/filter/object_links_bbox_overlap.hh>
#include <scribo/filter/common/objects_photo.hh>
@@ -166,6 +167,7 @@ int main(int argc, char* argv[])
typedef image2d<value::label_16> L;
component_set<L>
comps = toolchain::text_in_picture(input_rgb, bg_removal, multi_scale_bin,
+ 0,
max_dim_size, lambda, out_base_dir);
@@ -174,6 +176,7 @@ int main(int argc, char* argv[])
comps_neg = toolchain::text_in_picture(world::rgb::invert(input_rgb),
bg_removal,
multi_scale_bin,
+ 15,
max_dim_size, lambda, out_base_dir);
--
1.5.6.5