A practical noise generator is provided in this repository.
The Poissonian-Gaussian model is used to the model the noise. The Poissonian-Gaussian model model has two parameters: π and π, where π is related to the variance of Poissonian component and π the variance of the Gaussian component. The Smartphone Image Denoising Dataset (SIDD) is used to estimate π and π for each of the color components (R,G,B).
The following example generates N number of noisy image for the given $IMG_DIR using the provided noise generator and saves them in OUT_DIR
python ./noise_sampling.py --img_dir $IMG_DIR --n_obs $N --out_dir $OUT_DIRThe code first obtains (π, π) for each color component. Then generates noisy image according to the sampled parameters. img_syn_noisy_q variable is the quantized noisy image that can be stored or used in the training dataloader.
- create conda environment:
conda create -n test_generator python=3.6.9 - activate environment:
conda activate test_generator - install dependencies:
pip install -r requirements.txt