Hysteresis Threshold

1 개요

전역 이중 임계값과 지역 연결성을 통해 이미지를 이진화하는 알고리즘입니다.

2 알고리즘 상세 설명

High Threshold 를 통과한 강한 강도의 픽셀은 항상 유지하며, 강한 강도의 픽셀과 연결된 중간 강도의 픽셀도 함께 유지합니다. 연결성은 인근 8 픽셀에 있을 시 연결되었다고 판단하며, 연결된 길이가 Max Length 이하인 픽셀들만 함께 유지됩니다.

Output Mode 설정을 통하여 이진화, 회색조, 원본 색상 중 원하는 방식의 출력을 얻을 수 있습니다.

Source Image Destination Image
Source Image Destination Image
Fig. Source and Destination images of Hysteresis Threshold

3 파라미터 설정 및 사용 방법

동작을 위한 최소한의 기본 설정 파라미터는 아래와 같습니다.

4 예제 코드

CHysteresisThreshold hysteresisThreshold;

CFLImage fliSourceImage;
CFLImage fliDestinationImage;

hysteresisThreshold.SetSourceImage(fliSourceImage);
hysteresisThreshold.SetDestinationImage(fliDestinationImage);
hysteresisThreshold.SetMaxLength(100);
hysteresisThreshold.SetOutputMode(CHysteresisThreshold::EOutputMode_Binary);
hysteresisThreshold.SetLogicalConditionOfChannels(ELogicalConditionOfChannels_And);
hysteresisThreshold.SetLowThreshold(140);
hysteresisThreshold.SetHighThreshold(190);

hysteresisThreshold.Execute();
CHysteresisThreshold hysteresisThreshold = new CHysteresisThreshold();

CFLImage fliSourceImage = new CFLImage();
CFLImage fliDestinationImage = new CFLImage();

hysteresisThreshold.SetSourceImage(ref fliSourceImage);
hysteresisThreshold.SetDestinationImage(ref fliDestinationImage);
hysteresisThreshold.SetMaxLength(100);
hysteresisThreshold.SetOutputMode(CHysteresisThreshold.EOutputMode.Binary);
hysteresisThreshold.SetLogicalConditionOfChannels(ELogicalConditionOfChannels.And);
hysteresisThreshold.SetLowThreshold(140);
hysteresisThreshold.SetHighThreshold(190);

hysteresisThreshold.Execute();
hysteresisThreshold = CHysteresisThreshold()

fliSourceImage = CFLImage()
fliDestinationImage = CFLImage()

hysteresisThreshold.SetSourceImage(fliSourceImage)
hysteresisThreshold.SetDestinationImage(fliDestinationImage)
hysteresisThreshold.SetMaxLength(100)
hysteresisThreshold.SetOutputMode(CHysteresisThreshold.EOutputMode.Binary)
hysteresisThreshold.SetLogicalConditionOfChannels(ELogicalConditionOfChannels.And)
hysteresisThreshold.SetLowThreshold(140)
hysteresisThreshold.SetHighThreshold(190)

hysteresisThreshold.Execute()

5 기타 사항

Supported Feature

Supported Format