check point

This commit is contained in:
meelstorm
2025-07-14 12:03:59 +02:00
commit d3cb790bd9
431 changed files with 44078 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
using Hawkeye.VisionBuilder.Workflow.Datatypes;
using Hawkeye.VisionBuilder.Workflow.Operations.Attributes;
using OpenCvSharp;
namespace Hawkeye.VisionBuilder.Workflow.Operations.Morphology;
[Category("Morphology")]
public class HatsOperation : BaseOperation
{
public HatsOperation()
{
CanHaveProcessingError = false;
}
public int HatSize { get; set; } = 1;
protected override void InterpretInternal(Context context)
{
if (!CheckImageExists(context)) return;
if (!CheckGrayscale(context)) return;
var element = Cv2.GetStructuringElement(MorphShapes.Rect, new Size(HatSize, HatSize));
context.ActiveImage = new HawkeyeImage()
{
ImageData = context.ActiveImage!.ImageData.MorphologyEx(MorphTypes.TopHat, element)
};
Status = $"Black Hat {HatSize}";
Result = true;
}
public override void Save(BinaryWriter bw)
{
base.Save(bw);
bw.Write(HatSize);
}
public override void Load(BinaryReader br)
{
base.Load(br);
HatSize = br.ReadInt32();
}
}