diff options
author | Prabhu Ramachandran | 2018-05-15 22:05:02 +0530 |
---|---|---|
committer | Prabhu Ramachandran | 2018-05-15 22:05:02 +0530 |
commit | 67a937d9e41983c4cc39eddf4e2183125a8554c9 (patch) | |
tree | 0b98b7a3d928d2dd89c1f28d023e4da19be8a8f1 /scipy | |
parent | 9132e564c5f28f1b10d66d8323ad765f9d914231 (diff) | |
download | python-workshops-67a937d9e41983c4cc39eddf4e2183125a8554c9.tar.gz python-workshops-67a937d9e41983c4cc39eddf4e2183125a8554c9.tar.bz2 python-workshops-67a937d9e41983c4cc39eddf4e2183125a8554c9.zip |
Remove references to lena and use image of penguins.
Diffstat (limited to 'scipy')
-rw-r--r-- | scipy/basic/03_ipython_plotting.tex | 2 | ||||
-rw-r--r-- | scipy/basic/07_more_numpy.tex | 18 | ||||
-rw-r--r-- | scipy/basic/09_exercises.tex | 6 | ||||
-rw-r--r-- | scipy/basic/circulate/credits.txt | 5 | ||||
-rw-r--r-- | scipy/basic/circulate/lena.png | bin | 428981 -> 0 bytes | |||
-rw-r--r-- | scipy/basic/circulate/penguins.png | bin | 0 -> 175335 bytes | |||
-rw-r--r-- | scipy/basic/circulate/sample.ipynb | 46 | ||||
-rw-r--r-- | scipy/basic/quickref.tex | 2 |
8 files changed, 34 insertions, 45 deletions
diff --git a/scipy/basic/03_ipython_plotting.tex b/scipy/basic/03_ipython_plotting.tex index d0c5bf3..465d4f0 100644 --- a/scipy/basic/03_ipython_plotting.tex +++ b/scipy/basic/03_ipython_plotting.tex @@ -147,7 +147,7 @@ Python} \end{itemize} \item Images \begin{itemize} - \item \typ{lena.png} + \item \typ{penguins.png} \end{itemize} \end{enumerate} \end{frame} diff --git a/scipy/basic/07_more_numpy.tex b/scipy/basic/07_more_numpy.tex index c53cc41..3d4310d 100644 --- a/scipy/basic/07_more_numpy.tex +++ b/scipy/basic/07_more_numpy.tex @@ -302,13 +302,13 @@ Out[]: (3, 3) \frametitle{Elementary image processing} \begin{small} \begin{lstlisting} -In []: a = imread('lena.png') +In []: a = imread('penguins.png') In []: imshow(a) -Out[]: <matplotlib.image.AxesImage object at 0xa0384cc> +Out[]: <matplotlib.image.AxesImage object at ...> \end{lstlisting} \end{small} -\typ{imread} returns an array of shape (512, 512, 4) which represents an image of 512x512 pixels and 4 shades.\\ +\typ{imread} returns an array of shape (370, 370, 4) which represents an image of 370x370 pixels and 4 shades.\\ \typ{imshow} renders the array as an image. \end{frame} @@ -316,7 +316,7 @@ Out[]: <matplotlib.image.AxesImage object at 0xa0384cc> \frametitle{Slicing \& Striding Exercises} \begin{itemize} \item Crop the image to get the top-left quarter - \item Crop the image to get only the face + \item Crop the image to get only the face of the baby penguin \item Resize image to half by dropping alternate pixels \end{itemize} @@ -325,14 +325,14 @@ Out[]: <matplotlib.image.AxesImage object at 0xa0384cc> \frametitle{Solutions} \begin{small} \begin{lstlisting} -In []: imshow(a[:256,:256]) -Out[]: <matplotlib.image.AxesImage object at 0xb6f658c> +In []: imshow(a[:185,:185]) +Out[]: <matplotlib.image.AxesImage object at ...> -In []: imshow(a[200:400,200:400]) -Out[]: <matplotlib.image.AxesImage object at 0xb757c2c> +In []: imshow(a[225:300,150:250]) +Out[]: <matplotlib.image.AxesImage object at ...> In []: imshow(a[::2,::2]) -Out[]: <matplotlib.image.AxesImage object at 0xb765c8c> +Out[]: <matplotlib.image.AxesImage object at ...> \end{lstlisting} \end{small} \inctime{15} diff --git a/scipy/basic/09_exercises.tex b/scipy/basic/09_exercises.tex index 78ba335..f9fdaf3 100644 --- a/scipy/basic/09_exercises.tex +++ b/scipy/basic/09_exercises.tex @@ -416,15 +416,15 @@ In []: x.dtype.<TAB> # Explore! \begin{frame}[fragile] \frametitle{Problem 6} - Edge detection looks much nicer with \typ{lena.png}, try it! The + Edge detection looks much nicer with \typ{penguins.png}, try it! The caveat is that it is a 4 component RGBA image with elements in the range $[0.0, 1.0]$. \begin{lstlisting} -In []: x = imread('lena.png') +In []: x = imread(penguins.png') In []: print(x.shape) -(512, 512, 4) +(370, 370, 4) In []: print(x.min(), x.max()) (0.0, 1.0) diff --git a/scipy/basic/circulate/credits.txt b/scipy/basic/circulate/credits.txt new file mode 100644 index 0000000..797679b --- /dev/null +++ b/scipy/basic/circulate/credits.txt @@ -0,0 +1,5 @@ +penguins.png is from: + +https://commons.wikimedia.org/wiki/File:Aptenodytes_forsteri_-Snow_Hill_Island,_Antarctica_-adults_and_juvenile-8.jpg + +The file is cropped to 370x370. diff --git a/scipy/basic/circulate/lena.png b/scipy/basic/circulate/lena.png Binary files differdeleted file mode 100644 index 5f804d2..0000000 --- a/scipy/basic/circulate/lena.png +++ /dev/null diff --git a/scipy/basic/circulate/penguins.png b/scipy/basic/circulate/penguins.png Binary files differnew file mode 100644 index 0000000..d288f93 --- /dev/null +++ b/scipy/basic/circulate/penguins.png diff --git a/scipy/basic/circulate/sample.ipynb b/scipy/basic/circulate/sample.ipynb index d5072ae..1e542e9 100644 --- a/scipy/basic/circulate/sample.ipynb +++ b/scipy/basic/circulate/sample.ipynb @@ -68,9 +68,7 @@ { "cell_type": "code", "execution_count": 1, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -87,9 +85,7 @@ { "cell_type": "code", "execution_count": 2, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -124,7 +120,7 @@ "\n", "A simple image example:\n", "\n", - "\n", + "\n", "\n", "Some code:\n", "\n", @@ -159,9 +155,7 @@ { "cell_type": "code", "execution_count": 3, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -178,9 +172,7 @@ { "cell_type": "code", "execution_count": 4, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -218,9 +210,7 @@ { "cell_type": "code", "execution_count": 5, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -271,9 +261,7 @@ { "cell_type": "code", "execution_count": 7, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -339,9 +327,7 @@ { "cell_type": "code", "execution_count": 10, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -378,9 +364,7 @@ { "cell_type": "code", "execution_count": 11, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -423,21 +407,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.11" + "pygments_lexer": "ipython3", + "version": "3.6.0" }, "widgets": { "state": { @@ -460,5 +444,5 @@ } }, "nbformat": 4, - "nbformat_minor": 0 + "nbformat_minor": 1 } diff --git a/scipy/basic/quickref.tex b/scipy/basic/quickref.tex index ced31b9..dec9382 100644 --- a/scipy/basic/quickref.tex +++ b/scipy/basic/quickref.tex @@ -278,7 +278,7 @@ def f(y, t): \hr\textbf{Basic image processing} {\ex \typ{from pylab import imread, imshow, colorbar}}\\ -{\ex \typ{a = imread('lena.png')}}: a is a NumPy array\\ +{\ex \typ{a = imread('penguins.png')}}: a is a NumPy array\\ {\ex \typ{imshow(a)}}\\ {\ex \typ{colorbar()}}\\ |