Foxit PDF SDK
foxit::addon::ocr::OCRConfig类 参考

继承自 Object .

Public 成员函数

 OCRConfig ()
 构造函数。
 
 OCRConfig (bool is_detect_pictures, bool is_remove_noise, bool is_correct_skew, bool is_enable_text_extraction_mode, bool is_sequentially_process, bool is_auto_overwrite_resolution, int resolution_to_overwrite, int confidence)
 带参数的构造函数。 更多...
 
bool operator!= (const OCRConfig &other)
 不等于操作符。 更多...
 
OCRConfigoperator= (const OCRConfig &other)
 赋值操作符。 更多...
 
void Set (bool is_detect_pictures, bool is_remove_noise, bool is_correct_skew, bool is_enable_text_extraction_mode, bool is_sequentially_process, bool is_auto_overwrite_resolution, int resolution_to_overwrite, int confidence)
 设置值。 更多...
 

Public 属性

int confidence
 用于判断识别文本是否可靠的置信度阈值。 更多...
 
bool is_auto_overwrite_resolution
 决定是否自动设置分辨率。 更多...
 
bool is_correct_skew
 决定是否启用偏斜校正。true 表示启用偏斜校正。 false 表示不启用偏斜校正。 默认值:true更多...
 
bool is_detect_pictures
 决定是否检测图片。true 表示在分析过程中将检测图片。 false 表示不检测图片,PDF文档图像上的图片内容可能被解释为文本。 如果您只想从图像中提取文本,可以将此选项设置为 false。 默认值:true
 
bool is_enable_text_extraction_mode
 决定是否启用文本提取模式。 更多...
 
bool is_remove_noise
 决定是否去除PDF图像的噪声。如果PDF图像包含一些噪声,比如随机的黑点或斑点,这可能很有用。 如果图像上字母的线条很细,应将此选项设置为 false,否则会影响文本的识别。 true 表示图像中的噪声在OCR过程中不会被识别。噪声不会被识别为文本。 false 表示不阻止噪声。 默认值:true
 
bool is_sequentially_process
 决定OCR引擎是否在一个进程上顺序处理页面。 更多...
 
int resolution_to_overwrite
 用于覆盖 PDF 文档图像分辨率的分辨率值(DPI)。 更多...
 

详细描述

此类表示用于OCR的配置。

构造及析构函数说明

◆ OCRConfig()

foxit::addon::ocr::OCRConfig::OCRConfig ( bool  is_detect_pictures,
bool  is_remove_noise,
bool  is_correct_skew,
bool  is_enable_text_extraction_mode,
bool  is_sequentially_process,
bool  is_auto_overwrite_resolution,
int  resolution_to_overwrite,
int  confidence 
)
inline

带参数的构造函数。

参数
[in]is_detect_pictures决定是否检测图片。
[in]is_remove_noise决定是否去除PDF图像的噪声。
[in]is_correct_skew决定是否启用偏斜校正。
[in]is_enable_text_extraction_mode决定是否启用文本提取模式。
[in]is_sequentially_process决定OCR引擎是否在一个进程上顺序处理页面。
[in]is_auto_overwrite_resolution决定是否自动覆盖(重写)分辨率。
[in]resolution_to_overwrite要覆盖(重写)的分辨率。 这个参数只有当 is_auto_overwrite_resolution 设置为 false 有效。
[in]confidence用于判断识别文本是否可靠的置信度阈值。值范围从0到100。

成员函数说明

◆ operator!=()

bool foxit::addon::ocr::OCRConfig::operator!= ( const OCRConfig other)
inline

不等于操作符。

参数
[in]other另一个OCR配置对象。此函数将检查当前对象是否不等于此对象。
返回
true 表示不相等,而 false 表示相等。

◆ operator=()

OCRConfig& foxit::addon::ocr::OCRConfig::operator= ( const OCRConfig other)
inline

赋值操作符。

参数
[in]other另一个OCR配置对象,其值将被分配给当前对象。
返回
对当前对象本身的引用。

◆ Set()

void foxit::addon::ocr::OCRConfig::Set ( bool  is_detect_pictures,
bool  is_remove_noise,
bool  is_correct_skew,
bool  is_enable_text_extraction_mode,
bool  is_sequentially_process,
bool  is_auto_overwrite_resolution,
int  resolution_to_overwrite,
int  confidence 
)
inline

设置值。

参数
[in]is_detect_pictures决定是否检测图片。
[in]is_remove_noise决定是否去除PDF图像的噪声。
[in]is_correct_skew决定是否启用偏斜校正。
[in]is_enable_text_extraction_mode决定是否启用文本提取模式。
[in]is_sequentially_process决定OCR引擎是否在一个进程上顺序处理页面。
[in]is_auto_overwrite_resolution决定是否自动覆盖(重写)分辨率。
[in]resolution_to_overwrite要覆盖(重写)的分辨率。 这个参数只有当 is_auto_overwrite_resolution 设置为 false 有效。
[in]confidence用于判断识别文本是否可靠的置信度阈值。值范围从0到100。
返回
无返回值。

类成员变量说明

◆ confidence

int foxit::addon::ocr::OCRConfig::confidence

用于判断识别文本是否可靠的置信度阈值。

取值范围为 [0, 100]。数值越大,对识别结果的置信度要求越高。 例如,如果该值设置为 30,则置信度低于 30 的识别文本将被视为不可靠文本,并会被移除。 默认值: 0。

◆ is_auto_overwrite_resolution

bool foxit::addon::ocr::OCRConfig::is_auto_overwrite_resolution

决定是否自动设置分辨率。

true 表示 OCR 引擎会自动检测并覆盖图像分辨率。 false 表示通过参数 resolution_to_overwrite 手动设置分辨率。

◆ is_correct_skew

bool foxit::addon::ocr::OCRConfig::is_correct_skew

决定是否启用偏斜校正。true 表示启用偏斜校正。 false 表示不启用偏斜校正。 默认值:true

注解
偏斜校正只能针对不超过20度的角度进行校正。

◆ is_enable_text_extraction_mode

bool foxit::addon::ocr::OCRConfig::is_enable_text_extraction_mode

决定是否启用文本提取模式。

通常,当某些文本部分没有被发现为文本块(如图片上的文本或手写文本)时, 建议将此参数设置为 true。 如果图片的完整文本被正确识别,或者样本包含可能被认为和识别为文本的图像或图案, 建议将此参数设置为 false。 简而言之,此参数使引擎能够识别所有远程接近字母的内容为文本。 true 表示启用文本提取模式,而 false 表示不启用文本提取模式。 默认值:false

◆ is_sequentially_process

bool foxit::addon::ocr::OCRConfig::is_sequentially_process

决定OCR引擎是否在一个进程上顺序处理页面。

此参数仅在OCR转换中使用。true 表示OCR引擎将在一个进程上顺序处理页面, 转换时间将增加。
false 表示OCR引擎将自动检测进程数。如果只处理一个页面或系统中只有一个处理器, 则使用一个进程。否则,使用并行处理。
默认值:false

◆ resolution_to_overwrite

int foxit::addon::ocr::OCRConfig::resolution_to_overwrite

用于覆盖 PDF 文档图像分辨率的分辨率值(DPI)。

该参数仅在 is_auto_overwrite_resolution 设置为 false 时有效。 默认值: 300。