1. 15 Mar, 2010 40 commits
    • Guillaume Lazzara's avatar
      Improve text line merging algorithm. · de558e1f
      Guillaume Lazzara authored
      	* text/merging.hh: Change merge rules and improve integration with
      	Scribo line structures.
      de558e1f
    • Guillaume Lazzara's avatar
      Add a reconstruction algorithm. · ec5a4728
      Guillaume Lazzara authored
      	* primitive/internal/rd.hh: New.
      ec5a4728
    • Guillaume Lazzara's avatar
      Small fixes. · 2d5c9e76
      Guillaume Lazzara authored
      	* binarization/sauvola_ms.hh: Add a missing include.
      
      	* binarization/sauvola_threshold.hh: Remove debug and useless
      	comments.
      
      	* preprocessing/unskew.hh: Fix invalid guards.
      
      	* primitive/extract/components.hh: Fill image extension.
      
      	* primitive/extract/lines_pattern.hh: Adjust and fill image
      	extension.
      
      	* primitive/extract/lines_v_thick.hh: Fix traces.
      2d5c9e76
    • Guillaume Lazzara's avatar
      Add new preprocessing routines. · b8b44828
      Guillaume Lazzara authored
      	* preprocessing/denoise.hh,
      	* preprocessing/denoise_bg.hh,
      	* preprocessing/denoise_fg.hh,
      	* preprocessing/homogeneous_contrast.hh,
      	* preprocessing/rotate_90.hh: New routines.
      
      	* fun/v2b/label_to_bool.hh: New function.
      
      	* tests/preprocessing/Makefile.am,
      	* tests/preprocessing/rotate_90.cc: New test.
      b8b44828
    • Guillaume Lazzara's avatar
      Update code according to last changes in Scribo core classes. · 1e6a267b
      Guillaume Lazzara authored
      	* draw/bounding_box_links.hh,
      	* primitive/internal/init_link_array.hh,
      	* primitive/internal/is_link_valid.hh,
      	* primitive/link/internal/link_single_dmax_base.hh,
      	* src/afp/link.hh: Update the use of object_link class.
      
      	* draw/bounding_boxes.hh,
      	* filter/objects_with_holes.hh,
      	* src/afp/regroup.hh: Update for_all macro.
      
      	* estim/object_groups_v_thickness.hh,
      	* filter/object_groups_small.hh,
      	* filter/object_groups_v_thickness.hh,
      	* text/recognition.hh: Update access to component_set.
      
      	* filter/object_links_bbox_h_ratio.hh,
      	* filter/object_links_bbox_overlap.hh,
      	* filter/object_links_bbox_ratio.hh,
      	* filter/object_links_bottom_aligned.hh,
      	* filter/object_links_non_aligned_simple.hh,
      	* filter/object_links_top_aligned.hh,
      	* primitive/group/apply.hh,
      	* primitive/group/from_single_link.hh,
      	* primitive/link/merge_double_link.hh,
      	* primitive/link/with_single_right_link_bottom.hh,
      	* primitive/link/with_single_right_link_dmax_ratio.hh,
      	* primitive/link/with_single_right_link_top.hh: Improve routine
      	prototypes.
      
      	* primitive/link/internal/link_functor_base.hh: Make use of
      	separators if exist.
      1e6a267b
    • Guillaume Lazzara's avatar
      Improve debug routines in Scribo. · 3a3cd53c
      Guillaume Lazzara authored
      	* debug/bboxes_enlarged_image.hh,
      	* debug/looks_like_a_text_line_image.hh,
      	* debug/mean_and_base_lines_image.hh: New routines.
      
      	* debug/alignment_decision_image.hh,
      	* debug/decision_image.hh,
      	* debug/save_bboxes_image.hh: Update code according to last
      	changes in core classes.
      
      	* debug/usage.hh: Make the description optional.
      3a3cd53c
    • Guillaume Lazzara's avatar
      Improve core classes in Scribo. · 94a1f48d
      Guillaume Lazzara authored
      	* core/component_info.hh,
      	* core/component_set.hh: Add new methods and an output operator.
      
      	* core/line_info.hh: Add new methods and improve stats computation.
      
      	* core/line_set.hh: Add new methods.
      
      	* core/macros.hh: Add more specific macros.
      
      	* core/tag/component.hh,
      	* core/tag/line.hh: Add output operators.
      94a1f48d
    • Guillaume Lazzara's avatar
      Share internal data in groups and links structures. · cb3ec8ce
      Guillaume Lazzara authored
      	* core/object_groups.hh,
      	* core/object_links.hh: Share internal data using a tracked
      	pointer.
      cb3ec8ce
    • Guillaume Lazzara's avatar
    • Guillaume Lazzara's avatar
      Add a small tool to recognize text in a binary image. · ced2be00
      Guillaume Lazzara authored
      	* src/text/Makefile.am: New target.
      
      	* src/text/pbm_recognition.cc: New.
      
      	* text/recognition.hh: Add an overload taking an image as
      	argument.
      ced2be00
    • Guillaume Lazzara's avatar
    • Guillaume Lazzara's avatar
      Add a subsampling algorithm. · c803910e
      Guillaume Lazzara authored
      	* subsampling/integral.hh: New. Compute a subsample image and an
      	integral image at the same time.
      c803910e
    • Guillaume Lazzara's avatar
      Add a first draft of a text line merging algorithm. · 7dc506b4
      Guillaume Lazzara authored
      	* text/merging.hh: New.
      7dc506b4
    • Guillaume Lazzara's avatar
      Add and update examples. · a0c8b8d5
      Guillaume Lazzara authored
      	* src/Makefile.am,
      	* src/binarization/Makefile.am,
      	* src/preprocessing/Makefile.am: Add new targets.
      
      	* src/preprocessing/denoising.cc: New.
      
      	* src/preprocessing/split_bg_fg.cc: Fix usage.
      
      	* src/text_in_article.cc,
      	* src/text_in_photo_ppm_fast.cc: Update code according last
      	changes in core classes.
      
      	* src/text_in_photo_ppm_fast_2.cc: New example.
      a0c8b8d5
    • Guillaume Lazzara's avatar
      Small fixes. · 6dc7e439
      Guillaume Lazzara authored
      	* binarization/sauvola_ms.hh: Remove a useless include.
      
      	* debug/usage.hh: Move description output.
      
      	* io/xml/save_text_lines.hh: Fix invalid xml output.
      
      	* primitive/link/internal/link_ms_dmax_ratio_base.hh,
      	* primitive/link/internal/link_single_dmax_ratio_base.hh: update
      	distance criterion.
      
      	* scribo.mk: Change compilation flags.
      
      	* src/afp/components.hh: Merge data in only one array.
      
      	* tests/filter/Makefile.am,
      	* tests/filter/objects_with_holes.cc: New test.
      
      	* text/clean.hh: use upsampling::hq4x instead of upsampling::hq2x.
      6dc7e439
    • Guillaume Lazzara's avatar
      Keep updating code according to last changed in core classes. · 470ab859
      Guillaume Lazzara authored
      	* debug/decision_image.hh,
      	* debug/save_linked_bboxes_image.hh,
      	* draw/bounding_boxes.hh,
      	* estim/object_groups_v_thickness.hh,
      	* filter/common/objects_photo.hh,
      	* filter/internal/compute.hh,
      	* filter/object_groups_size_ratio.hh,
      	* filter/object_groups_small.hh,
      	* filter/object_groups_v_thickness.hh,
      	* filter/object_links_bbox_overlap.hh,
      	* filter/object_links_bottom_aligned.hh,
      	* filter/object_links_non_aligned_simple.hh,
      	* filter/objects_thick.hh,
      	* filter/objects_thin.hh,
      	* filter/objects_with_holes.hh,
      	* primitive/group/apply.hh,
      	* primitive/group/from_double_link.hh,
      	* primitive/group/from_single_link.hh,
      	* primitive/link/internal/link_single_dmax_base.hh,
      	* primitive/link/with_single_left_link.hh,
      	* primitive/link/with_single_right_link.hh,
      	* src/afp/link.hh,
      	* src/afp/regroup.hh,
      	* text/recognition.hh: Update the use of core classes. Replace the
      	use of object_image with component_set.
      470ab859
    • Guillaume Lazzara's avatar
      Improve core classes. · 8b7c177b
      Guillaume Lazzara authored
      	* scribo/core/component_info.hh,
      	* scribo/core/component_set.hh,
      	* scribo/core/line_info.hh,
      	* scribo/core/line_set.hh,
      	* scribo/core/object_groups.hh: Add more methods and constructors.
      
      	* scribo/core/macros.hh: Add a new macro.
      
      	* scribo/core/tag/line.hh: Add more enums.
      8b7c177b
    • Guillaume Lazzara's avatar
      2082dbe0
    • Guillaume Lazzara's avatar
      Move Scribo demo. · a26809df
      Guillaume Lazzara authored
      	* demo/Makefile.am,
      	* demo/demo.pro,
      	* demo/demo.qrc,
      	* demo/icons/document-open.png,
      	* demo/icons/edit-find.png,
      	* demo/icons/format-indent-more.png,
      	* demo/icons/go-next.png,
      	* demo/icons/image-x-generic.png,
      	* demo/icons/list-add.png,
      	* demo/icons/ocr.png,
      	* demo/icons/text-x-generic.png,
      	* demo/icons/view-refresh.png,
      	* demo/icons/x-office-spreadsheet.png,
      	* demo/src/main.cc,
      	* demo/src/mainwindow.cc,
      	* demo/src/mainwindow.hh,
      	* demo/ui/mainwindow.ui: Move...
      
      	* demo/review/Makefile.am,
      	* demo/review/icons/document-open.png,
      	* demo/review/icons/edit-find.png,
      	* demo/review/icons/format-indent-more.png,
      	* demo/review/icons/go-next.png,
      	* demo/review/icons/image-x-generic.png,
      	* demo/review/icons/list-add.png,
      	* demo/review/icons/ocr.png,
      	* demo/review/icons/text-x-generic.png,
      	* demo/review/icons/view-refresh.png,
      	* demo/review/icons/x-office-spreadsheet.png,
      	* demo/review/review.pro,
      	* demo/review/review.qrc,
      	* demo/review/src/main.cc,
      	* demo/review/src/mainwindow.cc,
      	* demo/review/src/mainwindow.hh,
      	* demo/review/ui/mainwindow.ui: ... here.
      a26809df
    • Guillaume Lazzara's avatar
      Small fixes in Milena. · 978d82a0
      Guillaume Lazzara authored
      	* milena/mln/accu/center.hh: Add nsites() member.
      
      	* milena/mln/accu/pair.hh: Provide access to the underlying accus.
      
      	* milena/mln/accu/stat/variance.hh: Use literal::zero.
      
      	* milena/mln/core/internal/labeled_image_base.hh: Indent.
      
      	* milena/mln/core/site_set/box.hh: Rename center() as pcenter().
      
      	* milena/mln/labeling/blobs_and_compute.hh: Return the array of
      	accumulators.
      
      	* milena/mln/labeling/colorize.hh: Make sure a color is not used
      	twice in the same image.
      
      	* milena/mln/labeling/compute.hh: Add a new overload.
      
      	* milena/mln/transform/influence_zone_geodesic.hh: Fix a
      	segmentation fault when an image had a border.
      978d82a0
    • Guillaume Lazzara's avatar
    • Guillaume Lazzara's avatar
      Introduce new Scribo core classes and start using them. · 03f61d76
      Guillaume Lazzara authored
      	* scribo/core/component_info.hh,
      	* scribo/core/component_set.hh,
      	* scribo/core/line_info.hh,
      	* scribo/core/line_set.hh,
      	* scribo/core/macros.hh,
      	* scribo/core/object_groups.hh,
      	* scribo/core/object_links.hh,
      	* scribo/core/tag/anchor.hh,
      	* scribo/core/tag/component.hh,
      	* scribo/core/tag/line.hh: New core classes.
      
      	* scribo/core/object_image.hh: Remove.
      
      	* scribo/core/anchors.hh
      	* scribo/primitive/extract/objects.hh: Rename as...
      
      	* scribo/primitive/link/internal/compute_anchor.hh,
      	* scribo/primitive/extract/components.hh: ... this.
      
      	* scribo/draw/bounding_box_links.hh,
      	* scribo/filter/object_links_bbox_h_ratio.hh,
      	* scribo/filter/object_links_bbox_ratio.hh,
      	* scribo/filter/objects_small.hh,
      	* scribo/fun/v2b/objects_small_filter.hh,
      	* scribo/primitive/group/apply.hh,
      	* scribo/primitive/group/from_single_link.hh,
      	* scribo/primitive/internal/find_root.hh,
      	* scribo/primitive/internal/init_link_array.hh,
      	* scribo/primitive/link/compute.hh,
      	* scribo/primitive/link/internal/find_link.hh,
      	* scribo/primitive/link/internal/find_several_links.hh,
      	* scribo/primitive/link/internal/link_functor_base.hh,
      	* scribo/primitive/link/internal/link_several_dmax_base.hh,
      	* scribo/primitive/link/internal/link_single_dmax_base.hh,
      	* scribo/primitive/link/internal/link_single_dmax_ratio_base.hh,
      	* scribo/primitive/link/merge_double_link.hh,
      	* scribo/primitive/link/with_single_left_link_dmax_ratio.hh,
      	* scribo/primitive/link/with_single_right_link_bottom.hh,
      	* scribo/primitive/link/with_single_right_link_dmax_ratio.hh,
      	* scribo/primitive/link/with_single_right_link_top.hh: Make use of
      	the new core classes.
      03f61d76
    • Guillaume Lazzara's avatar
      Add anchor support in debug routines. · 92a937fa
      Guillaume Lazzara authored
      	* scribo/debug/alignment_decision_image.hh,
      	* scribo/debug/links_decision_image.hh,
      	* scribo/debug/save_linked_bboxes_image.hh,
      	* scribo/draw/bounding_box_links.hh: Make use of anchor points to
      	draw debug outputs.
      92a937fa
    • Guillaume Lazzara's avatar
      Add new link filters. · 10172dec
      Guillaume Lazzara authored
      	* scribo/filter/object_links_non_aligned_simple.hh: Handle new
      	cases.
      
      	* scribo/filter/object_links_left_aligned.hh,
      	* scribo/filter/object_links_right_aligned.hh: New filters.
      10172dec
    • Guillaume Lazzara's avatar
      Improve object linking backend. · 3894a51d
      Guillaume Lazzara authored
      	* scribo/primitive/internal/find_left_link.hh,
      	* scribo/primitive/internal/find_right_link.hh,
      	* scribo/primitive/internal/is_invalid_link.hh: Remove.
      
      	* scribo/primitive/link/internal/compute_anchor.hh,
      	* scribo/primitive/link/internal/link_ms_dmax_base.hh,
      	* scribo/primitive/link/internal/link_ms_dmax_ratio_base.hh,
      	* scribo/primitive/link/internal/link_single_dmax_base.hh,
      	* scribo/primitive/link/internal/link_single_dmax_ratio_base.hh,
      	* scribo/primitive/link/with_single_down_link.hh,
      	* scribo/primitive/link/with_single_left_link.hh,
      	* scribo/primitive/link/with_single_left_link_dmax_ratio.hh,
      	* scribo/primitive/link/with_single_right_link.hh,
      	* scribo/primitive/link/with_single_right_link_dmax_ratio.hh,
      	* scribo/primitive/link/with_single_up_link.hh: Introduce the
      	anchor concept and make use of it.
      3894a51d
    • Guillaume Lazzara's avatar
    • Guillaume Lazzara's avatar
    • Guillaume Lazzara's avatar
      Add dedicated routines for AFP's use case. · b31f2f59
      Guillaume Lazzara authored
      	* scribo/src/afp/components.hh,
      	* scribo/src/afp/link.hh,
      	* scribo/src/afp/regroup.hh: New.
      b31f2f59
    • Guillaume Lazzara's avatar
      Add new tools in Scribo. · 9fca6595
      Guillaume Lazzara authored
      	* src/preprocessing/Makefile.am,
      	* src/filter/Makefile.am,
      	* src/debug/Makefile.am: Add new targets.
      
      	* src/debug/show_info_median_inter_characters.cc,
      	* src/debug/show_info_x_height.cc,
      	* src/debug/show_links_single_down.cc,
      	* src/debug/show_links_single_down_left_aligned.cc,
      	* src/debug/show_links_single_down_right_aligned.cc,
      	* src/debug/show_links_single_up.cc,
      	* src/debug/show_links_single_up_left_aligned.cc,
      	* src/debug/show_links_single_up_right_aligned.cc,
      	* src/filter/objects_with_holes.cc,
      	* src/filter/objects_with_holes_pgm.cc,
      	* src/pbm_lines_in_doc.cc,
      	* src/preprocessing/split_bg_fg_ms.cc,
      	* src/text_in_article.cc,
      	* src/text_in_photo_ppm_fast.cc: New tools.
      
      	* src/debug/show_left_right_links_validation.cc: Rename as...
      	* src/debug/show_links_left_right_links_validation.cc: ...this.
      
      	* src/debug/show_links_bbox_h_ratio.cc: Add a missing argument.
      9fca6595
    • Guillaume Lazzara's avatar
      619f727a
    • Guillaume Lazzara's avatar
      Cleanup and avoid warnings in Sauvola related files. · ca034dd5
      Guillaume Lazzara authored
      	* scribo/binarization/sauvola_ms.hh,
      	* scribo/binarization/sauvola_threshold.hh,
      	* scribo/canvas/integral_browsing.hh,
      	* scribo/src/binarization/sauvola_ms.cc,
      	* scribo/src/binarization/sauvola_pgm.cc,x
      	* scribo/subsampling/integral_single_image.hh: Cleanup and avoir
      	warnings.
      ca034dd5
    • Guillaume Lazzara's avatar
      7c60810a
    • Guillaume Lazzara's avatar
      Add a new test for object_image. · 07c83125
      Guillaume Lazzara authored
      	* tests/Makefile.am,
      	* tests/core/Makefile.am: Update build system.
      
      	* tests/core/object_image.cc: New test.
      07c83125
    • Guillaume Lazzara's avatar
    • Guillaume Lazzara's avatar
      Fix object links filters. · 3151875d
      Guillaume Lazzara authored
      	* filter/object_links_bottom_aligned.hh,
      	* filter/object_links_center_aligned.hh,
      	* filter/object_links_non_aligned_simple.hh,
      	* filter/object_links_top_aligned.hh: Pass the proper dimension as
      	routine argument.
      3151875d
    • Guillaume Lazzara's avatar
      Cleanup Sauvola's binarization code. · 74ae8cb3
      Guillaume Lazzara authored
      	* binarization/sauvola_threshold.hh,
      	* binarization/sauvola.hh: Use fun::v2v::rgb_to_int_u8.
      
      	* binarization/sauvola_ms.hh: New. Sauvola multi-scale routine.
      
      	* src/binarization/sauvola.cc: Make the window size a program
      	argument.
      
      	* src/binarization/sauvola_ms.cc: Use Sauvola multi-scale routine.
      74ae8cb3
    • Guillaume Lazzara's avatar
    • Guillaume Lazzara's avatar
      Improve linking routines. · 906f2366
      Guillaume Lazzara authored
      	* core/anchors.hh: New. Add anchor types.
      
      	* filter/objects_thin.hh: Use filter::internal::compute.
      
      	* primitive/link/internal/find_several_links.hh,
      	* primitive/link/internal/find_link.hh,
      	* primitive/link/compute.hh: Update functor interface in order to
      	specify anchors.
      
      	* primitive/link/compute_several.hh: Fix an invalid namespace.
      
      	* primitive/link/internal/anchors_3.hh: Move...
      
      	* primitive/link/internal/compute_anchor.hh: ... here.
      
      	* primitive/link/internal/link_functor_base.hh: Use anchor type.
      
      	* primitive/link/internal/link_several_dmax_base.hh: New.
      
      	* primitive/link/internal/link_center_dmax_base.hh,
      	* primitive/link/internal/link_center_dmax_ratio_base.hh: Removed.
      
      	* primitive/link/with_several_right_links_overlap.hh: Fix includes.
      
      	* primitive/link/with_single_right_link_bottom.hh,
      	* primitive/link/with_single_right_link_top.hh,
      	* primitive/link/with_single_left_link.hh,
      	* primitive/link/with_single_right_link.hh: Use
      	link_single_dmax_base functor.
      
      	* src/debug/show_links_several_right_overlap.cc,
      	* src/debug/show_links_single_left.cc,
      	* src/debug/show_links_single_left_dmax_ratio.cc,
      	* src/debug/show_links_single_right.cc,
      	* src/debug/show_links_single_right_dmax_ratio.cc: Update functor
      	interface.
      906f2366
    • Guillaume Lazzara's avatar
      Add rbg_to_int_u function. · f7773bdb
      Guillaume Lazzara authored
      	* mln/fun/v2v/all.hh: Include the new header.
      
      	* mln/fun/v2v/rgb_to_int_u.hh: New.
      f7773bdb
    • Guillaume Lazzara's avatar
      Add an antialiased subsampling. · 97aadbd7
      Guillaume Lazzara authored
      	* mln/subsampling/antialiased.hh: New.
      97aadbd7