Skip to content

Instantly share code, notes, and snippets.

@tjlane
Last active March 12, 2019 13:56
Show Gist options
  • Save tjlane/f00da99ab6ab64ae4f3f42a82b8c232a to your computer and use it in GitHub Desktop.
Save tjlane/f00da99ab6ab64ae4f3f42a82b8c232a to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Populating the interactive namespace from numpy and matplotlib\n"
]
}
],
"source": [
"%pylab inline\n",
"from scipy import signal"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQYAAAD8CAYAAACVSwr3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAADIJJREFUeJzt3F+MnXWdx/H3Z2mpWcRAxW1qaRY03Yt6YW0mhURi2JAV6E3xhsCFNIZkvCiJJu5F1Qu5dDerJiS7JDUSy8aFJSqhF+wqNCZkL0AGUksLIiOW0G5p18UgWZPa4ncv5ike+5thpnPOM+fM7vuVnJzn/M5z5nz7pHnn/E9VIUmD/mzcA0iaPIZBUsMwSGoYBkkNwyCpYRgkNXoLQ5JbkrycZDbJ3r7uR9LopY/PMSS5BPgF8DfAceBZ4M6qenHkdyZp5Pp6xLADmK2qV6vq98DDwK6e7kvSiK3p6e9uAl4fuHwcuG6hnS/Nunofl/U0iiSAt/nNr6vqQ0vZt68wLCrJNDAN8D7+nOty07hGkf5feLK+/9pS9+3rqcQJYPPA5au7tXdV1b6qmqqqqbWs62kMScvRVxieBbYkuTbJpcAdwIGe7kvSiPXyVKKqziW5B/gRcAnwQFUd7eO+JI1eb68xVNXjwON9/X1J/fGTj5IahkFSwzBIahgGSQ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+bns/cNtKD1BVTwFvXrC80Fy7gAdrztPAFRd8pL1XC8y6kLF9bb8W/omBiTqu7zHnQi76mI47DEv6ivaYFfDjJM8lme7WNlTVyW77DWDDeEZrLDTXpB7nZX9tv28X/MTAxB7XUf4UwqBxh2E1uKGqtgO3AnuSfGrwypp7rDZxb+1M6lwDhvrafp/m+YmBd03ScR31TyEMGncYJv4r2lV1ojs/DTzK3EOwU+cfMnbnp8c34Z9YaK6JO841oV/bn+8nBpjA49r3TyGMOwzPAluSXJvkUuZ+K/LAmGd6V5LLut+5JMllwKeZ+3r5AWB3t9tu4LHxTNhYaK4DwF3dq+jXA28NPDQei0n82v5CPzHAhB3XheYc6TFdiVdRF3mFdSdzr6r+EvjquOe5YLaPMPdq7s+Ao+fnAz4IHAReAZ4E1o9htoeYe7h4lrnnjHcvNBdzr5r/Y3eMXwCmJmDWf+5mOdz9x904sP9Xu1lfBm5dwTlvYO5pwmHgUHfaOWnH9T3mHNkx9ZOPkhrjfiohaQIZBkkNwyCpYRgkNQyDpIZhkNQwDJIahkFS438BkVhp+jb+Ds8AAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"image = np.zeros((256, 256))\n",
"image[30,50] = 1\n",
"image[120,140] = 1\n",
"imshow(image)\n",
"show()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(256, 256)\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQYAAAD8CAYAAACVSwr3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAFnpJREFUeJzt3U+MHOd95vHvU9XVPZwhTZFRQjGUvFYM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Lppe879I3/F3geNTUOt/T7W8kv7iHh05/o9Srd8HPnob6/wQzWXCK8DL6efxafteb1Hnnn2nHvloZi2TvpQwsynkYDCzFgeDmbU4GMysxcFgZi0OBjNrcTCYWYuDwcxa/h0YNTG9V9KejwAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"k = signal.windows.gaussian(image.shape[0], std=5)\n",
"k2 = np.outer(k,k)\n",
"x = signal.convolve2d(image, k2, mode='same')\n",
"imshow(x)\n",
"print(x.shape)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"def fftdeconvolve(in1, in2, mode=\"full\"):\n",
" \"\"\"Deconvolve two N-dimensional arrays using FFT. See convolve.\n",
"\n",
" \"\"\"\n",
"\n",
" IN1 = np.fft.fftn(in1) / np.fft.fftn(in2)\n",
"\n",
" ret = np.fft.ifftn(IN1).copy()\n",
"\n",
" return np.nan_to_num(ret.real)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/usr/local/lib/python3.7/site-packages/ipykernel_launcher.py:6: RuntimeWarning: divide by zero encountered in true_divide\n",
" \n",
"/usr/local/lib/python3.7/site-packages/ipykernel_launcher.py:6: RuntimeWarning: invalid value encountered in true_divide\n",
" \n"
]
},
{
"data": {
"text/plain": [
"0.0"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQYAAAD8CAYAAACVSwr3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAADHBJREFUeJzt3F/o3fV9x/HnaxpTZi2a2YUshmlL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 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"a = fftdeconvolve(x, k2)\n",
"imshow(a)\n",
"a.max()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"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.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Populating the interactive namespace from numpy and matplotlib\n"
]
}
],
"source": [
"%pylab inline\n",
"from scipy import signal"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQYAAAD8CAYAAACVSwr3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAADIJJREFUeJzt3F+MnXWdx/H3Z2mpWcRAxW1qaRY03Yt6YW0mhURi2JAV6E3xhsCFNIZkvCiJJu5F1Qu5dDerJiS7JDUSy8aFJSqhF+wqNCZkL0AGUksLIiOW0G5p18UgWZPa4ncv5ike+5thpnPOM+fM7vuVnJzn/M5z5nz7pHnn/E9VIUmD/mzcA0iaPIZBUsMwSGoYBkkNwyCpYRgkNXoLQ5JbkrycZDbJ3r7uR9LopY/PMSS5BPgF8DfAceBZ4M6qenHkdyZp5Pp6xLADmK2qV6vq98DDwK6e7kvSiK3p6e9uAl4fuHwcuG6hnS/Nunofl/U0iiSAt/nNr6vqQ0vZt68wLCr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2AS4BfAh8BLgV+Bmwd50zzzHgMuOqCtb8H9nbbe4G/G8NcnwK2A0cWmwvYCfwbEOB64JkJmPVe4G/n2Xdr9/9gHXBt9//jkhWacyOwvdu+HPhFN89EHdf3mHNkx3Tcjxh2ALNV9WpV/R54mLmvbU+6XcD+bns/cNtKD1BVTwFvXrC80Fy7gAdrztPAFRd8pL1XC8y6kLF9bb8W/omBiTqu7zHnQi76mI47DEv6ivaYFfDjJM8lme7WNlTVyW77DWDDeEZrLDTXpB7nZX9tv28X/MTAxB7XUf4UwqBxh2E1uKGqtgO3AnuSfGrwypp7rDZxb+1M6lwDhvrafp/m+YmBd03ScR31TyEMGncYJv4r2lV1ojs/DTzK3EOwU+cfMnbnp8c34Z9YaK6JO841oV/bn+8nBpjA49r3TyGMOwzPAluSXJvkUuZ+K/LAmGd6V5LLut+5JMllwKeZ+3r5AWB3t9tu4LHxTNhYaK4DwF3dq+jXA28NPDQei0n82v5CPzHAhB3XheYc6TFdiVdRF3mFdSdzr6r+EvjquOe5YLaPMPdq7s+Ao+fnAz4IHAReAZ4E1o9htoeYe7h4lrnnjHcvNBdzr5r/Y3eMXwCmJmDWf+5mOdz9x904sP9Xu1lfBm5dwTlvYO5pwmHgUHfaOWnH9T3mHNkx9ZOPkhrjfiohaQIZBkkNwyCpYRgkNQyDpIZhkNQwDJIahkFS438BkVhp+jb+Ds8AAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"image = np.zeros((256, 256))\n",
"image[30,50] = 1\n",
"image[120,140] = 1\n",
"imshow(image)\n",
"show()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(256, 256)\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQYAAAD8CAYAAACVSwr3AAAABHNCSVQICAgIfAhkiAAAAAlwSFl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q0qwVeWrCNa2TtJDWuUTSAvDrNNPLTwFPpsOeBL4ymQpbblbXKeCTqRf9UWBxpGk8EdM4bf9mSwwwZd/rzerc0+/0dvSibtLD+jhNr+oPgT+adD031PYLNL25/wy8tlYf8DPAS8APgK8BhydQ2xdpmosDmmvGT92sLppe879I3/F3geNTUOt/T7W8kv7iHh05/o9Srd8HPnob6/wQzWXCK8DL6efxafteb1Hnnn2nHvloZi2TvpQwsynkYDCzFgeDmbU4GMysxcFgZi0OBjNrcTCYWYuDwcxa/h0YNTG9V9KejwAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"k = signal.windows.gaussian(image.shape[0], std=5)\n",
"k2 = np.outer(k,k)\n",
"x = signal.convolve2d(image, k2, mode='same')\n",
"imshow(x)\n",
"print(x.shape)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"def fftdeconvolve(in1, in2, mode=\"full\"):\n",
" \"\"\"Deconvolve two N-dimensional arrays using FFT. See convolve.\n",
"\n",
" \"\"\"\n",
"\n",
" IN1 = np.fft.fftn(in1) / np.fft.fftn(in2)\n",
"\n",
" ret = np.fft.ifftn(IN1).copy()\n",
"\n",
" return np.nan_to_num(ret.real)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/usr/local/lib/python3.7/site-packages/ipykernel_launcher.py:6: RuntimeWarning: divide by zero encountered in true_divide\n",
" \n",
"/usr/local/lib/python3.7/site-packages/ipykernel_launcher.py:6: RuntimeWarning: invalid value encountered in true_divide\n",
" \n"
]
},
{
"data": {
"text/plain": [
"0.0"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQYAAAD8CAYAAACVSwr3AAAABHNCSVQICAgIfAhkiAAAAA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Ds/7TMMvh4T/ulpH9vzrM+gJw3RrOeRXzTxMOA08Np52zdlzfZ86xHVM/+SipmfZTCUkzyDBIagyDpMYwSGoMg6TGMEhqDIOkxjBIav4XoTFm+s1FrB0AAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"a = fftdeconvolve(x, k2)\n",
"imshow(a)\n",
"a.max()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"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.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment