* demo/src/mainwindow.cc: Do not always resize pics.
* filter/object_groups_small.hh: Add missing traces.
* preprocessing/split_bg_fg.hh: Fix type ambiguities.
* src/table/extract.cc,
* src/text/grouping/group_from_double_link_filter_non_aligned.cc,
* src/text/grouping/group_from_rag.cc: Cosmetic changes.
---
scribo/ChangeLog | 14 ++++++++++++++
scribo/demo/src/mainwindow.cc | 3 ++-
scribo/filter/object_groups_small.hh | 3 +++
scribo/preprocessing/split_bg_fg.hh | 9 ++++++---
scribo/src/table/extract.cc | 6 ++++--
.../group_from_double_link_filter_non_aligned.cc | 2 +-
scribo/src/text/grouping/group_from_rag.cc | 4 ++--
7 files changed, 32 insertions(+), 9 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 47627e0..0a7f625 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,17 @@
+2009-09-25 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
+ Small fixes in Scribo.
+
+ * demo/src/mainwindow.cc: Do not always resize pics.
+
+ * filter/object_groups_small.hh: Add missing traces.
+
+ * preprocessing/split_bg_fg.hh: Fix type ambiguities.
+
+ * src/table/extract.cc,
+ * src/text/grouping/group_from_double_link_filter_non_aligned.cc,
+ * src/text/grouping/group_from_rag.cc: Cosmetic changes.
+
2009-09-15 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
Small fixes in Scribo.
diff --git a/scribo/demo/src/mainwindow.cc b/scribo/demo/src/mainwindow.cc
index f808d8b..4a12359 100644
--- a/scribo/demo/src/mainwindow.cc
+++ b/scribo/demo/src/mainwindow.cc
@@ -310,7 +310,8 @@ namespace scribo
item = view->scene()->addPixmap(pixmap);
view->scene()->setSceneRect(item->boundingRect());
Q_ASSERT(item != 0);
- view->fitInView(item->boundingRect(), Qt::KeepAspectRatio);
+ if (pixmap.width() > view->maximumViewportSize().width())
+ view->fitInView(item->boundingRect(), Qt::KeepAspectRatio);
view_to_item(view) = item;
bool b = (mainResultItem_ != 0 || mainRefItem_ != 0);
diff --git a/scribo/filter/object_groups_small.hh b/scribo/filter/object_groups_small.hh
index 1e6c636..6a50aba 100644
--- a/scribo/filter/object_groups_small.hh
+++ b/scribo/filter/object_groups_small.hh
@@ -68,6 +68,8 @@ namespace scribo
object_groups_small(const object_groups<L>& groups,
unsigned n_links)
{
+ trace::entering("scribo::filter::object_groups_small");
+
mln_precondition(groups.is_valid());
// Counting the number of objects per group.
@@ -81,6 +83,7 @@ namespace scribo
if (group_size[groups[i]] < n_links)
output(i) = 0;
+ trace::exiting("scribo::filter::object_groups_small");
return output;
}
diff --git a/scribo/preprocessing/split_bg_fg.hh b/scribo/preprocessing/split_bg_fg.hh
index 7e05d0d..f64635b 100644
--- a/scribo/preprocessing/split_bg_fg.hh
+++ b/scribo/preprocessing/split_bg_fg.hh
@@ -31,6 +31,7 @@
///
/// Split the background and the foreground.
+# include <mln/core/macros.hh>
# include <mln/core/image/image2d.hh>
# include <mln/core/alias/neighb2d.hh>
# include <mln/core/routine/duplicate.hh>
@@ -61,6 +62,8 @@
# include <mln/labeling/compute.hh>
# include <mln/accu/stat/mean.hh>
+# include <mln/util/couple.hh>
+
@@ -84,7 +87,7 @@ namespace scribo
and the second is the foreground.
*/
template <typename I>
- util::couple<mln_concrete(I), mln_concrete(I)>
+ mln::util::couple<mln_concrete(I), mln_concrete(I)>
split_bg_fg(const Image<I>& input_, unsigned lambda, unsigned delta);
@@ -287,7 +290,7 @@ namespace scribo
// }
typedef accu::stat::mean< rgb8, algebra::vec<3,float>, rgb8 > A;
- util::array<rgb8> m = labeling::compute(A(), input, con, nblobs);
+ mln::util::array<rgb8> m = labeling::compute(A(), input, con, nblobs);
data::fill((output | pw::value(mask)).rw(),
data::transform(lab, m));
@@ -305,7 +308,7 @@ namespace scribo
// Facade
template <typename I>
- util::couple<mln_concrete(I), mln_concrete(I)>
+ mln::util::couple<mln_concrete(I), mln_concrete(I)>
split_bg_fg(const Image<I>& input_, unsigned lambda, unsigned delta)
{
trace::entering("scribo::preprocessing::split_bg_fg");
diff --git a/scribo/src/table/extract.cc b/scribo/src/table/extract.cc
index 060f2f8..c510753 100644
--- a/scribo/src/table/extract.cc
+++ b/scribo/src/table/extract.cc
@@ -65,9 +65,11 @@ the background, other colors indicates cells.");
io::pbm::load(input, argv[1]);
value::label_16 ncells;
- image2d<value::label_16> tables = scribo::table::extract(input, ncells).first();
+ image2d<value::label_16>
+ tables = scribo::table::extract(input, ncells).first();
- io::ppm::save(mln::labeling::colorize(value::rgb8(), tables, ncells), argv[3]);
+ io::ppm::save(mln::labeling::colorize(value::rgb8(), tables, ncells),
+ argv[3]);
io::dump::save(tables, argv[2]);
diff --git a/scribo/src/text/grouping/group_from_double_link_filter_non_aligned.cc
b/scribo/src/text/grouping/group_from_double_link_filter_non_aligned.cc
index fce389e..ef9362d 100644
--- a/scribo/src/text/grouping/group_from_double_link_filter_non_aligned.cc
+++ b/scribo/src/text/grouping/group_from_double_link_filter_non_aligned.cc
@@ -141,7 +141,7 @@ int main(int argc, char *argv[])
// Filter non-correctly aligned grouped objects.
object_links<L> filtered_links
- = filter::object_links_non_h_aligned(text, double_link, atoi(argv[4]));
+ = filter::object_links_non_h_aligned(text, double_link, atof(argv[4]));
text_t aligned_grouped_text
diff --git a/scribo/src/text/grouping/group_from_rag.cc
b/scribo/src/text/grouping/group_from_rag.cc
index 8b3d5fd..e354d09 100644
--- a/scribo/src/text/grouping/group_from_rag.cc
+++ b/scribo/src/text/grouping/group_from_rag.cc
@@ -127,8 +127,8 @@ namespace scribo
bool operator()(const point2d& p1, const point2d& p2) const
{
- return (math::sqrt(math::sqr(p1.row() - p2.row())
- + math::sqr(p1.col() - p2.col()))) < 5;
+ return (math::sqrt(math::sqr(static_cast<float>(p1.row() - p2.row()))
+ + math::sqr(static_cast<float>(p1.col() - p2.col())))) < 5;
}
};
--
1.5.6.5