遗忘海岸

江湖程序员 -Feiph(LM战士)

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

中文识别

复制代码
read_image (Image, '中文.png')
binary_threshold (Image, Region, 'max_separability', 'dark', UsedThreshold)
dilation_circle (Region, RegionDilation, 1)
connection (RegionDilation, ConnectedRegions2)
intersection ( ConnectedRegions2,Region, RegionIntersection)
sort_region (RegionIntersection, SortedRegions, 'character', 'true', 'row')

* Str :='这意味着在进一步的操作中图像矩阵包含所有像素'
* Fonts:=['','','','','','','','','','','','','','','','','','','','','','']
* classes:=[]
* for Index := 1 to 8 by 1
*     classes:=[classes,Fonts]
* endfor

* write_ocr_trainf (SortedRegions, Image, classes, '中文_ocr')
*read_ocr_trainf (Characters, '中文_ocr', CharacterNames)
* read_ocr_trainf_names ('中文_ocr', CharacterNames, CharacterCount)
* create_ocr_class_mlp (8, 10, 'constant', 'default',CharacterNames, 80, 'none', 10, 42, OCRHandle)
* trainf_ocr_class_mlp (OCRHandle, '中文_ocr', 200, 1, 0.01, Error, ErrorLog)
* write_ocr_class_mlp (OCRHandle, '中文_ocr')
read_ocr_class_mlp ('中文_ocr', OCRHandle)
read_image (Image2, '中文目标.png')
* vector_angle_to_rigid (200, 200, 0, 200, 200, rad(45), HomMat2D)
* affine_trans_image (Image2, ImageAffineTrans, HomMat2D, 'constant', 'false')

binary_threshold (Image2, Region2, 'max_separability', 'dark', UsedThreshold)
dilation_circle (Region2, RegionDilation2, 1)
connection (RegionDilation2, ConnectedRegions3)
intersection ( ConnectedRegions3,Region2, RegionIntersection2)
sort_region (RegionIntersection2, SortedRegions2, 'character', 'true', 'row')
do_ocr_multi_class_mlp (SortedRegions2, Image2, OCRHandle, Class, Confidence)
area_center (SortedRegions2, Area, Row, Column)
tuple_length (Row, Length)
phi:=gen_tuple_const(Length,0.0)
L1:=gen_tuple_const(Length,20)
L2:=gen_tuple_const(Length,20)
smallest_rectangle2 (SortedRegions2, Row1, Column1, Phi2, Length1, Length2)
gen_rectangle2_contour_xld (Rectangle1, Row1, Column1, Phi2, Length1 , Length2)
set_display_font (200000, 16, 'sans', 'true', 'false')
disp_message (200000, Class, 'window', Row-10, Column+2, 'black', 'true')
clear_ocr_class_mlp (OCRHandle)
View Code
复制代码

打一些文字,然后做训练

然后识别

posted on   遗忘海岸  阅读(59)  评论(0编辑  收藏  举报

编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· .NET周刊【3月第1期 2025-03-02】
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· [AI/GPT/综述] AI Agent的设计模式综述
历史上的今天:
2011-07-15 生成随机密码
2009-07-15 Asp.net(C#) 输出Xml格式数据---Rss生成
点击右上角即可分享
微信分享提示