denoising blender animations with opencv and python

Nikolaus Gradwohl2017-04-07T05:42:22+02:00

Nikos Priniotakis posted a teaser of a denoising script for blender animations a few months ago, that shows really impressive improvements on a noisy cycles animation (see his original tweet here) I sent some twitter messages back and forth with him and he sent me the links to the opencv denoise function he used for the demo. So I finaly found the time to wirte a short python script that uses pyopencv to denoise all the pictures in a folder and copies it to another folder.

The script I used to denoise my animation is here

import cv2
import os
import numpy as np
from matplotlib import pyplot as plt
files = os.listdir("metabubbles/")
for f in files:
    if f.endswith('.png') and f.startswith('0'):
        print f
        img = cv2.imread("metabubbles/%s" %f);
        dst = cv2.fastNlMeansDenoisingColored(img)
        cv2.imwrite('res/%s' %f, dst);

The denoising process is no magical pixiedust that can be sprinkled on your noisy cycles-renders to fix everything but when used correcly it can improve preview renders a lot, but if the script is used on an image sequence that is too noisy it introduced a whole lot of new artifacts. I used the script on an amiation I rendered last year. Here is how the original video compares to the denoised version.

denoising blender animations

read more ...