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,47 @@
namespace Hawkeye.VisionBuilder.Workflow.Operations.Basic;
using global::Hawkeye.VisionBuilder.Workflow.Datatypes;
using Hawkeye.VisionBuilder.Workflow.Datatypes;
using Hawkeye.VisionBuilder.Workflow.Operations.Attributes;
using OpenCvSharp;
[Category("Basic")]
public class ThresholdMinMaxOperation : BaseOperation
{
public ScriptValue ThresholdMin { get; set; } = new ScriptValue() { Script = "128" };
public ScriptValue ThresholdMax { get; set; } = new ScriptValue() { Script = "255" };
public ThresholdMinMaxOperation()
{
CanHaveProcessingError = false;
}
protected override void InterpretInternal(Context context)
{
if (!CheckImageExists(context)) return;
if (!CheckGrayscale(context)) return;
context.ActiveImage = new HawkeyeImage()
{
ImageData = context.ActiveImage.ImageData.InRange(GetScriptValue<float>(ThresholdMin), GetScriptValue<float>(ThresholdMax))
};
Result = true;
}
public override void Save(BinaryWriter bw)
{
base.Save(bw);
bw.Write(ThresholdMin.Script);
bw.Write(ThresholdMax.Script);
}
public override void Load(BinaryReader br)
{
base.Load(br);
ThresholdMin.Script = br.ReadString();
ThresholdMax.Script = br.ReadString();
}
}