zoukankan      html  css  js  c++  java
  • 中文识别

    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

    打一些文字,然后做训练

    然后识别

  • 相关阅读:
    cocos2D-X 4.0 build
    Boost Download
    史上最全的CSS hack
    web前端js中ES6的规范写法
    爬虫最终杀手锏 --- PhantomJS 详解(附案例)
    移动端300ms延迟的解决方法
    js动态生成html元素并为元素追加属性
    css中border-sizing属性详解和应用
    纯CSS实现Tab切换
    阻止移动端浏览器点击图片会预览的几种方法
  • 原文地址:https://www.cnblogs.com/wdfrog/p/15016605.html
Copyright © 2011-2022 走看看