From b95a6169777f1dc43cfb3a3fc05fff8097bbd9d8 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Thu, 20 Dec 2018 10:18:03 +0200 Subject: Playground WIP --- playground/multi.ipynb | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 playground/multi.ipynb (limited to 'playground/multi.ipynb') diff --git a/playground/multi.ipynb b/playground/multi.ipynb new file mode 100644 index 0000000..aa274f6 --- /dev/null +++ b/playground/multi.ipynb @@ -0,0 +1,67 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "import cv2\n", + "from matplotlib import pyplot as plt" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "imgs = [cv2.imread(f'samples/series/{i}.png') for i in range(1, 10)]" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "gray = [cv2.cvtColor(im, cv2.COLOR_BGR2GRAY) for im in imgs]\n", + "gray = [np.float64(im) for im in gray]\n", + "noise = np.random.randn(*gray[1].shape)*10\n", + "noisy = [im + noise for im in gray]\n", + "noisy = [np.uint8(np.clip(im, 0, 255)) for im in noisy]" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "dst = cv2.fastNlMeansDenoisingMulti(noisy, 2, 5, None, 4, 7, 35)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} -- cgit v1.3.1