コード例 #1
0
        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();
        }
コード例 #2
0
        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}");
            }
        }
コード例 #3
0
 public ImageProcessor(GameObjectRepository gameObjectRepository, ObjectClassifier objectClassifier)
 {
     this.gameObjectRepository = gameObjectRepository;
     this.objectClassifier     = objectClassifier;
 }