Chinese Simplified (简体中文)

微调页面预处理、分析、识别和合成参数

Note: Some parts of this article may be in English. We apologize for the inconvenience and are working on adding the translation as soon as possible.

ABBYY FineReader Engine 中的文档处理包括几个步骤:页面预处理、分析、识别、页面合成、文档合成和导出。本节将关注页面预处理、分析、识别和页面及文档合成参数。要了解导出参数详情,请参见 导出参数调整

Let's consider the processing stages in order:

  1. Page preprocessing
    During this stage, FineReader Engine automatically improves image quality and corrects defects that can interfere with OCR: page orientation, inverted images, and geometrical distortions.
  2. Layout analysis
    During analysis, FineReader Engine finds areas that contain different types of data. These areas are called "blocks."
  3. Recognition
    Parts of the image that lie inside the blocks are recognized in ways that depend on the block type.
  4. Page synthesis
    The text and background colors, hyperlinks, and other formatting are detected.
  5. Document synthesis
    Finally, the font styles and document logical structure are recreated: FineReader Engine detects headings in the recognized document, reconstructs the table of contents, detects captions to pictures and tables, and other elements of document structure.

处理前,您可以借助参数对象来设置页面预处理、分析、识别和合成参数。DocumentProcessingParams 对象提供对所有处理参数的访问。该对象含有一个子对象集,对不同处理阶段产生影响。

根据处理阶段的不同,可以将指向DocumentProcessingParams 对象的指针或其子对象指针可以作为输入参数传递至处理方法,从而影响处理结果。以下 FineReader Engine 对象可提供页面预处理、分析、识别和合成方法:FRDocumentFRPage

也可以使用配置文件调整页面预处理、分析、识别和合成进程。请参见 配置文件的处理 了解详情。

页面预处理参数

若要设置每个页面的处理参数,您需要调整 DocumentProcessingParams 对象的 PageProcessingParams 子对象的属性。PageProcessingParams 对象是设置页面处理参数的对象组的父对象:

The PageProcessingParams object also allows you to turn on or off any of the processing stages. For example, you can set the PerformAnalysis property of the PageProcessingParams object to FALSE if you intend to specify the blocks manually and don't need layout analysis.

文档处理参数

若要设置文档处理参数,您应该设置页面处理参数(请见上文)和文档合成参数,它们可通过 SynthesisParamsForDocument 对象进行设置。文档合成期间会检测字体样式和格式化。处理文档字体和样式的 FineReader Engine 对象只有在文档合成后才有意义。

在以下情况下您可以省略文档合成阶段:

  • 如果要将已识别文本导出为 TXT 格式。导出到该模式时不使用合成信息。
  • 如果要将文档导出为 PDF ImageOnly 格式。在此模式中不使用已识别文本和布局信息。

在所有其它情况下,必须执行文档合成。省略文档合成将导致导出过程中出现错误。

注: 名称中出现单词"Process"的方法(例如 IFRDocument::Process)包括文档合成阶段。FRPage 对象的处理方法不包括该阶段,所以在使用它们后和导出前,您必须显式调用一些执行文档合成的方法。

可以加快文档合成阶段,减少内存使用。如果在页面合成期间将 SynthesisParamsForPage 对象的 DetectFontFormattingAtPageLevel 属性设为 TRUE,则可以在文档合成期间关闭字体参数和文档结构检测(SynthesisParamsForDocument 对象的 DetectFontFormatting DetectDocumentStructure)。但文档质量会降低。

每次文档的文本或布局被更改(例如块被删除或添加,或者文本被编辑)时,我们建议您重新调用文档合成方法。注意 FRDocument SynthesizePages 方法允许您指定已更改文档的页面集合,因此只会重新计算必要的数据。

调整文档处理

使用上述参数对象的详细过程如下所示:

  1. 借助 Engine 对象的 CreateDocumentProcessingParams 方法创建一个 DocumentProcessingParams 对象。
  2. 设置 PageProcessingParams 子对象的必要属性。您不需要设置所有子对象的所有属性,因为创建时它们已初始化为了合理的默认值。您只需要调整默认值中个别需要调整的属性即可。

设置布局分析函数要使用的参数时,不要忘记设置影响识别的 PageProcessingParams 的子对象属性的正确值。之所以建议如此操作,是因为所有这些参数都会复制到布局分析期间创建的块中,然后用于识别,另外,图像某些部分的分析可能会涉及识别。

  1. 必要的话,设置 SynthesisParamsForDocument 子对象的必需属性。您不需要设置所有对象和子对象的全部属性,因为创建时它们已初始化为了合理的默认值。您只需要调整默认值中个别需要调整的属性即可。请确认 DocumentProcessingParams 对象的 PerformSynthesis 属性的值为 true
  2. 您可以将 DocumentProcessingParams 对象或其子对象集传递到任意一个 FRDocument, FRPageEngine 对象的处理方法。

我们建议使用 FRDocument 对象的处理方法来识别文档。该方法可提供一整套处理方法。最方便的方法为 Process 方法,仅使用一个方法就可以进行预处理、分析、识别和合成的。该方法也可以最高效地使用多处理器和多核系统的同时处理功能。不过,您也可以使用相应方法执行连续预处理、分析、识别和合成。

用于设置处理参数的示例代码:

C# 代码

以下代码示例中具有类似的过程:CustomLanguageVisualComponents;和演示工具:MultiProcessingRecognition, PDFExportProfiles

另请参阅

配置文件的处理

识别条形码

导出参数调整

11/7/2025 12:48:30 PM

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.