Image Threshold

1 개요

Operand 이미지를 사용한 임곗값을 통해 이진화 연산을 수행하는 알고리즘

2 알고리즘 상세 설명

Operand 이미지 픽셀값을 임곗값으로 사용하여 이진화를 진행합니다.

원본 이미지 Operand 이미지 Image Threshold 결과 이미지
Image Threshold Normal Source Image Threshold Normal Operand Image Threshold Normal Destination
Fig. Normal 모드 결과

기본 Normal 모드에서는 각 원본 이미지 픽셀의 값이 Operand 이미지 픽셀값 - offset 값보다 크거나 같으면 범위 내값(Range Value), 작으면 범위 외값(Out of Range Value)을 출력합니다.

예시에 사용된 Operand Image는 원본 이미지에 FL Denoising Type1을 적용한 결과입니다. 특정 Denoising/Smoothing 계열 알고리즘 등의 결과로 Threshold 처리를 하여 알고리즘 사용성을 높일 수 있습니다.

원본 이미지 Operand 이미지 Image Threshold 결과 이미지 (offset = 3)
Image Threshold Range Source Gaussian Filter Result Image Threshold Range Destination
Fig. Range 모드 결과

Range 모드에서는 원본 이미지의 각 픽셀의 값과 Operand 이미지 픽셀값의 차이가 offset보다 작으면 범위 내값(Range Value), 크거나 같으면 범위 외값(Out of Range Value)을 출력합니다.

원본 이미지 Channel Condition And Channel Condition Or
Image Threshold Channel Source Image Threshold Channel And Result Image Threshold Channel Or Result
Fig. 채널 조건별 결과

다채널 이미지의 경우, 채널별 조건을 파라미터로 설정하여 최종 이진화 결과를 결정합니다.

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

4 예제 코드

CImageThreshold imageThreshold;

CFLImage fliSourceImage;
CFLImage fliOperandImage;
CFLImage fliDestinationImage;

imageThreshold.SetSourceImage(fliSourceImage);
imageThreshold.SetOperandImage(fliOperandImage);
imageThreshold.SetDestinationImage(fliDestinationImage);

imageThreshold.SetThresholdMethod(CImageThreshold::EThresholdMethod_Range);

CMultiVar<double> mvOffset(3.0);

imageThreshold.SetThresholdOffset(mvOffset);

imageThreshold.Execute();

CImageThreshold imageThreshold = new CImageThreshold();

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

imageThreshold.SetSourceImage(ref fliSourceImage);
imageThreshold.SetOperandImage(ref fliOperandImage);
imageThreshold.SetDestinationImage(ref fliDestinationImage);

imageThreshold.SetThresholdMethod(CImageThreshold.EThresholdMethod.Range);

CMultiVar<double> mvOffset = new CMultiVar<double>(3.0);

imageThreshold.SetThresholdOffset(mvOffset);

imageThreshold.Execute();