\begin{Verbatim}[commandchars=\\\{\}] \PYG{k}{def} \PYG{n+nf}{calc\PYGZus{}average\PYGZus{}sharp}\PYG{p}{(}\PYG{n}{image}\PYG{p}{):} \PYG{n}{kernel} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{array}\PYG{p}{(} \PYG{p}{[} \PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{],} \PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{5}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{],} \PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{]} \PYG{p}{]} \PYG{p}{)} \PYG{k}{return} \PYG{n}{cv2}\PYG{o}{.}\PYG{n}{filter2D}\PYG{p}{(}\PYG{n}{image}\PYG{p}{,} \PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{,} \PYG{n}{kernel}\PYG{p}{)} \end{Verbatim}