Action914.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using PaintDotNet.Adjust;
  2. using PaintDotNet.Base;
  3. using PaintDotNet.Base.Enum;
  4. using PaintDotNet.Base.Functionodel;
  5. using PaintDotNet.Data.Param;
  6. using System.Collections.Generic;
  7. using System.Drawing;
  8. namespace PaintDotNet.Data.Action
  9. {
  10. /// <summary>
  11. /// 孔洞删除,针对相
  12. /// </summary>
  13. public class Action914 : ParamObject
  14. {
  15. public double outmin, outmax;
  16. public override OpenCvSharp.Mat PerformProcess(PhaseModel phaseModel, double rule)
  17. {
  18. return Adjust.MorphologyIntent.HoleRemoval(phaseModel.mat, this.Lists, phaseModel.color, rule, out outmin, out outmax);
  19. }
  20. public Action914()
  21. {
  22. this.MenuId = ActionType.ActionHoleRemoval;
  23. this.OpenImage = "currentPhase";
  24. //this.OpenImage = "";//###
  25. ////this.OpenImage = "currentPhase";
  26. StringArray stringArray = new StringArray();
  27. stringArray.key = "FilterParameters";
  28. stringArray.name = PdnResources.GetString("Menu.Filterparams.text");
  29. stringArray.initialValue = InvariantData.filterparameters;
  30. stringArray.Value = FilterParameters.Area;
  31. lists.Add(stringArray);
  32. List<double> oneL = new List<double>();
  33. oneL.Add(0);
  34. oneL.Add(0);
  35. DecimalScope one = new DecimalScope(0, int.MaxValue);
  36. one.key = "Scope";
  37. one.name = PdnResources.GetString("Menu.numberrange.text");
  38. one.value = oneL;
  39. lists.Add(one);
  40. StringArray unitsArray = new StringArray();
  41. unitsArray.key = "UnitParameters";
  42. unitsArray.name = PdnResources.GetString("Menu.filterunit.text");
  43. unitsArray.initialValue = InvariantData.unitparameters;
  44. unitsArray.Value = MeasurementUnit.Micron;
  45. lists.Add(unitsArray);
  46. ColorNumber phase0Color = new ColorNumber();
  47. phase0Color.key = "HoleColor";
  48. phase0Color.name = PdnResources.GetString("Menu.Binaryoperation.Holedelete.Holecolor.text");
  49. phase0Color.Value = Color.Yellow.ToArgb();
  50. phase0Color.initialValue = Color.Yellow.ToArgb();
  51. lists.Add(phase0Color);
  52. }
  53. }
  54. }