2026-01-26 18:56:53 +09:00

52 lines
1.4 KiB
C#

/*
* 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<MorphologyParam> {
public bool Enabled { get; set; } = false;
public List<eMorphologyType> Types { get; set; } = new List<eMorphologyType>();
public List<int> RepeatCounts { get; set; } = new List<int>();
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;
}
}
}
}