cell histogram
This commit is contained in:
@@ -10,20 +10,40 @@ namespace LindtLeerformPlugin;
|
||||
public class LeerformRecognitionControl : BaseRecognitionControl
|
||||
{
|
||||
private readonly IImageSource _imageSource;
|
||||
private readonly LeerformPatternRecognitionService _patternService;
|
||||
private readonly LeerformRecipeStore _recipeStore;
|
||||
private Mat? _cameraMatrix;
|
||||
private Mat? _distCoeffs;
|
||||
|
||||
public LeerformRecognitionControl(
|
||||
LeerformRecognitionControlSettings settings,
|
||||
IImageSource imageSource,
|
||||
ILoadingService loadingService) : base(settings, loadingService)
|
||||
ILoadingService loadingService,
|
||||
LeerformPatternRecognitionService patternService,
|
||||
LeerformRecipeStore recipeStore) : base(settings, loadingService)
|
||||
{
|
||||
_imageSource = imageSource;
|
||||
_patternService = patternService;
|
||||
_recipeStore = recipeStore;
|
||||
}
|
||||
|
||||
public override List<RecipeData> GetRecipesData()
|
||||
{
|
||||
return [new RecipeData { RecipeName = "Default" }];
|
||||
var names = _recipeStore.ListRecipeNames();
|
||||
if (names.Count == 0)
|
||||
return [new RecipeData { RecipeName = "Default" }];
|
||||
|
||||
var recipes = new List<RecipeData>(names.Count);
|
||||
foreach (var name in names)
|
||||
{
|
||||
var recipe = _recipeStore.Load(name);
|
||||
recipes.Add(new RecipeData
|
||||
{
|
||||
RecipeName = name,
|
||||
Image = recipe != null ? LeerformRecipeStore.DecodeThumbnail(recipe) : null
|
||||
});
|
||||
}
|
||||
return recipes;
|
||||
}
|
||||
|
||||
protected override void Initialize(RecipeData currentRecipe)
|
||||
|
||||
Reference in New Issue
Block a user