diff --git a/images-exp.ipynb b/images-exp.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..30dcf1ab5103b1a0eaa650f349125befd83a3121 --- /dev/null +++ b/images-exp.ipynb @@ -0,0 +1,53 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Working with images in Python." + ] + }, + { + "cell_type": "code", + "metadata": {}, + "source": [ + "%matplotlib inline\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "import imageio\n", + "f0 = imageio.imread('http://sipi.usc.edu/database/download.php?vol=misc&img=4.2.03', as_gray=True)/255\n", + "N = f0.shape[0]\n", + "M = f0.shape[1]\n", + "np.random.seed(42)\n", + "f = f0 + 0.5 * (np.random.rand(*f0.shape) - 0.5)\n", + "x0 = f\n", + "plt.imshow(f, interpolation='nearest', cmap=plt.cm.get_cmap('gray'), vmin=0, vmax=1)\n", + "plt.axis('off')\n" + ], + "outputs": [], + "execution_count": null + } + ], + "metadata": { + "anaconda-cloud": {}, + "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.6.1" + } + }, + "nbformat": 4, + "nbformat_minor": 1 +} \ No newline at end of file