Exemplo n.º 1
0
        private IImageEngine CreateCourtImageEngineObject(string court)
        {
            Type         type             = Type.GetType($"{ImageEngineNamespace}.{court.ToUpper()}{ImageEngineSuffix}");
            IImageEngine courtImageEngine = Activator.CreateInstance(type) as IImageEngine;

            return(courtImageEngine);
        }
Exemplo n.º 2
0
        public ImageController(
            IImageEngine imageEngine)
        {
            if (imageEngine == null)
            {
                throw new ArgumentNullException(("imageEngine"));
            }

            _imageEngine = imageEngine;
        }
Exemplo n.º 3
0
 public static void InitSystem()
 {
     voiceEngine       = new VoiceEngine();
     lighting          = new Lighting();
     device            = new Device();
     media             = new Media.MediaPlayer();
     speechInterpreter = new InterpreterSpeech();
     camera            = new ImageEngine();
     weather           = new Weather();
     events            = new Events();
     progammer         = new Programmer();
     configuration     = new SystemConfiguration();
 }
Exemplo n.º 4
0
        public string Predict(Bitmap imageBitmap, string courtName, string color = null)
        {
            IImageEngine imageEngine = CreateCourtImageEngineObject(courtName);

            ColorsEnum?colorEnum = null;

            if (
                !string.IsNullOrWhiteSpace(color) &&
                Enum.GetNames(typeof(ColorsEnum)).Any(c => c.Equals(color, StringComparison.InvariantCultureIgnoreCase)))
            {
                Enum.TryParse(color, true, out ColorsEnum tmpColorEnum);
                colorEnum = tmpColorEnum;
            }

            Bitmap[]   charactersBitmap = imageEngine.ExtractCharacters(imageBitmap, colorEnum);
            double[][] charactersDouble =
                charactersBitmap
                .Select(ch => imageEngine.ConvertImageToDouble(new Bitmap(ch, _normalizedWidth, _normalizedHeight)))
                .ToArray();

            int[] x = Engine.Predict(charactersDouble);

            return(string.Concat(DictionaryTools.IntToChar(_dictionary, x)));
        }
Exemplo n.º 5
0
 public PaintingManager(IMapper mapper, IPaintingRepository repository, IImageEngine engine)
 {
     _mapper     = mapper;
     _repository = repository;
     _engine     = engine;
 }
 public NoteManager(IMapper mapper, INoteRepository repository, IImageEngine engine)
 {
     _mapper     = mapper;
     _repository = repository;
     _engine     = engine;
 }