Channel Median

1 개요

이미지에서 픽셀의 중앙값을 추출하는 알고리즘입니다.

2 알고리즘 상세 설명

median(x)={xn/2+x(n/2)+12if n is evenx(n+1)/2if n is odd\large median(x) = \begin{cases} \frac{x_{n/2}+x_{(n/2)+1}}{2} & \quad \text{if } n \text{ is even}\\ x_{(n+1)/2} & \quad \text{if } n \text{ is odd} \end{cases}

NN 채널 이미지에서 중앙값을 추출하여 1채널 이미지로 결과를 출력합니다. 정수형 포맷에서 채널이 짝수인 경우, 소수점은 버림 처리됩니다.

Source Value Destination Value
Source Image Destination Image
Fig. Channel Median 동작 예시

3 예제

CFLImage fliSourceImage;
CFLImage fliDestinationImage;

CChannelMedian channelMedian;
channelMedian.SetSourceImage(fliSourceImage);
channelMedian.SetDestinationImage(fliDestinationImage);

channelMedian.Execute();
CFLImage fliSourceImage = new CFLImage();
CFLImage fliDestinationImage = new CFLImage();

CChannelMedian channelMedian = new CChannelMedian();
channelMedian.SetSourceImage(ref fliSourceImage);
channelMedian.SetDestinationImage(ref fliDestinationImage);

channelMedian.Execute();