/* * Copyright (c) 2025 LG Electronics Inc. * SPDX-License-Identifier: LicenseRef-LGE-Proprietary */ using System; using System.Collections.Generic; namespace VisionCommon { public enum eMorphologyType { None, Open, Close, Dilate, Erode } public class MorphologyParam : ICloneCopy { public bool Enabled { get; set; } = false; public List Types { get; set; } = new List(); public List RepeatCounts { get; set; } = new List(); public MorphologyParam Clone() { return ((ICloneable)this).Clone() as MorphologyParam; } public void CopyTo(MorphologyParam target) { target.Enabled = this.Enabled; target.Types = this.Types.ConvertAll(s => s); target.RepeatCounts = this.RepeatCounts.ConvertAll(s => s); } object ICloneable.Clone() { var cloneObj = new MorphologyParam(); CopyTo(cloneObj); return cloneObj; } public bool IsAllZero() { int cnt = 0; foreach (var count in RepeatCounts) { cnt = cnt + count; } if (cnt == 0) { return true; } else { return false; } } } }