代码拉取完成,页面将自动刷新
同步操作将从 xiaodelea/CodeRecognition 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<?xml version="1.0" encoding="UTF-8"?>
<hdevelop file_version="1.0" halcon_version="10.0" cs="-910579354">
<procedure name="main">
<interface/>
<body>
<l>read_image (Image, 'D:/实习/图片/特种兵/C1_94.bmp')</l>
<l>emphasize (Image, ImageEmphasize0, 7, 7, 5)</l>
<l>binomial_filter (ImageEmphasize0, ImageBinomia0, 5, 5)</l>
<l>*median_image (ImageEmphasize0, ImageMedian0, 'circle', 1, 'mirrored')</l>
<l>mean_image (ImageBinomia0, ImageMean0, 5, 5)</l>
<l>dyn_threshold (ImageBinomia0, ImageMean0, Region0, 50, 'light')</l>
<l>*threshold (ImageBinomia0, Region0, 120, 255)</l>
<l>closing_rectangle1 (Region0, RegionClosing00, 10, 20)</l>
<l>closing_rectangle1 (RegionClosing00, RegionClosing0, 30, 10)</l>
<l>closing_circle (RegionClosing0, RegionClosing01, 10)</l>
<l>opening_rectangle1 (RegionClosing01, RegionOpening0, 10, 1)</l>
<l>connection (RegionOpening0, ConnectedRegions0)</l>
<l>select_shape (ConnectedRegions0, SelectedRegions0, ['width','height'], 'and', [160,25], [250,70])</l>
<l>select_shape_std (SelectedRegions0, SelectedRegionsStd0, 'max_area', 70)</l>
<l>count_obj (SelectedRegionsStd0, Number0)</l>
<l>if (Number0 # 1)</l>
<l> return ()</l>
<l>endif</l>
<l>intersection (SelectedRegionsStd0, Region0, RegionIntersection0)</l>
<c>*旋转图像</c>
<l>smallest_rectangle2 (RegionIntersection0, Row0, Column0, Phi0, Length01, Length02)</l>
<l>tuple_deg (Phi0, Deg0)</l>
<l>rotate_image (Image, ImageRotate0, -Deg0, 'constant')</l>
<c>*处理旋转后的图像</c>
<l>emphasize (ImageRotate0, ImageEmphasize01, 7, 7, 5)</l>
<l>binomial_filter (ImageEmphasize01, ImageBinomial01, 5, 5)</l>
<l>*median_image (ImageEmphasize01, ImageMedian01, 'circle', 1, 'mirrored')</l>
<l>mean_image (ImageBinomial01, ImageMean01, 3, 3)</l>
<l>dyn_threshold (ImageBinomial01, ImageMean01, Region01, 20, 'light')</l>
<l>*threshold (ImageBinomial01, Region01, 120, 255)</l>
<l>closing_rectangle1 (Region01, RegionClosing0011, 10, 30)</l>
<l>closing_rectangle1 (RegionClosing0011, RegionClosing011, 30, 10)</l>
<l>closing_circle (RegionClosing011, RegionClosing012, 10)</l>
<l>opening_rectangle1 (RegionClosing012, RegionOpening01, 10, 1)</l>
<l>*closing_circle (Region01, RegionClosing01, 10)</l>
<l>*opening_circle (RegionClosing01, RegionOpening01, 5)</l>
<l>connection (RegionOpening01, ConnectedRegions01)</l>
<l>select_shape (ConnectedRegions01, SelectedRegions01, ['width','height'], 'and', [160,25], [250,70])</l>
<l>select_shape_std (SelectedRegions01, SelectedRegionsStd01, 'max_area', 70)</l>
<l>count_obj (SelectedRegionsStd01, Number01)</l>
<l>if (Number01 # 1)</l>
<l> return ()</l>
<l>endif</l>
<l>intersection (SelectedRegionsStd01, Region01, RegionIntersection01)</l>
<l>smallest_rectangle2 (RegionIntersection01, Row01, Column01, Phi01, Length011, Length012)</l>
<l>RegionPriorWidth:=116</l>
<l>RegionPriorHeight:=62</l>
<c>*第一行****************************</c>
<l>gen_rectangle2 (Rectangle1, Row01, Column01, 0, Length011+4, Length012+4)</l>
<l>reduce_domain (ImageBinomial01, Rectangle1, ImageReduced1)</l>
<l>*mean_image (ImageReduced1, ImageMean1, 5, 5)</l>
<l>*dyn_threshold (ImageReduced1, ImageMean1, Region1, 50, 'light')</l>
<l>threshold (ImageReduced1, Region1, 90, 255)</l>
<l>closing_rectangle1 (Region1, RegionClosing1, 2, 40)</l>
<l>closing_circle (RegionClosing1, RegionClosing11, 3)</l>
<l>connection (RegionClosing11, ConnectedRegions1)</l>
<l>shape_trans (ConnectedRegions1, RegionTrans1, 'rectangle1')</l>
<l>partition_rectangle (RegionTrans1, Partitioned1, 22, 60)</l>
<l>select_shape (Partitioned1, SelectedRegions1, ['width','height'], 'and', [12,35], [28,50])</l>
<l>intersection (SelectedRegions1, Region1, RegionIntersection1)</l>
<c>*选中字符</c>
<c>*排序</c>
<l>sort_region (RegionIntersection1, SortedRegions1, 'first_point', 'true', 'column')</l>
<l>area_center (SortedRegions1, Area1, Row1, Column1)</l>
<l>FontName:='D:/github/CodeRecognition/TezbWords.omc'</l>
<l>read_ocr_class_mlp(FontName, OCRHandle1)</l>
<l>do_ocr_multi_class_mlp (SortedRegions1, ImageRotate0, OCRHandle1, RecNum1, Confidence1)</l>
<c>*第二行***********************</c>
<l>gen_rectangle2 (Rectangle2, Row01+76, Column01, 0, 116, 24)</l>
<l>reduce_domain (ImageBinomial01, Rectangle2, ImageReduced2)</l>
<l>*mean_image (ImageReduced2, ImageMean2, 5, 5)</l>
<l>*dyn_threshold (ImageReduced2, ImageMean2, Region2, 50, 'light')</l>
<l>threshold (ImageReduced2, Region2, 100, 255)</l>
<l>closing_rectangle1 (Region2, RegionClosing2, 2, 40)</l>
<l>closing_circle (RegionClosing2, RegionClosing21, 3.5)</l>
<l>connection (RegionClosing21, ConnectedRegions2)</l>
<l>shape_trans (ConnectedRegions2, RegionTrans2, 'rectangle1')</l>
<l>partition_rectangle (RegionTrans2, Partitioned2, 22, 60)</l>
<l>select_shape (Partitioned2, SelectedRegions2, ['width','height'], 'and', [12,35], [28,50])</l>
<l>intersection (SelectedRegions2, Region2, RegionIntersection2)</l>
<c>*选中字符</c>
<c>*排序</c>
<l>sort_region (RegionIntersection2, SortedRegions2, 'first_point', 'true', 'column')</l>
<l>area_center (SortedRegions2, Area2, Row2, Column2)</l>
<c>*识别</c>
<l>read_ocr_class_mlp(FontName, OCRHandle2)</l>
<l>do_ocr_multi_class_mlp (SortedRegions2, ImageRotate0, OCRHandle2, RecNum2, Confidence2)</l>
<c>*显示识别结果</c>
<l>set_display_font (3600, 27, 'mono', 'true', 'false')</l>
<l>for i := 0 to |RecNum1| - 1 by 1</l>
<l> disp_message (3600, RecNum1[i], 'image', Row1[i],Column1[i], 'white', 'false')</l>
<l>endfor</l>
<l>for i := 0 to |RecNum2| - 1 by 1</l>
<l> disp_message (3600, RecNum2[i], 'image', Row2[i],Column2[i], 'white', 'false')</l>
<l>endfor</l>
</body>
<docu id="main">
<parameters/>
</docu>
</procedure>
</hdevelop>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。