[Tex/LaTex] How to remove spacing between figure and caption in the beamer class

beamercaptionsfloats

i'm creating a presentation with the latex beamer class and want to change the spacing between the figure and the caption. I think it is to large at the moment.

\documentclass[xcolor=dvipsnames]{beamer}
\usetheme{Luebeck}
\setbeamercolor{structure}{fg=PineGreen}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{textcomp}
\usepackage{graphicx}

\newcommand*\oldmacro{}%
\let\oldmacro\insertshorttitle%
\renewcommand*\insertshorttitle{%
  \oldmacro\hfill%
  \insertframenumber\,/\,\inserttotalframenumber}

\setbeamertemplate{itemize items}[triangle]
\setbeamerfont{caption}{size=\tiny}


\begin{document}

\begin{frame}{Tresholding - OpenCV-Methoden}

\centering
\begin{minipage}{.5\textwidth}
    \centering
    \begin{figure}
        \includegraphics[width=.8\linewidth]{images/treshold_otsu.png}
        \caption{Otsu Tresholding}
    \end{figure}
\end{minipage}%
\begin{minipage}{.5\textwidth}
    \centering
    \begin{figure}
        \includegraphics[width=.8\linewidth]{images/treshold_adaptive.png}
        \caption{Adaptive Tresholding}
    \end{figure}
\end{minipage}

\end{frame}

\end{document}

How could that be achieved?
Here is an image of the slide:

Image of a slide with the spacing marked

Best Answer

The proper way to do this is to redefine \abovecaptionskip so the change in vertical spacing will consistently apply to all the captions; in the example below I used

\setlength\abovecaptionskip{-5pt}

but you can change the value in the argument according to your needs.

\PassOptionsToPackage{demo}{graphicx}
\documentclass[xcolor=dvipsnames]{beamer}
\usetheme{Luebeck}
\setbeamercolor{structure}{fg=PineGreen}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{textcomp}

\newcommand*\oldmacro{}%
\let\oldmacro\insertshorttitle%
\renewcommand*\insertshorttitle{%
  \oldmacro\hfill%
  \insertframenumber\,/\,\inserttotalframenumber}

\setbeamertemplate{itemize items}[triangle]
\setbeamerfont{caption}{size=\tiny}

\setlength\abovecaptionskip{-5pt}

\begin{document}

\begin{frame}{Tresholding - OpenCV-Methoden}

\centering
\begin{minipage}{.5\textwidth}
    \centering
    \begin{figure}
        \includegraphics[width=.8\linewidth]{images/treshold_otsu.png}
        \caption{Otsu Tresholding}
    \end{figure}
\end{minipage}%
\begin{minipage}{.5\textwidth}
    \centering
    \begin{figure}
        \includegraphics[width=.8\linewidth]{images/treshold_adaptive.png}
        \caption{Adaptive Tresholding}
    \end{figure}
\end{minipage}

\end{frame}

\end{document}

The result:

enter image description here

The line \PassOptionsToPackage{demo}{graphicx} simply replaces actual figures with black rectangles; delete that line in your actual document.