Пример #1
0
        public override void ImageCutToList()
        {
            ImageConnectCut ic = new ImageConnectCut(base.imageMatrix);

            int[,] singleMatrix = ImageHandle.GetPictureSquence(ic.ConnectedLayerAreaMatrix);
            ic          = new ImageConnectCut(singleMatrix);
            resetMatrix = ImageHandle.ResetMatrix(ic.ConnectedLayerAreaMatrix);
            ic          = new ImageConnectCut(resetMatrix);
            clearMatrixByWidthAndHeight = ic.ClearMarixByWidthAndHeight(22, 38, 4, 32);
            base._cutCharImageList      = ic.GetCodeList();
        }
Пример #2
0
        public override string ImageRecognize()
        {
            if (base._cutCharImageList.Count == 4)
            {
                ImageConnectCut ica = new ImageConnectCut(resetMatrix);
                clearMatrixByWidthAndHeight = ica.ClearMarixByWidthAndHeight(22, 38, 4, 64);//宽粘连
                base._cutCharImageList      = ica.GetCodeList();
                if (base._cutCharImageList.Count == 4)
                {
                    ica = new ImageConnectCut(resetMatrix);
                    clearMatrixByWidthAndHeight = ica.ClearMarixByWidthAndHeight(22, 70, 4, 38);//高粘连
                    base._cutCharImageList      = ica.GetCodeList();
                }
            }

            if (base._cutCharImageList.Count == 7)
            {
                return(OCRImageRecognize(ImageHandle.CreateImage(clearMatrixByWidthAndHeight)).Replace(" ", "").Trim());
            }
            else
            {
                return(ImageRecognize(base._cutCharImageList));
            }
        }