Skip to content

Commit 3f474c3

Browse files
committed
added application on image processing
1 parent 6cc74f2 commit 3f474c3

File tree

2 files changed

+112
-0
lines changed

2 files changed

+112
-0
lines changed

numpy-tutorial-exercises.ipynb

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2119,6 +2119,80 @@
21192119
"## Application: polynomial fit"
21202120
]
21212121
},
2122+
{
2123+
"cell_type": "code",
2124+
"execution_count": null,
2125+
"metadata": {
2126+
"collapsed": true
2127+
},
2128+
"outputs": [],
2129+
"source": []
2130+
},
2131+
{
2132+
"cell_type": "markdown",
2133+
"metadata": {},
2134+
"source": [
2135+
"## Application: image manipulation"
2136+
]
2137+
},
2138+
{
2139+
"cell_type": "code",
2140+
"execution_count": null,
2141+
"metadata": {
2142+
"collapsed": false
2143+
},
2144+
"outputs": [],
2145+
"source": [
2146+
"from scipy import misc\n",
2147+
"face = misc.face(gray=True)\n",
2148+
"face"
2149+
]
2150+
},
2151+
{
2152+
"cell_type": "code",
2153+
"execution_count": null,
2154+
"metadata": {
2155+
"collapsed": false
2156+
},
2157+
"outputs": [],
2158+
"source": [
2159+
"plt.imshow(face, cmap=plt.cm.gray)"
2160+
]
2161+
},
2162+
{
2163+
"cell_type": "markdown",
2164+
"metadata": {},
2165+
"source": [
2166+
"Modify this image, e.g. convert it to a black and white image, put a black frame, change the contrast, ..."
2167+
]
2168+
},
2169+
{
2170+
"cell_type": "code",
2171+
"execution_count": null,
2172+
"metadata": {
2173+
"collapsed": false
2174+
},
2175+
"outputs": [],
2176+
"source": []
2177+
},
2178+
{
2179+
"cell_type": "code",
2180+
"execution_count": null,
2181+
"metadata": {
2182+
"collapsed": false
2183+
},
2184+
"outputs": [],
2185+
"source": []
2186+
},
2187+
{
2188+
"cell_type": "code",
2189+
"execution_count": null,
2190+
"metadata": {
2191+
"collapsed": false
2192+
},
2193+
"outputs": [],
2194+
"source": []
2195+
},
21222196
{
21232197
"cell_type": "code",
21242198
"execution_count": null,

presentation.tex

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,4 +879,42 @@
879879
\small{see \texttt{scipy.optimize.curve\_fit} for general fit functions}
880880
\end{frame}
881881

882+
\begin{frame}[fragile]{Application: image manipulation}
883+
884+
\begin{lstlisting}
885+
from scipy import misc
886+
face = misc.face(gray=True)
887+
\end{lstlisting}
888+
889+
\vspace{-0.2truecm}
890+
\begin{columns}
891+
\begin{column}{0.33\textwidth}
892+
\begin{center}
893+
\includegraphics[width=0.9\textwidth]{face0}
894+
895+
\vspace{2.4truecm}
896+
\end{center}
897+
\end{column}%
898+
\begin{column}{0.33\textwidth}
899+
\begin{center}
900+
\includegraphics[width=0.9\textwidth]{face1}
901+
902+
\includegraphics[width=0.9\textwidth]{face3}
903+
\end{center}
904+
\end{column}%
905+
\begin{column}{0.33\textwidth}
906+
\begin{center}
907+
\includegraphics[width=0.9\textwidth]{face2}
908+
909+
\includegraphics[width=0.9\textwidth]{face4}
910+
\end{center}
911+
\end{column}%
912+
\end{columns}
913+
914+
\vspace{0.2truecm}
915+
\begin{center}
916+
\includegraphics[width=3truecm]{yourturn}
917+
\end{center}
918+
\end{frame}
919+
882920
\end{document}

0 commit comments

Comments
 (0)