private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (subsctiption == null)
     {
         subsctiption = GenerateData.CaptureGameData()
                        .ObserveOn(SynchronizationContext.Current)
                        .Subscribe(b =>
         {
             img.Source       = BitmapToImageSource(b.Item1);
             grayImg.Source   = BitmapToImageSource(b.Item2);
             keys.ItemsSource = b.Item3;
         });
     }
     else
     {
         subsctiption.Dispose();
         subsctiption = null;
     }
 }
Esempio n. 2
0
        public static async Task DeepLearningPlay(DeviceDescriptor device)
        {
            while (true)
            {
                await Task.Delay(100);

                if (!ActivateN64Emulator())
                {
                    continue;
                }

                var b = GenerateData.Capture(GenerateData.rec);

                b = GenerateData.ResizeAndGray(b);

                var retValue = ImageUtil.ParallelExtractCHW(b, true).ToArray();

                Play(retValue, device);
            }
        }