16.12.2 Noise Generator

1 개요

원본 이미지에 노이즈를 생성하는 알고리즘입니다.

2 알고리즘 상세 설명

생성할 Noise의 Type을 먼저 지정해야 합니다. Default는 Salt & Pepper Noise로 설정되어 있습니다.

Source Image Result Information
Source Result
Fig. Noise Generator 동작 예시

멤버함수 파라미터 설 명
SetNoiseType CNoiseGenerator::ENoiseType eNoiseType IN Noise Type 설정

지원되는 Noise Type과 ENum은 다음과 같습니다.

Salt & Pepper

Noise를 생성할 비율을 0 ~ 1로 설정할 수 있습니다. 0인 경우 Noise를 생성하지 않으며, 1인 경우 이미지 모든 영역에 Noise를 생성합니다. 이미지에서 지원되는 표현범위의 최대, 최소의 값을 Salt, Pepper 값으로 설정합니다. 실수형 이미지의 경우 기본 0~1 범위를 사용하지만 이를 초과한 값이 존재하는 경우 해당 이미지의 픽셀 값중 Min값과 Max값을 측정하여 사용합니다.

멤버함수 파라미터 설 명
SetSaltAndPepperNoise double f64Ratio IN Salt & Pepper Noise를 생성할 비율

Gaussian Noise

이미지 모든 영역에 평균 m, 표준편차 s인 Gaussian Distribution에서 추출된 임의의 수치를 더하여 노이즈를 생성합니다.

멤버함수 파라미터 설 명
SetGaussianDistNoise double f64Mean IN Gaussian Distribution의 평균
double f64Stdev IN Gaussian Distribution의 표준편차

Uniform Noise

이미지 모든 영역에 0 ~ 1 범위의 Uniform Distribution에서 0.5를 기준으로 확률값으로 생각하여 각 Depth에 맞춰 최대, 최솟값 범위를 선형적으로 Scaling한 값을 더하여 노이즈를 생성합니다.

멤버함수 파라미터 설 명
SetUniformDistNoise double f64Ratio IN Uniform Distribution의 비율

Speckle Noise

Noise를 생성할 비율을 0 ~ 1로 설정할 수 있습니다. 0인 경우 Noise를 생성하지 않으며, 1인 경우 이미지 모든 영역에 Noise를 생성합니다. Noise를 생성할 픽셀에 임의의 이미지 내 픽셀을 곱하여 Noise를 표현합니다.

멤버함수 파라미터 설 명
SetSpeckelNoise double f64Ratio IN 이미지에 Noise를 생성할 비율을 설정합니다.

Photon Noise

광자의 개수 n에 대한 Possion Distribution에 따른 값을 입력된 개수로 판단하여 광자 개수의 비율만큼 각 픽셀 밝기를 재조정합니다. Possion Distribution 이므로 광자의 개수 n, 평균 n 표준편차가 n\sqrt{n}인 Gaussian Distribution을 따르는 값을 추출하여 노이즈를 생성합니다.

멤버함수 파라미터 설 명
SetPhotonNoise uint64_t_ u64PhotonCount IN 평균 광자 개수

3 예제

CFLImage fliSourceImage;
CFLImage fliDestinationImage;

CNoiseGenerator noiseGenerator;
noiseGenerator.SetSourceImage(fliSourceImage);
noiseGenerator.SetDestinationImage(fliDestinationImage);

noiseGenerator.SetNoiseType(CNoiseGenerator::ENoiseType_SaltAndPepper);
noiseGenerator.SetSaltAndPepperNoise(0.1);

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

CNoiseGenerator noiseGenerator = new CNoiseGenerator();

noiseGenerator.SetSourceImage(ref fliSourceImage);
noiseGenerator.SetDestinationImage(ref fliDestinationImage);

noiseGenerator.SetNoiseType(CNoiseGenerator.ENoiseType.SaltAndPepper);
noiseGenerator.SetSaltAndPepperNoise(0.100000);

noiseGenerator.Execute();