public ObjectClassifier(GameObjectRepository gameObjectRepository) { this.gameObjectRepository = gameObjectRepository; this.tileset = new Image <Bgr, Byte>(Properties.Resources.Tileset); this.playerSet = new Image <Bgr, byte>(Properties.Resources.Player); this.hogDescriptor = new HOGDescriptor(new Size(16, 16), new Size(8, 8), new Size(4, 4), new Size(8, 8)); this.svm = new SVM(); svm.SetKernel(SVM.SvmKernelType.Rbf); svm.Type = SVM.SvmType.CSvc; svm.C = 12.5; svm.Gamma = 0.50625; ComputeImagesHOGDescriptors(); TrainObjectClassifier(); }
public Engine() { try { emulatorProcess = Process.GetProcessesByName(processName).FirstOrDefault(); screen = new Screen(emulatorProcess); gameObjectRepository = new GameObjectRepository(); objectClassifier = new ObjectClassifier(gameObjectRepository); imageProcessor = new ImageProcessor(gameObjectRepository, objectClassifier); input = new Input(); gameState = new GameState(); backgroundWorker = new BackgroundWorker(); backgroundWorker.DoWork += DoWork; } catch (Exception ex) { throw new Exception($"Problem initializing engine : {ex.Message}\r\n{ex.InnerException?.Message}"); } }
public ImageProcessor(GameObjectRepository gameObjectRepository, ObjectClassifier objectClassifier) { this.gameObjectRepository = gameObjectRepository; this.objectClassifier = objectClassifier; }