How to remove spacing between figure and caption in the beamer class

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.


You can do it manually by using \vspace*{-0.3cm} (or whatever distance you like) in front of the caption.

\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]{example-grid-100x100bp.pdf}
        \vspace*{-0.3cm}
        \caption{Otsu Tresholding}
    \end{figure}
\end{minipage}%
\begin{minipage}{.5\textwidth}
    \centering
    \begin{figure}
        \includegraphics[width=.8\linewidth]{example-grid-100x100bp.pdf}
        \vspace*{-0.3cm}
        \caption{Adaptive Tresholding}
    \end{figure}
\end{minipage}

\end{frame}

\end{document}

enter image description here