diff --git a/Spectrum/AutoLabeling.cs b/Spectrum/AutoLabeling.cs index feedffe..369ea47 100644 --- a/Spectrum/AutoLabeling.cs +++ b/Spectrum/AutoLabeling.cs @@ -114,11 +114,15 @@ namespace Spectrum } } + public static void AddToQueue(Mat mat, Rectangle bounds, OpenCvSharp.Point[][] filteredContours) { if (!Config.AutoLabel || filteredContours.Length == 0) return; - + + if (labelingQueue.Count > 250) + return; + Mat clone = mat.Clone(); labelingQueue.Enqueue(new LabelingData { @@ -138,6 +142,9 @@ namespace Spectrum if (detectionAttemps < Config.BackgroundImageInterval || detected) return; + if (backgroundQueue.Count > 250) + return; + Mat clone = mat.Clone(); backgroundQueue.Enqueue(new BackgroundImageData { diff --git a/Spectrum/Config.cs b/Spectrum/Config.cs index 10f56cb..b71357a 100644 --- a/Spectrum/Config.cs +++ b/Spectrum/Config.cs @@ -29,7 +29,7 @@ namespace Spectrum public static bool ClosestToMouse { get; set; } = true; // if false it will use the center of the screen public static int Keybind { get; set; } = 0x06; // first side button on mouse public static double Sensitivity { get; set; } = 0.5; - public static MovementType AimMovementType { get; set; } = MovementType.CubicBezier; + public static MovementType AimMovementType { get; set; } = MovementType.Adaptive; // Display settings public static bool ShowDetectionWindow { get; set; } = true; diff --git a/Spectrum/Program.cs b/Spectrum/Program.cs index d69783c..26ec0e6 100644 --- a/Spectrum/Program.cs +++ b/Spectrum/Program.cs @@ -14,7 +14,6 @@ namespace Spectrum Config.LoadConfig(); Config.StartFileWatcher(); - var screenSize = SystemHelper.GetPrimaryScreenSize(); bounds = new Rectangle( (screenSize.Width - Config.ImageWidth) / 2, @@ -251,11 +250,16 @@ namespace Spectrum } } } - else if (Config.ShowDetectionWindow) + else if (Config.ShowDetectionWindow || Config.CollectData) { Cv2.ImShow("Spectrum Detection", drawing); Cv2.WaitKey(1); + if (Config.CollectData) + AutoLabeling.AddBackgroundImage(drawing, false); } + screenshot?.Dispose(); + mat.Dispose(); + drawing.Dispose(); } else {