Hysteresis Threshold
1 개요
전역 이중 임계값과 지역 연결성을 통해 이미지를 이진화하는 알고리즘입니다.
2 알고리즘 상세 설명
High Threshold 를 통과한 강한 강도의 픽셀은 항상 유지하며, 강한 강도의 픽셀과 연결된 중간 강도의 픽셀도 함께 유지합니다. 연결성은 인근 8 픽셀에 있을 시 연결되었다고 판단하며, 연결된 길이가 Max Length 이하인 픽셀들만 함께 유지됩니다.
Output Mode 설정을 통하여 이진화, 회색조, 원본 색상 중 원하는 방식의 출력을 얻을 수 있습니다.
Source Image | Destination Image |
---|---|
![]() |
![]() |
3 파라미터 설정 및 사용 방법
동작을 위한 최소한의 기본 설정 파라미터는 아래와 같습니다.
-
const CResult SetMaxLength(int32_t i32MaxLength)
강한 강도의 픽셀과 연결된 중간 강도의 픽셀이 유지되는 최대 거리인 Max Length 값을 설정합니다.i32MaxLength
: Max Length 값
-
const CResult SetOutputMode(CHysteresisThreshold::EOutputMode eOutputMode)
출력 방식을 설정합니다.eOutputMode
: 출력 방식
EOutputMode_Original: 소스 이미지의 원본 픽셀값을 유지합니다.
EOutputMode_Grayscale: 소스 이미지의 원본 픽셀값의 회색조로 출력합니다.
EOutputMode_Binary: 이진화된 이미지로 출력합니다.
Default: EOutputMode_Binary
-
const CResult SetLogicalConditionOfChannels(ELogicalConditionOfChannels eLogicalConditionOfChannels)
각 채널 Threshold 결과 간 연산자를 설정합니다.eLogicalConditionOfChannels
: 각 채널 Threshold 결과 간 연산자
ELogicalConditionOfChannels_And: 채널 조건이 모두 만족하는 경우 통과합니다.
ELogicalConditionOfChannels_Or: 채널 조건 중 하나가 만족하는 경우 통과합니다.
Default: ELogicalConditionOfChannels_And
-
const CResult SetLowThreshold(CMultiVar<double> mvLowThreshold)
중간 강도의 픽셀과 약한 강도의 픽셀을 구분짓는 낮은 임계값을 설정합니다.mvLowThreshold
: 낮은 임계값
-
const CResult SetHighThreshold(CMultiVar<double> mvHighThreshold)
강한 강도의 픽셀과 중간 강도의 픽셀을 구분짓는 높은 임계값을 설정합니다.mvHighThreshold
: 높은 임계값
4 예제 코드
CHysteresisThreshold ht;
CFLImage fliSourceImage;
CFLImage fliDestinationImage;
ht.SetSourceImage(fliSourceImage);
ht.SetDestinationImage(fliDestinationImage);
ht.SetMaxLength(100);
ht.SetOutputMode(CHysteresisThreshold::EOutputMode_Binary);
ht.SetLogicalConditionOfChannels(ELogicalConditionOfChannels_And);
ht.SetLowThreshold(140);
ht.SetHighThreshold(190);
ht.Execute();
5 기타 사항
Supported Feature
- Image
- Source Image
- Destination Image
- ROI
- Source ROI
- Destination ROI
- Pivot
- Source Pivot
- Destination Pivot
- Blank Color
- Figure Transform
- Batch Processing
Supported Format
- Source
- Channel
- 1-10
- Combined, Separated
- Value Type & Depth
- Signed: 8, 9-16, 32
- Unsigned: 8, 9-16, 32
- Floating: 32, 64
- Channel
- Destination
- Channel
- Source 와 일치하는 경우 지원
- Value Type & Depth
- Destination 이미지가 존재할 때, Source 와 일치하는 경우 지원
- Destination 이미지를 생성하는 경우, Source 추종
- Channel