RenderKit / oidn

Intel® Open Image Denoise library
https://www.openimagedenoise.org/
Apache License 2.0
1.78k stars 164 forks source link

Denoising a PNG #188

Closed kirilllzaitsev closed 9 months ago

kirilllzaitsev commented 9 months ago

I want to postprocess files in the PNG format and have an oidnDenoise executable compiled with -D OIDN_APPS_OPENIMAGEIO=ON. When I run ./build/oidnDenoise --hdr /home/user/cbox.png --output /home/user/cbox.output2.png, I get these two images which look identical: Denoised: image Original image

Here is the full output:

❯ ./build/oidnDenoise --hdr /home/user/cbox.png --output /home/user/cbox.output2.png
./build/oidnDenoise: /home/user/.conda/envs/sc/lib/libcurl.so.4: no version information available (required by /lib/libgdal.so.30)
./build/oidnDenoise: /home/user/.conda/envs/sc/lib/libcurl.so.4: no version information available (required by /lib/x86_64-linux-gnu/libnetcdf.so.19)
./build/oidnDenoise: /home/user/.conda/envs/sc/lib/libcurl.so.4: no version information available (required by /lib/x86_64-linux-gnu/libhdf5_serial.so.103)
Initializing device
  device=CPU, version=2.1.0, msec=5.20193
Loading input
Resolution: 800x600
Initializing filter
  filter=RT, msec=5.80423
Denoising 100%
  msec=174.73
Saving output

I tried converting the PNG to PFM using ./training/convert_image.py with the same result.

I'm wondering if I'm misusing the program or if that's an installation issue.

At the same time, denoising for another PNG (stored also in the uint8 format) works: image

atafra commented 9 months ago

It's a bit hard to say just by looking at the image but it looks like the issue is with the pixel reconstruction filter used in the image. OIDN supports only filter importance sampling. If spatting is used (which is likely the case here), this is the expected result (no denoising).

kirilllzaitsev commented 9 months ago

Thank you, the issue was exactly with the reconstruction filter. Setting its type to Box in the rendering configuration file allowed to denoise the rendered image.