示例#1
0
        private void hSmartWindowControl1_HInitWindow(object sender, EventArgs e)
        {
            HWindow    hWindow    = (sender as HSmartWindowControl).HalconWindow;
            HTextModel hTextModel = new HTextModel("auto", "Industrial_Rej");
            HImage     hImage     = new HImage("ocr/medication_package_02_right");


            HTextResult hTextResult = hImage.FindText(hTextModel);
            HObject     hTextLine   = hTextResult.GetTextObject(new HTuple("line", 0));

            hWindow.SetColored(3);
            hWindow.DispImage(hImage);
            hWindow.DispObj(hTextLine);
            hSmartWindowControl1.SetFullImagePart(null);
        }
示例#2
0
        /*
         * public OCR(string mode, string fontFile)
         * {
         *  //this.fontFile = fontFile;
         *  this.mode = mode;
         *  //ReadOcrClass();
         * }*/

        public OCR()
        {
            image     = new HImage();
            ocrMlp    = new HOCRMlp();
            textModel = new HTextModel();
        }