check point
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using Hawkeye.VisionBuilder.Workflow.Datatypes;
|
||||
using Hawkeye.VisionBuilder.Workflow.Operations.Attributes;
|
||||
using OpenCvSharp;
|
||||
|
||||
namespace Hawkeye.VisionBuilder.Workflow.Operations.Image;
|
||||
|
||||
[Category("Image")]
|
||||
public class InvertOperation:BaseOperation
|
||||
{
|
||||
|
||||
public InvertOperation()
|
||||
{
|
||||
CanHaveProcessingError = false;
|
||||
}
|
||||
|
||||
protected override void InterpretInternal(Context context)
|
||||
{
|
||||
if (!CheckImageExists(context)) return;
|
||||
|
||||
|
||||
var res = new Mat(context.ActiveImage.ImageData.Size(), context.ActiveImage.ImageData.Type(), 0);
|
||||
Cv2.BitwiseNot(context.ActiveImage.ImageData, res);
|
||||
context.ActiveImage = new HawkeyeImage()
|
||||
{
|
||||
ImageData = res
|
||||
};
|
||||
|
||||
Status = $"Image inverted";
|
||||
Result = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user