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

    打一些文字,然后做训练

    然后识别

  • 相关阅读:
    hi.baidu.com 百度流量统计
    Autofac is designed to track and dispose of resources for you.
    IIS Manager could not load type for module provider 'SharedConfig' that is declared in administration.config
    How to create and manage configuration backups in Internet Information Services 7.0
    定制swagger的UI
    NSwag在asp.net web api中的使用,基于Global.asax
    NSwag Tutorial: Integrate the NSwag toolchain into your ASP.NET Web API project
    JS变量对象详解
    JS执行上下文(执行环境)详细图解
    JS内存空间详细图解
  • 原文地址:https://www.cnblogs.com/wdfrog/p/15016605.html
Copyright © 2011-2022 走看看