Files
HawkeyeVision/Plugins/CandyboxPlugin/Modules/CandyboxLearningTool.cs
2025-09-16 10:42:43 +02:00

30 lines
824 B
C#

using CandyboxPlugin.Recipe;
using Inspectron.HawkEye.View;
using Lindt.Candybox.Demo;
using OpenCvSharp;
using VisionBuilder.UI.Common.Processing;
using VisionBuilder.UI.Common.ViewModel.Interfaces.UI;
using VisionBuilder.UI.Windows.Settings;
namespace CandyboxPlugin.Module;
public class CandyboxLearningTool: ILearningTool
{
private ImagePreview _activeWindow;
public CandyboxLearningTool(IImagePreviewService imagePreviewService)
{
_activeWindow = (imagePreviewService as WindowsImagePreviewService)!.CurrentWindow!;
}
public bool IsLearningEnabled(string recipeName)
{
return true;
}
public void Learn(string recipeName, Mat image)
{
var editor = new MapEditor(image, new HistoRecipe(recipeName));
editor.ShowDialog(_activeWindow);
}
}