48 lines
1.6 KiB
C#
48 lines
1.6 KiB
C#
using System;
|
|
|
|
namespace VisionCommon {
|
|
public class PreProcessingParam : ICloneCopy<PreProcessingParam> {
|
|
public FilteringParam FilParam { get; set; } = new FilteringParam();
|
|
public BinarizationParam BinParam { get; set; } = new BinarizationParam();
|
|
public MorphologyParam MorphParam { get; set; } = new MorphologyParam();
|
|
public CustomizeMaskParam CustomizeMaskParam { get; set; } = new CustomizeMaskParam();
|
|
public CommonPreProcessParam CommonParam { get; set; } = new CommonPreProcessParam();
|
|
public bool Enabled() {
|
|
return FilteringEnabled() || BinaryEnabled();
|
|
}
|
|
public bool FilteringEnabled() {
|
|
return FilParam.Enabled;
|
|
}
|
|
|
|
public bool BinaryEnabled() {
|
|
return BinParam.Enabled;
|
|
}
|
|
|
|
public bool MorphEnabled() {
|
|
return BinParam.Enabled && MorphParam.Enabled;
|
|
}
|
|
|
|
public bool CustomizeMaskEnable()
|
|
{
|
|
return CustomizeMaskParam.Enabled;
|
|
}
|
|
|
|
public PreProcessingParam Clone() {
|
|
return ((ICloneable)this).Clone() as PreProcessingParam;
|
|
}
|
|
|
|
object ICloneable.Clone() {
|
|
var cloneObj = new PreProcessingParam();
|
|
CopyTo(cloneObj);
|
|
return cloneObj;
|
|
}
|
|
|
|
public void CopyTo(PreProcessingParam target) {
|
|
target.FilParam = this.FilParam.Clone();
|
|
target.BinParam = this.BinParam.Clone();
|
|
target.MorphParam = this.MorphParam.Clone();
|
|
target.CustomizeMaskParam = this.CustomizeMaskParam.Clone();
|
|
target.CommonParam = this.CommonParam.Clone();
|
|
}
|
|
}
|
|
} |