private IImageEngine CreateCourtImageEngineObject(string court) { Type type = Type.GetType($"{ImageEngineNamespace}.{court.ToUpper()}{ImageEngineSuffix}"); IImageEngine courtImageEngine = Activator.CreateInstance(type) as IImageEngine; return(courtImageEngine); }
public ImageController( IImageEngine imageEngine) { if (imageEngine == null) { throw new ArgumentNullException(("imageEngine")); } _imageEngine = imageEngine; }
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(); }
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))); }
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; }