- OCR训练
- Training of the OCR
*字体在"bottle.hdev"项目中用过 - The font is used in “bottle.hdev”
- 第0步:准备工作
- Step 0: Preparations
FontName := ‘bottle’ - 第1步:分割
- Step 1: Segmentation
*关闭窗体更新
dev_update_window (‘off’)
*读取图像
read_image (Bottle, ‘bottle2’)
*获取图像尺寸
get_image_size (Bottle, Width, Height)
*关闭窗体
dev_close_window ()
*打开窗体
dev_open_window (0, 0, 2 * Width, 2 * Height, ‘black’, WindowID)
*设置显示字体
set_display_font (WindowID, 27, ‘mono’, ‘true’, ‘false’)
*阈值分割
threshold (Bottle, RawSegmentation, 0, 95)
*填充阈值分割的区域
fill_up_shape (RawSegmentation, RemovedNoise, ‘area’, 1, 5)
*开运算:先腐蚀后膨胀,去除小连接的斑点
opening_circle (RemovedNoise, ThickStructures, 2.5)
*填充
fill_up (ThickStructures, Solid)
*以矩形算子做开运算
opening_rectangle1 (Solid, Cut, 1, 7)
*联通区域
connection (
Blob分析之bottlet.hdev
最新推荐文章于 2024-03-06 21:30:28 发布
本文档详细介绍了如何使用Blob分析进行图像分割,并通过步骤演示了OCR训练过程,包括字体预处理、区域选择、训练文件生成及训练。具体操作涉及阈值分割、开运算、联通区域等图像处理技术,以及append_ocr_trainf、trainf_ocr_class_mlp等OCR训练函数。
摘要由CSDN通过智能技术生成