123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- using PaintDotNet.Data.Param;
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace PaintDotNet.Data.Action
- {
- /// <summary>
- /// 物相间距
- /// </summary>
- public class Action1010 : ActionAnalysis
- {
- /// <summary>
- /// 无视场执行提取
- /// </summary>
- /// <param name="src"></param>
- /// <returns></returns>
- public override OpenCvSharp.Mat PerformProcess(OpenCvSharp.Mat src)
- {
- return Adjust.BinaryExtractionIntent.ImageBinaryExtraction(src, this.Lists);
- }
- /// <summary>
- /// 多视场执行提取
- /// </summary>
- /// <param name="src">视场mat</param>
- /// <param name="mat">原图mat</param>
- /// <returns></returns>
- public override OpenCvSharp.Mat PerformProcess(OpenCvSharp.Mat src, OpenCvSharp.Mat mat)
- {
- return Adjust.BinaryExtractionIntent.ImageBinaryExtraction(src, mat, this.Lists);
- }
- /// <summary>
- /// 用于初始化参数
- /// </summary>
- public Action1010()
- {
- this.MenuId = ActionType.ActionBinaryExtraction;
- this.OpenImage = "current";
- //线宽
- IntegerNumber eleven = new IntegerNumber(1, 100);
- eleven.key = "parameter11";
- eleven.name = "线宽";
- eleven.initialValue = 2;
- eleven.value = 2;
- lists.Add(eleven);
- //颜色
- ColorNumber twelve = new ColorNumber();
- twelve.key = "parameter12";
- twelve.name = "颜色";
- twelve.Value = Color.Blue.ToArgb();
- lists.Add(twelve);
- //操作
- //测量线/截点 1测量线 2截点
- ChoiseArray thirteen = new ChoiseArray("parameter13", "操作",
- new BooleanObject[]
- {
- new BooleanObject("1", "测量线", true, null),
- new BooleanObject("2", "截点", true, null)
- });
- thirteen.initialValue = 1;
- thirteen.value = 1;
- lists.Add(thirteen);
- //形状
- ChoiseArray fourteen = new ChoiseArray("parameter14", "形状",
- new BooleanObject[]
- {
- new BooleanObject("1", "圆形", true, null),
- new BooleanObject("2", "方形", true, null)
- });
- fourteen.initialValue = 1;
- fourteen.value = 1;
- lists.Add(fourteen);
- //样式
- ChoiseArray fifteen = new ChoiseArray("parameter15", "样式",
- new BooleanObject[]
- {
- new BooleanObject("1", "实心", true, null),
- new BooleanObject("2", "空心", true, null)
- });
- fifteen.initialValue = 1;
- fifteen.value = 1;
- lists.Add(fifteen);
- //大小
- IntegerNumber sixteen = new IntegerNumber(1, 100);
- sixteen.key = "parameter16";
- sixteen.name = "大小";
- sixteen.initialValue = 20;
- sixteen.value = 20;
- lists.Add(sixteen);
- //颜色
- ColorNumber twentyTwo = new ColorNumber();
- twentyTwo.key = "parameter22";
- twentyTwo.name = "颜色";
- twentyTwo.Value = Color.Yellow.ToArgb();
- lists.Add(twentyTwo);
- //线宽
- IntegerNumber seventeen = new IntegerNumber(1, 100);
- seventeen.key = "parameter17";
- seventeen.name = "线宽";
- seventeen.initialValue = 1;
- seventeen.value = 1;
- lists.Add(seventeen);
- //误差
- IntegerNumber eighteen = new IntegerNumber(1, 10000);
- eighteen.key = "parameter18";
- eighteen.name = "误差";
- eighteen.initialValue = 30;
- eighteen.value = 30;
- lists.Add(eighteen);
- BooleanObject nineteen = new BooleanObject();
- nineteen.key = "parameter19";
- nineteen.name = "显示二值数据";
- nineteen.initialValue = false;
- nineteen.Value = false;
- lists.Add(nineteen);
- BooleanObject twenty = new BooleanObject();
- twenty.key = "parameter20";
- twenty.name = "显示网格";
- twenty.initialValue = false;
- twenty.Value = false;
- lists.Add(twenty);
- BooleanObject twentyOne = new BooleanObject();
- twentyOne.key = "parameter21";
- twentyOne.name = "显示截点";
- twentyOne.initialValue = false;
- twentyOne.Value = false;
- lists.Add(twentyOne);
- }
- }
- }
|