MCPcopy Create free account
hub / github.com/creatale/node-dv / StrongEvidenceClassify

Function StrongEvidenceClassify

deps/tesseract/ccmain/paragraphs.cpp:1995–2023  ·  view source on GitHub ↗

We examine rows[row_start, row_end) and do the following: (1) Clear all existing hypotheses for the rows being considered. (2) Mark up any rows as exceptionally likely to be paragraph starts or paragraph body lines as such using both geometric and textual clues. (3) Form models for any sequence of start + continuation lines. (4) Smear the paragraph models to cover surrounding text.

Source from the content-addressed store, hash-verified

1993// (3) Form models for any sequence of start + continuation lines.
1994// (4) Smear the paragraph models to cover surrounding text.
1995void StrongEvidenceClassify(int debug_level,
1996 GenericVector<RowScratchRegisters> *rows,
1997 int row_start, int row_end,
1998 ParagraphTheory *theory) {
1999 if (!AcceptableRowArgs(debug_level, 2, __func__, rows, row_start, row_end))
2000 return;
2001
2002 if (debug_level > 1) {
2003 tprintf("#############################################\n");
2004 tprintf("# StrongEvidenceClassify( rows[%d:%d) )\n", row_start, row_end);
2005 tprintf("#############################################\n");
2006 }
2007
2008 RecomputeMarginsAndClearHypotheses(rows, row_start, row_end, 10);
2009 MarkStrongEvidence(rows, row_start, row_end);
2010
2011 DebugDump(debug_level > 2, "Initial strong signals.", *theory, *rows);
2012
2013 // Create paragraph models.
2014 ModelStrongEvidence(debug_level, rows, row_start, row_end, false, theory);
2015
2016 DebugDump(debug_level > 2, "Unsmeared hypotheses.s.", *theory, *rows);
2017
2018 // At this point, some rows are marked up as paragraphs with model numbers,
2019 // and some rows are marked up as either LT_START or LT_BODY. Now let's
2020 // smear any good paragraph hypotheses forward and backward.
2021 ParagraphModelSmearer smearer(rows, row_start, row_end, theory);
2022 smearer.Smear();
2023}
2024
2025void SeparateSimpleLeaderLines(GenericVector<RowScratchRegisters> *rows,
2026 int row_start, int row_end,

Callers 1

DetectParagraphsFunction · 0.85

Calls 6

AcceptableRowArgsFunction · 0.85
MarkStrongEvidenceFunction · 0.85
DebugDumpFunction · 0.85
ModelStrongEvidenceFunction · 0.85
SmearMethod · 0.80

Tested by

no test coverage detected