public DigitsAndDigitRectangles Process(Image <Bgr, byte> numberPlateImage, List <ITemplateData> digitTemplateInfoList)
        {
            _digitTemplateInfoList = digitTemplateInfoList;
            //Lighten numberPlageImage
            //var lightenedNumberPlateImage = LightenNumberPlateImage(numberPlateImage);
            //CvInvoke.Imshow("test",numberPlateImage);
            var digitData = new DigitsAndDigitRectangles();

            foreach (var digitTemplateInfo in _digitTemplateInfoList)
            {
                var foundDigitData = FindDigit(numberPlateImage, digitTemplateInfo);
                if (foundDigitData != null && foundDigitData.Any())
                {
                    digitData.FoundDigitsData.AddRange(foundDigitData);
                }
            }
            if (digitData.FoundDigitsData.Any())
            {
                return(digitData);
            }
            return(null);
        }
        private static Image <Bgr, byte> GetFinalImage(Image <Bgr, byte> numberPlateImage, DigitsAndDigitRectangles foundDigitData)
        {
            var finalImageCreator = new FinalImageCreator(numberPlateImage, foundDigitData);
            var finalImage        = finalImageCreator.CreateImageWithDigitsOutlined();

            return(finalImage);
        }
Exemple #3
0
 public FinalImageCreator(Image <Bgr, byte> numberPlateImage, DigitsAndDigitRectangles foundDigitData)
 {
     _numberPlateImage = numberPlateImage;
     _foundDigitData   = foundDigitData;
 }