Leptonica --> tesseract --> OpenCV

=== 26/05/2017更 ===

  • The static drawing function static void DisplayBoxVector [tabfind.cpp] does draw different colours other than ScrollView::WHITE depending on blob types
  • TabFind::FindInitialTabVectors gets called TWICE, hence produces two sets of debugging windows:
    • ”VerticalLines”
    • “InitialTabs”
  • For 1st "InitialTabs" window, only white boxes are drawn via above DisplayBoxVector
  • For 2nd "InitialTabs" window, colour boxes will be drawn first, conforming to BLOBNBOX::TextlineColor colour scheme
  • For both cases, the box edges will be rendered based on Box Tab types

====================

  • The debugging window “Initial textline Blobs” is drawn through TextlineProjection::PlotGradedBlobs [textord/textlineprojection.cpp] ONLY
  • NOTE the difference between PlotGradedBlobs and TO_BLOCK::plot_graded_blobs
  • It ONLY has three colours:
    • ScrollView::YELLOW: UniquelyVertical
    • ScrollView::RED : bad_box after TextlineProjection::BoxOutOfHTextline
    • ScrollView::BLUE:
// Display the blobs in the window colored according to textline quality.
void TextlineProjection::PlotGradedBlobs(BLOBNBOX_LIST* blobs,
                                         ScrollView* win) {
#ifndef GRAPHICS_DISABLED
  BLOBNBOX_IT it(blobs);
  for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
    BLOBNBOX* blob = it.data();
    const TBOX& box = blob->bounding_box();
    bool bad_box = BoxOutOfHTextline(box, NULL, false);
    if (blob->UniquelyVertical())
      win->Pen(ScrollView::YELLOW);
    else
      win->Pen(bad_box ? ScrollView::RED : ScrollView::BLUE);
    win->Rectangle(box.left(), box.bottom(), box.right(), box.top());
  }
  win->Update();
#endif  // GRAPHICS_DISABLED
}

=== 25/05/2017更 ===

  • The following debugging windows from StrokeWidth::FindInitialPartitions are using mixed colour scheme for displaying blobs
    • ”Initial text chains”
    • “GoodTextline blobs”
    • “Diacritics”
    • “Smoothed blobs”
  • From template<class BBC, class BBC_CLIST, class BBC_C_IT>
    void BBGrid<BBC, BBC_CLIST, BBC_C_IT>::DisplayBoxes
  • Where BBC is initialised as ColPartition [textord/colpartition.cpp]
#ifndef GRAPHICS_DISABLED
// Provides a color for BBGrid to draw the rectangle.
// Must be kept in sync with PolyBlockType.
ScrollView::Color  ColPartition::BoxColor() const {
  if (type_ == PT_UNKNOWN)
    return BLOBNBOX::TextlineColor(blob_type_, flow_);
  return POLY_BLOCK::ColorForPolyBlockType(type_);
}
#endif  // GRAPHICS_DISABLED

=== 23/05/2017更 ===

#ifndef GRAPHICS_DISABLED
/// Returns a color to draw the given type.
ScrollView::Color POLY_BLOCK::ColorForPolyBlockType(PolyBlockType type) {
  // Keep kPBColors in sync with PolyBlockType.
  const ScrollView::Color kPBColors[PT_COUNT] = {
    ScrollView::WHITE,        // Type is not yet known. Keep as the 1st element.
    ScrollView::BLUE,         // Text that lives inside a column.
    ScrollView::CYAN,         // Text that spans more than one column.
    ScrollView::MEDIUM_BLUE,  // Text that is in a cross-column pull-out region.
    ScrollView::AQUAMARINE,   // Partition belonging to an equation region.
    ScrollView::SKY_BLUE,   // Partition belonging to an inline equation region.
    ScrollView::MAGENTA,      // Partition belonging to a table region.
    ScrollView::GREEN,        // Text-line runs vertically.
    ScrollView::LIGHT_BLUE,   // Text that belongs to an image.
    ScrollView::RED,          // Image that lives inside a column.
    ScrollView::YELLOW,       // Image 
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值