{"id":54615,"date":"2025-08-13T08:30:12","date_gmt":"2025-08-13T00:30:12","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/54615.html"},"modified":"2025-08-13T08:30:12","modified_gmt":"2025-08-13T00:30:12","slug":"c%e8%81%94%e5%90%88halcon%e8%bf%9b%e8%a1%8cocr%e5%ad%97%e7%ac%a6%e8%af%86%e5%88%ab%ef%bc%88%e5%90%abhalcon-25-05-%e7%99%be%e5%ba%a6%e7%bd%91%e7%9b%98%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/54615.html","title":{"rendered":"c#\u8054\u5408Halcon\u8fdb\u884cOCR\u5b57\u7b26\u8bc6\u522b\uff08\u542bhalcon-25.05 \u767e\u5ea6\u7f51\u76d8\uff09"},"content":{"rendered":"<h2>1.\u4e0b\u8f7d\u5b89\u88c5halcon<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1248\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813003001-689bdc896b612.png\" width=\"1740\" \/><\/p>\n<p>\u901a\u8fc7\u7f51\u76d8\u5206\u4eab\u7684\u6587\u4ef6&#xff1a;halcon-25.05.0.0-x64-win64 \u94fe\u63a5: https:\/\/pan.baidu.com\/s\/1XAx-8ZQM-ZHkgHIc-dhCYw<\/p>\n<\/p>\n<p>\u63d0\u53d6\u7801: whek<\/p>\n<\/p>\n<h2>2.c#\u73af\u5883\u914d\u7f6e<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"345\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813003002-689bdc8acc456.png\" width=\"518\" \/><\/p>\n<p>\u521b\u5efatest_halcon_ocr\u9879\u76ee<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"876\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813003003-689bdc8b68d25.png\" width=\"1597\" \/><\/p>\n<\/p>\n<p>\u627e\u5230halcon\u7684\u5b89\u88c5\u8def\u5f84<\/p>\n<p>\u6211\u7684&#xff1a; D:\\\\halcon\\\\HALCON-25.05-Progress\\\\bin\\\\x64-win64 D:\\\\halcon\\\\HALCON-25.05-Progress\\\\bin\\\\dotnet35<\/p>\n<\/p>\n<p>\u6dfb\u52a0\u5f15\u7528&#xff08;&#034;D:\\\\halcon\\\\HALCON-25.05-Progress\\\\bin\\\\dotnet35\\\\halcondotnet.dll&#034;&#xff09;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1213\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813003004-689bdc8c12ce2.png\" width=\"1882\" \/><\/p>\n<\/p>\n<p>\u628ahalcondotnet.dll\u62d6\u5230\u5de5\u5177\u7bb1\u4e2d\u3002<\/p>\n<p>\u5c4f\u5e55\u5f55\u5236 2025-08-12 103356<\/p>\n<\/p>\n<p>\u6dfb\u52a0HWindowcontrol &#xff0c;button \u548c textbox<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1158\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813003005-689bdc8d58266.png\" width=\"2019\" \/><\/p>\n<\/p>\n<p>\u8bbe\u7f6ebutton1 \u70b9\u51fb\u4e8b\u4ef6<\/p>\n<p>using System;<br \/>\nusing System.Collections.Generic;<br \/>\nusing System.ComponentModel;<br \/>\nusing System.Data;<br \/>\nusing System.Drawing;<br \/>\nusing System.IO;<br \/>\nusing System.Linq;<br \/>\nusing System.Text;<br \/>\nusing System.Threading.Tasks;<br \/>\nusing System.Windows.Forms;<br \/>\nusing HalconDotNet;<\/p>\n<p>namespace test_halcon_ocr<br \/>\n{<br \/>\n    public partial class Form1 : Form<br \/>\n    {<br \/>\n        HObject TestImage;<br \/>\n        string Path_testimg &#061; &#034;C:\\\\\\\\Users\\\\\\\\86957\\\\\\\\Desktop\\\\\\\\img_ocr_0296.png&#034;;<\/p>\n<p>        public Form1()<br \/>\n        {<br \/>\n            InitializeComponent();<br \/>\n        }<\/p>\n<p>        private void button1_Click(object sender, EventArgs e)<br \/>\n        {<\/p>\n<p>            \/\/\u8bfb\u53d6\u6587\u4ef6<br \/>\n            HOperatorSet.ReadImage(out TestImage, Path_testimg);<br \/>\n            \/\/\u83b7\u53d6\u56fe\u7247\u5927\u5c0f<br \/>\n            HTuple Width, Height;<br \/>\n            HOperatorSet.GetImageSize(TestImage, out Width, out Height);<br \/>\n            \/\/\u8bbe\u7f6e\u56fe\u7247\u663e\u793a\u8303\u56f4 hWindowControl1.HalconWindow\u83b7\u5f97\u7a97\u4f53\u53e5\u67c4<br \/>\n            HOperatorSet.SetPart(hWindowControl1.HalconWindow, 0, 0, (Height &#8211; 1), (Width &#8211; 1)); \/\/0,0, (Height &#8211; 1), (Width &#8211; 1)\u4ee3\u8868\u4ece0&#xff0c;0\u5750\u6807\u5230\u56fe\u7247\u7684\u5bbd\u9ad8\u5750\u6807&#xff0c;\u8fbe\u5230\u5168\u5c4f\u663e\u793a<\/p>\n<p>            \/\/\u5c06\u56fe\u7247\u6295\u5c04\u5230\u7a97\u4f53\u4e0a<br \/>\n            HOperatorSet.DispObj(TestImage, hWindowControl1.HalconWindow);\/\/\u5c06TestImage\u53d8\u91cf\u6295\u5c04\u5230\u53e5\u67c4\u7a97\u53e3\u4e0a<\/p>\n<p>        }<\/p>\n<p>        private void button2_Click(object sender, EventArgs e)<br \/>\n        {<\/p>\n<p>        }<br \/>\n    }<br \/>\n}<\/p>\n<p>\u8fd0\u884c&#xff0c;<\/p>\n<p>\u6210\u529f\u62a5\u9519\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1465\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813003007-689bdc8f1512c.png\" width=\"1831\" \/><\/p>\n<\/p>\n<p>\u89e3\u51b3&#xff1a; \u9879\u76ee\u53f3\u952e\u5c5e\u6027&#xff0c;\u627e\u5230\u751f\u6210&#xff0c;\u53d6\u6d88\u52fe\u9009\u9996\u900932\u4f4d\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1264\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813003008-689bdc90cfeb0.png\" width=\"1512\" \/><\/p>\n<\/p>\n<p>\u518d\u6b21\u8fd0\u884c&#xff0c;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"775\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813003009-689bdc91ba95b.png\" width=\"1258\" \/><\/p>\n<p>\u6210\u529f\u3002<\/p>\n<\/p>\n<h2>3. ocr \u5b57\u7b26\u8bc6\u522b<\/h2>\n<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1177\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813003010-689bdc922d50c.png\" width=\"2179\" \/><\/p>\n<li>\n<p>CreateDeepOcr\u51fd\u6570&#xff1a;\u8fd9\u4e2a\u51fd\u6570\u8d1f\u8d23\u521b\u5efa\u6df1\u5ea6OCR\u5904\u7406\u5668\u3002\u4f7f\u7528HOperatorSet.CreateDeepOcr\u65b9\u6cd5&#xff0c;\u4f20\u5165\u53c2\u6570&#034;mode&#034;\u548c&#034;recognition&#034;&#xff0c;\u751f\u6210\u4e00\u4e2aOCR\u53e5\u67c4\u3002\u7136\u540e\u8c03\u7528set_suitable_device_in_ocr_handle\u6765\u8bbe\u7f6e\u5408\u9002\u7684\u8fd0\u884c\u8bbe\u5907&#xff08;\u5982GPU\u6216CPU&#xff09;&#xff0c;\u5e76\u8bbe\u7f6e\u8bc6\u522b\u56fe\u50cf\u7684\u5bbd\u5ea6\u53c2\u6570\u3002\u8fd9\u4e2a\u51fd\u6570\u7684\u4f5c\u7528\u662f\u521d\u59cb\u5316OCR\u6a21\u578b&#xff0c;\u51c6\u5907\u540e\u7eed\u7684\u8bc6\u522b\u64cd\u4f5c\u3002<\/p>\n<\/li>\n<li>\n<p>set_suitable_device_in_ocr_handle\u51fd\u6570&#xff1a;\u8be5\u51fd\u6570\u7528\u4e8e\u914d\u7f6eOCR\u5904\u7406\u5668\u4f7f\u7528\u7684\u8ba1\u7b97\u8bbe\u5907\u3002\u9996\u5148\u67e5\u8be2\u53ef\u7528\u7684\u6df1\u5ea6\u5b66\u4e60\u8bbe\u5907&#xff08;GPU\u548cCPU&#xff09;&#xff0c;\u4f18\u5148\u9009\u62e9GPU\u3002\u7136\u540e\u8bbe\u7f6e\u8bc6\u522b\u56fe\u50cf\u7684\u5bbd\u5ea6\u53c2\u6570&#xff0c;\u786e\u4fdd\u5728\u5904\u7406\u65f6\u4e0d\u4f1a\u56e0\u4e3a\u5185\u5b58\u95ee\u9898\u51fa\u9519\u3002\u8fd9\u91cc\u6d89\u53ca\u5230\u5f02\u5e38\u5904\u7406&#xff0c;\u786e\u4fdd\u5728\u8bbe\u5907\u4e0d\u53ef\u7528\u65f6\u80fd\u591f\u56de\u9000\u5230\u5176\u4ed6\u8bbe\u5907&#xff0c;\u5e76\u5728\u6700\u540e\u6062\u590d\u9ed8\u8ba4\u7684\u56fe\u50cf\u5bbd\u5ea6\u8bbe\u7f6e\u3002<\/p>\n<\/li>\n<li>\n<p>DeepLearningOCR\u51fd\u6570&#xff1a;\u8fd9\u662f\u5b9e\u9645\u7684OCR\u8bc6\u522b\u51fd\u6570\u3002\u5b83\u63a5\u6536\u56fe\u50cf\u3001ROI\u5750\u6807\u3001\u7a97\u53e3\u53e5\u67c4\u548cOCR\u5904\u7406\u5668\u53e5\u67c4\u4f5c\u4e3a\u53c2\u6570\u3002\u5904\u7406\u6b65\u9aa4\u5305\u62ec\u56fe\u50cf\u9884\u5904\u7406&#xff08;\u5747\u503c\u6ee4\u6ce2\u548c\u5f3a\u8c03\u5904\u7406&#xff09;\u3001\u88c1\u526aROI\u533a\u57df\u3001\u5e94\u7528OCR\u8bc6\u522b&#xff0c;\u5e76\u5c06\u7ed3\u679c\u8fd4\u56de\u3002\u8bc6\u522b\u8fc7\u7a0b\u4e2d\u4f7f\u7528Halcon\u7684ApplyDeepOcr\u65b9\u6cd5&#xff0c;\u5e76\u4ece\u7ed3\u679c\u4e2d\u63d0\u53d6\u8bc6\u522b\u7684\u6587\u672c\u3002<\/p>\n<\/li>\n<\/p>\n<p>\u8fd0\u884c\u540e&#xff0c; <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"774\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813003011-689bdc9365399.png\" width=\"1261\" \/><\/p>\n<\/p>\n<\/p>\n<h2>4.\u5b8c\u6574\u4ee3\u7801&#xff1a;   \u00a0<\/h2>\n<p>using System;<br \/>\nusing System.IO;<br \/>\nusing System.Windows.Forms;<br \/>\nusing HalconDotNet;<br \/>\nnamespace test_halcon_ocr<br \/>\n{<br \/>\n    public partial class Form1 : Form<br \/>\n    {<br \/>\n        HObject TestImage;<br \/>\n        HTuple hv_DeepOcrHandle &#061; new HTuple();<br \/>\n        string Path_testimg &#061; &#034;C:\\\\\\\\Users\\\\\\\\86957\\\\\\\\Desktop\\\\\\\\img_ocr_0296.png&#034;;<\/p>\n<p>        public Form1()<br \/>\n        {<br \/>\n            InitializeComponent();<br \/>\n        }<\/p>\n<p>        \/\/\u81ea\u52a8\u9009\u62e9\u6700\u4f73\u8ba1\u7b97\u8bbe\u5907&#xff08;GPU\u4f18\u5148&#xff09;&#xff0c;\u4f18\u5316\u6a21\u578b\u8fd0\u884c\u6548\u7387<br \/>\n        static void set_suitable_device_in_ocr_handle(HTuple hv_DeepOcrHandle)<br \/>\n        {<\/p>\n<p>            \/\/ Local control variables <\/p>\n<p>            HTuple hv_DLDeviceHandles &#061; new HTuple(), hv_RecognitionImageWidthDefault &#061; new HTuple();<br \/>\n            HTuple hv_Exception &#061; new HTuple(), hv_Index &#061; new HTuple();<br \/>\n            \/\/ Initialize local and output iconic variables<br \/>\n            try<br \/>\n            {<br \/>\n                \/\/Determine deep learning device to work with (prefer GPU over CPU).<br \/>\n                hv_DLDeviceHandles.Dispose();<br \/>\n                HOperatorSet.QueryAvailableDlDevices((new HTuple(&#034;runtime&#034;)).TupleConcat(&#034;runtime&#034;),<br \/>\n                    (new HTuple(&#034;gpu&#034;)).TupleConcat(&#034;cpu&#034;), out hv_DLDeviceHandles);<br \/>\n                if ((int)(new HTuple((new HTuple(hv_DLDeviceHandles.TupleLength())).TupleEqual(<br \/>\n                    0))) !&#061; 0)<br \/>\n                {<br \/>\n                    throw new HalconException(&#034;No supported device found to continue this example.&#034;);<br \/>\n                }<br \/>\n                \/\/Set recognition_image_width larger for the example to work without memory problems.<br \/>\n                try<br \/>\n                {<br \/>\n                    hv_RecognitionImageWidthDefault.Dispose();<br \/>\n                    HOperatorSet.GetDeepOcrParam(hv_DeepOcrHandle, &#034;recognition_image_width&#034;,<br \/>\n                        out hv_RecognitionImageWidthDefault);<br \/>\n                    HOperatorSet.SetDeepOcrParam(hv_DeepOcrHandle, &#034;recognition_image_width&#034;,<br \/>\n                        260);<br \/>\n                }<br \/>\n                \/\/ catch (Exception)<br \/>\n                catch (HalconException HDevExpDefaultException1)<br \/>\n                {<br \/>\n                    HDevExpDefaultException1.ToHTuple(out hv_Exception);<br \/>\n                }<\/p>\n<p>                for (hv_Index &#061; 0; (int)hv_Index &lt;&#061; (int)((new HTuple(hv_DLDeviceHandles.TupleLength()<br \/>\n                    )) &#8211; 1); hv_Index &#061; (int)hv_Index &#043; 1)<br \/>\n                {<br \/>\n                    try<br \/>\n                    {<br \/>\n                        using (HDevDisposeHelper dh &#061; new HDevDisposeHelper())<br \/>\n                        {<br \/>\n                            HOperatorSet.SetDeepOcrParam(hv_DeepOcrHandle, &#034;device&#034;, hv_DLDeviceHandles.TupleSelect(<br \/>\n                                hv_Index));<br \/>\n                        }<br \/>\n                        break;<br \/>\n                    }<br \/>\n                    \/\/ catch (Exception)<br \/>\n                    catch (HalconException HDevExpDefaultException1)<br \/>\n                    {<br \/>\n                        HDevExpDefaultException1.ToHTuple(out hv_Exception);<br \/>\n                        if ((int)(new HTuple(hv_Index.TupleEqual((new HTuple(hv_DLDeviceHandles.TupleLength()<br \/>\n                            )) &#8211; 1))) !&#061; 0)<br \/>\n                        {<br \/>\n                            throw new HalconException(&#034;Could not set any of the supported devices to continue this example.&#034;);<br \/>\n                        }<br \/>\n                    }<br \/>\n                }<br \/>\n                \/\/Reset recognition_image_width to the default value.<br \/>\n                try<br \/>\n                {<br \/>\n                    HOperatorSet.SetDeepOcrParam(hv_DeepOcrHandle, &#034;recognition_image_width&#034;,<br \/>\n                        hv_RecognitionImageWidthDefault);<br \/>\n                }<br \/>\n                \/\/ catch (Exception)<br \/>\n                catch (HalconException HDevExpDefaultException1)<br \/>\n                {<br \/>\n                    HDevExpDefaultException1.ToHTuple(out hv_Exception);<br \/>\n                }<\/p>\n<p>                hv_DLDeviceHandles.Dispose();<br \/>\n                hv_RecognitionImageWidthDefault.Dispose();<br \/>\n                hv_Exception.Dispose();<br \/>\n                hv_Index.Dispose();<\/p>\n<p>                return;<br \/>\n            }<br \/>\n            catch (HalconException HDevExpDefaultException)<br \/>\n            {<\/p>\n<p>                hv_DLDeviceHandles.Dispose();<br \/>\n                hv_RecognitionImageWidthDefault.Dispose();<br \/>\n                hv_Exception.Dispose();<br \/>\n                hv_Index.Dispose();<\/p>\n<p>                throw HDevExpDefaultException;<br \/>\n            }<br \/>\n        }<\/p>\n<p>        \/\/\u6267\u884c\u5b8c\u6574\u7684OCR\u8bc6\u522b\u6d41\u7a0b&#xff0c;\u5305\u542b\u9884\u5904\u7406\u3001ROI\u88c1\u526a\u3001\u6a21\u578b\u63a8\u7406\u548c\u7ed3\u679c\u89e3\u6790<br \/>\n        public static string DeepLearningOCR(HObject ho_ImageSource, int row1, int col1, int row2, int col2, HWindow Window, HTuple hv_DeepOcrHandle)<br \/>\n        {<\/p>\n<p>            \/\/ Local iconic variables <\/p>\n<p>            HObject ho_ImageMean, ho_Image;<br \/>\n            HObject ho_ImageWord, ho_Rectangle;<\/p>\n<p>            \/\/ Local control variables <\/p>\n<p>            HTuple hv_Width &#061; new HTuple();<br \/>\n            HTuple hv_Height &#061; new HTuple(), hv_DeepOcrResult &#061; new HTuple();<br \/>\n            HTuple hv_RecognizedWord &#061; new HTuple();<br \/>\n            \/\/ Initialize local and output iconic variables<br \/>\n            \/\/HOperatorSet.GenEmptyObj(out ho_ImageSource);<br \/>\n            HOperatorSet.GenEmptyObj(out ho_ImageMean);<br \/>\n            HOperatorSet.GenEmptyObj(out ho_Image);<br \/>\n            HOperatorSet.GenEmptyObj(out ho_ImageWord);<br \/>\n            HOperatorSet.GenEmptyObj(out ho_Rectangle);<br \/>\n            try<br \/>\n            {<\/p>\n<p>                ho_ImageMean.Dispose();<br \/>\n                HOperatorSet.MeanImage(ho_ImageSource, out ho_ImageMean, 3, 3);\/\/ \u56fe\u50cf\u9884\u5904\u7406<\/p>\n<p>                ho_Image.Dispose();<br \/>\n                HOperatorSet.Emphasize(ho_ImageMean, out ho_Image, 9, 9, 1);<\/p>\n<p>                hv_Width.Dispose(); hv_Height.Dispose();<br \/>\n                HOperatorSet.GetImageSize(ho_ImageSource, out hv_Width, out hv_Height);<\/p>\n<p>                \/\/<br \/>\n                \/\/Crop the word to be recognized by the recognition component.<br \/>\n                ho_ImageWord.Dispose();<br \/>\n                HOperatorSet.CropRectangle1(ho_Image, out ho_ImageWord, row1, col1, row2, col2);\/\/ ROI\u88c1\u526a<br \/>\n                ho_Rectangle.Dispose();<br \/>\n                HOperatorSet.GenRectangle1(out ho_Rectangle, row1, col1, row2, col2);<br \/>\n                \/\/<br \/>\n                \/\/Apply recognition with default recognition_image_width.<\/p>\n<p>                hv_DeepOcrResult.Dispose();<br \/>\n                HOperatorSet.ApplyDeepOcr(ho_ImageWord, hv_DeepOcrHandle, &#034;recognition&#034;, out hv_DeepOcrResult);  \/\/ \u6267\u884cOCR\u8bc6\u522b<br \/>\n                hv_RecognizedWord.Dispose();<br \/>\n                HOperatorSet.GetDictTuple(hv_DeepOcrResult, &#034;word&#034;, out hv_RecognizedWord);<br \/>\n                ho_Image.DispObj(Window);<\/p>\n<p>                Window.SetDraw(&#034;margin&#034;);<\/p>\n<p>                Window.SetColor(&#034;red&#034;);<br \/>\n                Window.SetPart(0, 0, (int)(hv_Height &#8211; 1), (int)(hv_Width &#8211; 1));<\/p>\n<p>                ho_Rectangle.DispObj(Window);<\/p>\n<p>            }<br \/>\n            catch (HalconException HDevExpDefaultException)<br \/>\n            {<br \/>\n                ho_ImageSource.Dispose();<br \/>\n                ho_ImageMean.Dispose();<br \/>\n                ho_Image.Dispose();<br \/>\n                ho_ImageWord.Dispose();<br \/>\n                ho_Rectangle.Dispose();<\/p>\n<p>                \/\/ hv_DeepOcrHandle.Dispose();<br \/>\n                hv_Width.Dispose();<br \/>\n                hv_Height.Dispose();<br \/>\n                hv_DeepOcrResult.Dispose();<br \/>\n                hv_RecognizedWord.Dispose();<\/p>\n<p>                throw HDevExpDefaultException;<br \/>\n            }<br \/>\n            ho_ImageSource.Dispose();<br \/>\n            ho_ImageMean.Dispose();<br \/>\n            ho_Image.Dispose();<br \/>\n            ho_ImageWord.Dispose();<br \/>\n            ho_Rectangle.Dispose();<\/p>\n<p>            \/\/  hv_DeepOcrHandle.Dispose();<br \/>\n            hv_Width.Dispose();<br \/>\n            hv_Height.Dispose();<br \/>\n            hv_DeepOcrResult.Dispose();<br \/>\n            hv_RecognizedWord.Dispose();<\/p>\n<p>            return hv_RecognizedWord.S;<\/p>\n<p>        }<\/p>\n<p>        \/\/\u521d\u59cb\u5316\u6df1\u5ea6\u5b66\u4e60OCR\u6a21\u578b&#xff0c;\u521b\u5efa\u8bc6\u522b\u5668\u5b9e\u4f8b\u5e76\u914d\u7f6e\u57fa\u672c\u53c2\u6570<br \/>\n        public static HTuple CreateDeepOcr()<br \/>\n        {<br \/>\n            HTuple hv_DeepOcrHandle &#061; new HTuple();<br \/>\n            hv_DeepOcrHandle.Dispose();<br \/>\n            HOperatorSet.CreateDeepOcr(&#034;mode&#034;, &#034;recognition&#034;, out hv_DeepOcrHandle);<br \/>\n            set_suitable_device_in_ocr_handle(hv_DeepOcrHandle);<br \/>\n            HOperatorSet.SetDeepOcrParam(hv_DeepOcrHandle, &#034;recognition_image_width&#034;, 260);<br \/>\n            return hv_DeepOcrHandle;<\/p>\n<p>        }<\/p>\n<p>        private void button1_Click(object sender, EventArgs e)\/\/\u663e\u793a\u56fe\u50cf<br \/>\n        {<br \/>\n            \/\/\u8bfb\u53d6\u6587\u4ef6<br \/>\n            HOperatorSet.ReadImage(out TestImage, Path_testimg);<br \/>\n            \/\/\u83b7\u53d6\u56fe\u7247\u5927\u5c0f<br \/>\n            HTuple Width, Height;<br \/>\n            HOperatorSet.GetImageSize(TestImage, out Width, out Height);<br \/>\n            \/\/\u8bbe\u7f6e\u56fe\u7247\u663e\u793a\u8303\u56f4 hWindowControl1.HalconWindow\u83b7\u5f97\u7a97\u4f53\u53e5\u67c4<br \/>\n            HOperatorSet.SetPart(hWindowControl1.HalconWindow, 0, 0, (Height &#8211; 1), (Width &#8211; 1)); \/\/0,0, (Height &#8211; 1), (Width &#8211; 1)\u4ee3\u8868\u4ece0&#xff0c;0\u5750\u6807\u5230\u56fe\u7247\u7684\u5bbd\u9ad8\u5750\u6807&#xff0c;\u8fbe\u5230\u5168\u5c4f\u663e\u793a<\/p>\n<p>            \/\/\u5c06\u56fe\u7247\u6295\u5c04\u5230\u7a97\u4f53\u4e0a<br \/>\n            HOperatorSet.DispObj(TestImage, hWindowControl1.HalconWindow);\/\/\u5c06TestImage\u53d8\u91cf\u6295\u5c04\u5230\u53e5\u67c4\u7a97\u53e3\u4e0a<\/p>\n<p>        }<\/p>\n<p>        private void button2_Click(object sender, EventArgs e)\/\/\u5b57\u7b26\u8bc6\u522b<br \/>\n        {<\/p>\n<p>            textBox1.AppendText(&#034;\u5f00\u59cb\u68c0\u6d4b&#xff1a;&#034; &#043; &#034;\\\\r\\\\n&#034;);<br \/>\n            try<br \/>\n            {<br \/>\n                hv_DeepOcrHandle &#061; CreateDeepOcr();<\/p>\n<p>            }<br \/>\n            catch<br \/>\n            {<br \/>\n                MessageBox.Show(&#034;error&#034;);<br \/>\n            }<\/p>\n<p>            if (!File.Exists(Path_testimg))<br \/>\n            {<br \/>\n                textBox1.AppendText($&#034;\u6587\u4ef6\u4e0d\u5b58\u5728: {Path_testimg}&#034; &#043; &#034;\\\\r\\\\n&#034;);<br \/>\n                return;<br \/>\n            }<\/p>\n<p>            HalconDotNet.HImage hImage &#061; new HalconDotNet.HImage(Path_testimg);<\/p>\n<p>            HTuple width, height;<br \/>\n            hImage.GetImageSize(out width, out height);<\/p>\n<p>            int intWidth &#061; width.TupleInt();<br \/>\n            int intHeight &#061; height.TupleInt();<br \/>\n            textBox1.AppendText(&#034;\u9009\u6846\u5750\u6807\u4e3a&#xff1a;&#034; &#043; &#034;\\\\r\\\\n&#034;);<br \/>\n            textBox1.AppendText(intWidth.ToString());<br \/>\n            textBox1.AppendText(width.ToString() &#043; &#034;\\\\r\\\\n&#034;);<\/p>\n<p>            string code &#061; DeepLearningOCR(hImage, 0, 0, intHeight, intWidth, hWindowControl1.HalconWindow, hv_DeepOcrHandle);<br \/>\n            textBox1.AppendText(&#034;code&#xff1a;&#034; &#043; code &#043; &#034;\\\\r\\\\n&#034;);<\/p>\n<p>        }<br \/>\n    }<br \/>\n}<\/p>\n<p>namespace test_halcon_ocr<br \/>\n{<br \/>\n    partial class Form1<br \/>\n    {<br \/>\n        \/\/\/ &lt;summary&gt;<br \/>\n        \/\/\/ \u5fc5\u9700\u7684\u8bbe\u8ba1\u5668\u53d8\u91cf\u3002<br \/>\n        \/\/\/ &lt;\/summary&gt;<br \/>\n        private System.ComponentModel.IContainer components &#061; null;<\/p>\n<p>        \/\/\/ &lt;summary&gt;<br \/>\n        \/\/\/ \u6e05\u7406\u6240\u6709\u6b63\u5728\u4f7f\u7528\u7684\u8d44\u6e90\u3002<br \/>\n        \/\/\/ &lt;\/summary&gt;<br \/>\n        \/\/\/ &lt;param name&#061;&#034;disposing&#034;&gt;\u5982\u679c\u5e94\u91ca\u653e\u6258\u7ba1\u8d44\u6e90&#xff0c;\u4e3a true&#xff1b;\u5426\u5219\u4e3a false\u3002&lt;\/param&gt;<br \/>\n        protected override void Dispose(bool disposing)<br \/>\n        {<br \/>\n            if (disposing &amp;&amp; (components !&#061; null))<br \/>\n            {<br \/>\n                components.Dispose();<br \/>\n            }<br \/>\n            base.Dispose(disposing);<br \/>\n        }<\/p>\n<p>        #region Windows \u7a97\u4f53\u8bbe\u8ba1\u5668\u751f\u6210\u7684\u4ee3\u7801<\/p>\n<p>        \/\/\/ &lt;summary&gt;<br \/>\n        \/\/\/ \u8bbe\u8ba1\u5668\u652f\u6301\u6240\u9700\u7684\u65b9\u6cd5 &#8211; \u4e0d\u8981\u4fee\u6539<br \/>\n        \/\/\/ \u4f7f\u7528\u4ee3\u7801\u7f16\u8f91\u5668\u4fee\u6539\u6b64\u65b9\u6cd5\u7684\u5185\u5bb9\u3002<br \/>\n        \/\/\/ &lt;\/summary&gt;<br \/>\n        private void InitializeComponent()<br \/>\n        {<br \/>\n            this.hWindowControl1 &#061; new HalconDotNet.HWindowControl();<br \/>\n            this.button1 &#061; new System.Windows.Forms.Button();<br \/>\n            this.button2 &#061; new System.Windows.Forms.Button();<br \/>\n            this.textBox1 &#061; new System.Windows.Forms.TextBox();<br \/>\n            this.SuspendLayout();<br \/>\n            \/\/<br \/>\n            \/\/ hWindowControl1<br \/>\n            \/\/<br \/>\n            this.hWindowControl1.BackColor &#061; System.Drawing.Color.Black;<br \/>\n            this.hWindowControl1.BorderColor &#061; System.Drawing.Color.Black;<br \/>\n            this.hWindowControl1.ImagePart &#061; new System.Drawing.Rectangle(0, 0, 640, 480);<br \/>\n            this.hWindowControl1.Location &#061; new System.Drawing.Point(96, 116);<br \/>\n            this.hWindowControl1.Name &#061; &#034;hWindowControl1&#034;;<br \/>\n            this.hWindowControl1.Size &#061; new System.Drawing.Size(525, 338);<br \/>\n            this.hWindowControl1.TabIndex &#061; 0;<br \/>\n            this.hWindowControl1.WindowSize &#061; new System.Drawing.Size(525, 338);<br \/>\n            \/\/<br \/>\n            \/\/ button1<br \/>\n            \/\/<br \/>\n            this.button1.Location &#061; new System.Drawing.Point(174, 567);<br \/>\n            this.button1.Name &#061; &#034;button1&#034;;<br \/>\n            this.button1.Size &#061; new System.Drawing.Size(288, 117);<br \/>\n            this.button1.TabIndex &#061; 1;<br \/>\n            this.button1.Text &#061; &#034;button1&#034;;<br \/>\n            this.button1.UseVisualStyleBackColor &#061; true;<br \/>\n            this.button1.Click &#043;&#061; new System.EventHandler(this.button1_Click);<br \/>\n            \/\/<br \/>\n            \/\/ button2<br \/>\n            \/\/<br \/>\n            this.button2.Location &#061; new System.Drawing.Point(662, 567);<br \/>\n            this.button2.Name &#061; &#034;button2&#034;;<br \/>\n            this.button2.Size &#061; new System.Drawing.Size(242, 117);<br \/>\n            this.button2.TabIndex &#061; 2;<br \/>\n            this.button2.Text &#061; &#034;button2&#034;;<br \/>\n            this.button2.UseVisualStyleBackColor &#061; true;<br \/>\n            this.button2.Click &#043;&#061; new System.EventHandler(this.button2_Click);<br \/>\n            \/\/<br \/>\n            \/\/ textBox1<br \/>\n            \/\/<br \/>\n            this.textBox1.Location &#061; new System.Drawing.Point(830, 189);<br \/>\n            this.textBox1.Multiline &#061; true;<br \/>\n            this.textBox1.Name &#061; &#034;textBox1&#034;;<br \/>\n            this.textBox1.Size &#061; new System.Drawing.Size(317, 254);<br \/>\n            this.textBox1.TabIndex &#061; 3;<br \/>\n            \/\/<br \/>\n            \/\/ Form1<br \/>\n            \/\/<br \/>\n            this.AutoScaleDimensions &#061; new System.Drawing.SizeF(9F, 18F);<br \/>\n            this.AutoScaleMode &#061; System.Windows.Forms.AutoScaleMode.Font;<br \/>\n            this.ClientSize &#061; new System.Drawing.Size(1269, 736);<br \/>\n            this.Controls.Add(this.textBox1);<br \/>\n            this.Controls.Add(this.button2);<br \/>\n            this.Controls.Add(this.button1);<br \/>\n            this.Controls.Add(this.hWindowControl1);<br \/>\n            this.Name &#061; &#034;Form1&#034;;<br \/>\n            this.Text &#061; &#034;Form1&#034;;<br \/>\n            this.ResumeLayout(false);<br \/>\n            this.PerformLayout();<\/p>\n<p>        }<\/p>\n<p>        #endregion<\/p>\n<p>        private HalconDotNet.HWindowControl hWindowControl1;<br \/>\n        private System.Windows.Forms.Button button1;<br \/>\n        private System.Windows.Forms.Button button2;<br \/>\n        private System.Windows.Forms.TextBox textBox1;<br \/>\n    }<br \/>\n}<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb569\u6b21\uff0c\u70b9\u8d5e17\u6b21\uff0c\u6536\u85cf7\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86Halcon OCR\u8bc6\u522b\u7684\u5b8c\u6574\u5b9e\u73b0\u6d41\u7a0b\u3002\u9996\u5148\u901a\u8fc7\u7f51\u76d8\u4e0b\u8f7dHalcon 25.05\u7248\u672c\u5e76\u5b89\u88c5\uff0c\u5728C#\u9879\u76ee\u4e2d\u914d\u7f6e\u73af\u5883\uff0c\u6dfb\u52a0halcondotnet.dll\u5f15\u7528\u3002\u5173\u952e\u6b65\u9aa4\u5305\u62ec\uff1a1)\u521b\u5efaOCR\u5904\u7406\u5668\u5e76\u81ea\u52a8\u9009\u62e9\u6700\u4f73\u8ba1\u7b97\u8bbe\u5907(GPU\u4f18\u5148)\uff1b2)\u5b9e\u73b0OCR\u8bc6\u522b\u529f\u80fd\uff0c\u5305\u542b\u56fe\u50cf\u9884\u5904\u7406(\u5747\u503c\u6ee4\u6ce2\u3001\u5f3a\u8c03\u5904\u7406)\u3001ROI\u533a\u57df\u88c1\u526a\u548c\u8bc6\u522b\u7ed3\u679c\u63d0\u53d6\uff1b3)\u6784\u5efaWindows\u7a97\u4f53\u5e94\u7528\uff0c\u5305\u542b\u56fe\u50cf\u663e\u793a\u7a97\u53e3\u548c\u8bc6\u522b\u6309\u94ae\u3002\u6587\u4e2d\u8fd8\u63d0\u4f9b\u4e86\u89e3\u51b332\u4f4d\u517c\u5bb9\u6027\u62a5\u9519\u7684\u65b9\u6848\uff0c\u4ee5\u53ca\u5b8c\u6574\u7684C#\u4ee3\u7801\u5b9e\u73b0\uff0c\u5c55\u793a\u4e86\u5982\u4f55\u5c06Halcon\u7684\u6df1\u5ea6\u5b66\u4e60OCR\u529f\u80fd\u96c6\u6210\u5230.NET<\/p>\n","protected":false},"author":2,"featured_media":54605,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[55,3941,756],"topic":[],"class_list":["post-54615","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-c","tag-halcon","tag-ocr"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>c#\u8054\u5408Halcon\u8fdb\u884cOCR\u5b57\u7b26\u8bc6\u522b\uff08\u542bhalcon-25.05 \u767e\u5ea6\u7f51\u76d8\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/54615.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"c#\u8054\u5408Halcon\u8fdb\u884cOCR\u5b57\u7b26\u8bc6\u522b\uff08\u542bhalcon-25.05 \u767e\u5ea6\u7f51\u76d8\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb569\u6b21\uff0c\u70b9\u8d5e17\u6b21\uff0c\u6536\u85cf7\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86Halcon OCR\u8bc6\u522b\u7684\u5b8c\u6574\u5b9e\u73b0\u6d41\u7a0b\u3002\u9996\u5148\u901a\u8fc7\u7f51\u76d8\u4e0b\u8f7dHalcon 25.05\u7248\u672c\u5e76\u5b89\u88c5\uff0c\u5728C#\u9879\u76ee\u4e2d\u914d\u7f6e\u73af\u5883\uff0c\u6dfb\u52a0halcondotnet.dll\u5f15\u7528\u3002\u5173\u952e\u6b65\u9aa4\u5305\u62ec\uff1a1)\u521b\u5efaOCR\u5904\u7406\u5668\u5e76\u81ea\u52a8\u9009\u62e9\u6700\u4f73\u8ba1\u7b97\u8bbe\u5907(GPU\u4f18\u5148)\uff1b2)\u5b9e\u73b0OCR\u8bc6\u522b\u529f\u80fd\uff0c\u5305\u542b\u56fe\u50cf\u9884\u5904\u7406(\u5747\u503c\u6ee4\u6ce2\u3001\u5f3a\u8c03\u5904\u7406)\u3001ROI\u533a\u57df\u88c1\u526a\u548c\u8bc6\u522b\u7ed3\u679c\u63d0\u53d6\uff1b3)\u6784\u5efaWindows\u7a97\u4f53\u5e94\u7528\uff0c\u5305\u542b\u56fe\u50cf\u663e\u793a\u7a97\u53e3\u548c\u8bc6\u522b\u6309\u94ae\u3002\u6587\u4e2d\u8fd8\u63d0\u4f9b\u4e86\u89e3\u51b332\u4f4d\u517c\u5bb9\u6027\u62a5\u9519\u7684\u65b9\u6848\uff0c\u4ee5\u53ca\u5b8c\u6574\u7684C#\u4ee3\u7801\u5b9e\u73b0\uff0c\u5c55\u793a\u4e86\u5982\u4f55\u5c06Halcon\u7684\u6df1\u5ea6\u5b66\u4e60OCR\u529f\u80fd\u96c6\u6210\u5230.NET\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/54615.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-13T00:30:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813003001-689bdc896b612.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/54615.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/54615.html\",\"name\":\"c#\u8054\u5408Halcon\u8fdb\u884cOCR\u5b57\u7b26\u8bc6\u522b\uff08\u542bhalcon-25.05 \u767e\u5ea6\u7f51\u76d8\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-13T00:30:12+00:00\",\"dateModified\":\"2025-08-13T00:30:12+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/54615.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/54615.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/54615.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"c#\u8054\u5408Halcon\u8fdb\u884cOCR\u5b57\u7b26\u8bc6\u522b\uff08\u542bhalcon-25.05 \u767e\u5ea6\u7f51\u76d8\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"c#\u8054\u5408Halcon\u8fdb\u884cOCR\u5b57\u7b26\u8bc6\u522b\uff08\u542bhalcon-25.05 \u767e\u5ea6\u7f51\u76d8\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/54615.html","og_locale":"zh_CN","og_type":"article","og_title":"c#\u8054\u5408Halcon\u8fdb\u884cOCR\u5b57\u7b26\u8bc6\u522b\uff08\u542bhalcon-25.05 \u767e\u5ea6\u7f51\u76d8\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb569\u6b21\uff0c\u70b9\u8d5e17\u6b21\uff0c\u6536\u85cf7\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86Halcon OCR\u8bc6\u522b\u7684\u5b8c\u6574\u5b9e\u73b0\u6d41\u7a0b\u3002\u9996\u5148\u901a\u8fc7\u7f51\u76d8\u4e0b\u8f7dHalcon 25.05\u7248\u672c\u5e76\u5b89\u88c5\uff0c\u5728C#\u9879\u76ee\u4e2d\u914d\u7f6e\u73af\u5883\uff0c\u6dfb\u52a0halcondotnet.dll\u5f15\u7528\u3002\u5173\u952e\u6b65\u9aa4\u5305\u62ec\uff1a1)\u521b\u5efaOCR\u5904\u7406\u5668\u5e76\u81ea\u52a8\u9009\u62e9\u6700\u4f73\u8ba1\u7b97\u8bbe\u5907(GPU\u4f18\u5148)\uff1b2)\u5b9e\u73b0OCR\u8bc6\u522b\u529f\u80fd\uff0c\u5305\u542b\u56fe\u50cf\u9884\u5904\u7406(\u5747\u503c\u6ee4\u6ce2\u3001\u5f3a\u8c03\u5904\u7406)\u3001ROI\u533a\u57df\u88c1\u526a\u548c\u8bc6\u522b\u7ed3\u679c\u63d0\u53d6\uff1b3)\u6784\u5efaWindows\u7a97\u4f53\u5e94\u7528\uff0c\u5305\u542b\u56fe\u50cf\u663e\u793a\u7a97\u53e3\u548c\u8bc6\u522b\u6309\u94ae\u3002\u6587\u4e2d\u8fd8\u63d0\u4f9b\u4e86\u89e3\u51b332\u4f4d\u517c\u5bb9\u6027\u62a5\u9519\u7684\u65b9\u6848\uff0c\u4ee5\u53ca\u5b8c\u6574\u7684C#\u4ee3\u7801\u5b9e\u73b0\uff0c\u5c55\u793a\u4e86\u5982\u4f55\u5c06Halcon\u7684\u6df1\u5ea6\u5b66\u4e60OCR\u529f\u80fd\u96c6\u6210\u5230.NET","og_url":"https:\/\/www.wsisp.com\/helps\/54615.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-13T00:30:12+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813003001-689bdc896b612.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/54615.html","url":"https:\/\/www.wsisp.com\/helps\/54615.html","name":"c#\u8054\u5408Halcon\u8fdb\u884cOCR\u5b57\u7b26\u8bc6\u522b\uff08\u542bhalcon-25.05 \u767e\u5ea6\u7f51\u76d8\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-13T00:30:12+00:00","dateModified":"2025-08-13T00:30:12+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/54615.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/54615.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/54615.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"c#\u8054\u5408Halcon\u8fdb\u884cOCR\u5b57\u7b26\u8bc6\u522b\uff08\u542bhalcon-25.05 \u767e\u5ea6\u7f51\u76d8\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/54615","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=54615"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/54615\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/54605"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=54615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=54615"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=54615"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=54615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}