1 Star 1 Fork 2

wxzhouq/CodeRecognition

forked from xiaodelea/CodeRecognition 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
tzbLI-1112.hdev 3.95 KB
一键复制 编辑 原始数据 按行查看 历史
朱为 提交于 2018-11-13 11:34 . 修改特种兵相关文件
<?xml version="1.0" encoding="UTF-8"?>
<hdevelop file_version="1.0" halcon_version="10.0" cs="-766247589">
<procedure name="main">
<interface/>
<body>
<l>read_image (Image, 'D:/实习/图片/1112/新建文件夹1/29.bmp')</l>
<l>dots_image (Image, DotImage, 5, 'dark', 2)</l>
<l>threshold (DotImage, Region, 110, 255)</l>
<l>dilation_circle (Region, RegionDilation, 2.5)</l>
<l>closing_rectangle1 (RegionDilation, RegionClosing, 3, 3)</l>
<l>connection (RegionClosing, ConnectedRegions)</l>
<l>select_shape (ConnectedRegions, SelectedRegions, ['width','height'], 'and', [15,15], [80,80])</l>
<l>union1 (SelectedRegions, RegionUnion)</l>
<l>closing_rectangle1 (RegionUnion, RegionClosing2, 30, 20)</l>
<l>connection (RegionClosing2, ConnectedRegions2)</l>
<l>select_shape (ConnectedRegions2, SelectedRegions5, 'area', 'and', 10000, 20000)</l>
<c></c>
<l>intersection (Region, SelectedRegions5, RegionIntersection)</l>
<l>smallest_rectangle2 (RegionIntersection, Row, Column, Phi, Length1, Length2)</l>
<l>hom_mat2d_identity (HomMat2DIdentity)</l>
<l>hom_mat2d_rotate (HomMat2DIdentity, -Phi, Column, Row, HomMat2DRotate)</l>
<l>affine_trans_region (RegionIntersection, RegionAffineTrans1, HomMat2DRotate, 'true')</l>
<l>affine_trans_image (Image, rotateImage, HomMat2DRotate, 'bilinear', 'false')</l>
<l>dilation_circle (RegionAffineTrans1, RegionDilation1, 2.5)</l>
<l>closing_rectangle1 (RegionDilation1, RegionClosing1, 3, 3)</l>
<l>opening_circle (RegionClosing1, RegionOpening, 2.5)</l>
<l>connection (RegionOpening, ConnectedRegions1)</l>
<l>area_center (RegionAffineTrans1, Area, Row1, Column1)</l>
<c></c>
<l>select_shape (ConnectedRegions1, SelectedRegions1, 'row', 'and', Row1-30, Row1)</l>
<l>shape_trans (SelectedRegions1, RegionTrans, 'rectangle1')</l>
<l>partition_dynamic (RegionTrans, Partitioned, 30, 20)</l>
<l>select_shape (Partitioned, SelectedRegions2, 'height', 'and', 25, 48)</l>
<l>intersection (SelectedRegions2, RegionAffineTrans1, RegionIntersection1)</l>
<l>sort_region (RegionIntersection1, SortedRegions1, 'first_point', 'true', 'column')</l>
<l>area_center (SortedRegions1, Area11, Row11, Column11)</l>
<l>count_obj (SortedRegions1, Number1)</l>
<l>*FontFile:='D:/github/CodeRecognition/tzb1112.omc'</l>
<l>read_ocr_class_mlp ('C:/Program Files/MVTec/HALCON-10.0/ocr/DotPrint_0-9A-Z.omc', OCRHandle)</l>
<l>do_ocr_multi_class_mlp (SortedRegions1, rotateImage, OCRHandle, Chars1, Confidence1)</l>
<c></c>
<l>select_shape (ConnectedRegions1, SelectedRegions3, 'row', 'and', Row1, Row1+40)</l>
<l>shape_trans (SelectedRegions3, RegionTrans1, 'rectangle1')</l>
<l>partition_dynamic (RegionTrans1, Partitioned1, 30, 1)</l>
<l>select_shape (Partitioned1, SelectedRegions4, 'height', 'and', 25, 48)</l>
<l>intersection (SelectedRegions4, RegionAffineTrans1, RegionIntersection2)</l>
<l>sort_region (RegionIntersection2, SortedRegions2, 'first_point', 'true', 'column')</l>
<l>area_center (SortedRegions2, Area12, Row12, Column12)</l>
<l>count_obj (SortedRegions2, Number2)</l>
<l>do_ocr_multi_class_mlp (SortedRegions2, rotateImage, OCRHandle, Chars2, Confidence2)</l>
<c></c>
<l>*word:=['d']</l>
<l>*TrainFile:='D:/github/CodeRecognition/tzb1112.trf'</l>
<l>*dev_set_check('~give_error') </l>
<l>*delete_file(TrainFile) </l>
<l>*dev_set_check('~give_error')</l>
<l>*for i:=7 to Number2 by 1 </l>
<l>* select_obj(SortedRegions2, SingleWord, i) </l>
<l>* append_ocr_trainf(SingleWord,rotateImage,word,TrainFile) </l>
<l>*endfor</l>
<l>*read_ocr_trainf_names(TrainFile, CharacterNames, CharacterCount)</l>
<l>*trainf_ocr_class_mlp (OCRHandle, TrainFile, 200, 1, 0.01, Error, ErrorLog)</l>
<l>*write_ocr_class_mlp (OCRHandle, FontFile)</l>
<c></c>
<c>*120, 68, 147, 183, 188, 0, 0, 107, 162, 197, 138, 0, 123</c>
<c>*120, 68, 147, 183, 146, 202, 0, 107, 162, 197, 138, 169, 123</c>
<l>dev_clear_window ()</l>
<l>dev_display (Image)</l>
<l>dev_set_color ('blue')</l>
<l>dev_display (SortedRegions1)</l>
<l>dev_display (SortedRegions2)</l>
<c></c>
</body>
<docu id="main">
<parameters/>
</docu>
</procedure>
</hdevelop>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zxfsc/CodeRecognition.git
git@gitee.com:zxfsc/CodeRecognition.git
zxfsc
CodeRecognition
CodeRecognition
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385