예제 #1
0
        private IplImage CutLeftRight(IplImage origin, PlateHorizontalGraph graph, Int32 method)
        {
            graph.ApplyProbabilityDistributor(new Graph.ProbabilityDistributor(0.0, 0.0, 2, 2));
            List <Graph.Peak> peaks = graph.FindPeak(3, method);

            if (peaks.Count != 0)
            {
                Graph.Peak p = peaks[0];
                return(GetSubImage(origin, new CvRect(p.Left, 0, p.GetDiff, image.Height)));
            }
            else
            {
                return(origin.Clone());
            }
        }
예제 #2
0
        public List <Char> GetChars()
        {
            List <Char> output = new List <Char>();

            List <Graph.Peak> peaks    = ComputeGraph();
            Int32             peakSize = (null == peaks)?0:peaks.Count;

            for (Int32 i = 0; i < peakSize; i++)
            {
                Graph.Peak p = peaks[i];
                if (p.GetDiff <= 0)
                {
                    continue;
                }

                output.Add(new Char(GetSubImage(image, new CvRect(p.Left, 0, p.GetDiff, image.Height)),
                                    GetSubImage(plateCopy.image, new CvRect(p.Left, 0, p.GetDiff, image.Height)),
                                    new PositionInPlate(p.Left, p.Right)));
            }

            return(output);
        }
예제 #3
0
 private IplImage CutTopBottom(IplImage origin, PlateVerticalGraph graph)
 {
     graph.ApplyProbabilityDistributor(new Graph.ProbabilityDistributor(0.0, 0.0, 2, 2));
     Graph.Peak p = graph.FindPeak(3)[0];
     return(GetSubImage(origin, new CvRect(0, p.Left, origin.Width, p.GetDiff)));
 }