summaryrefslogtreecommitdiff
path: root/playground/multi.ipynb
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2018-12-20 10:18:03 +0200
committerYuval Adam <_@yuv.al>2018-12-20 10:18:03 +0200
commitb95a6169777f1dc43cfb3a3fc05fff8097bbd9d8 (patch)
tree875ccb16583e760347feb94be502835c1b677b92 /playground/multi.ipynb
parentfd28acccc2dcc8ee4a4f2dc6ff6804c790195c6a (diff)
Playground WIP
Diffstat (limited to 'playground/multi.ipynb')
-rw-r--r--playground/multi.ipynb67
1 files changed, 67 insertions, 0 deletions
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
+}