Skip to content

Instantly share code, notes, and snippets.

@luctrudeau
Created July 8, 2015 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luctrudeau/81f7a2ba5262b093fe0d to your computer and use it in GitHub Desktop.
Save luctrudeau/81f7a2ba5262b093fe0d to your computer and use it in GitHub Desktop.
Motion Estimation illustrated with Tikz
\documentclass{standalone}
\usepackage{pgfplots}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage[caption=false]{subfig}
\usepackage[noabbrev]{cleveref}
\usepackage{schemabloc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{gensymb}
\usepackage{numprint}
\usepackage{mathtools}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}[scale=.72,every node/.style={minimum size=1cm},on grid]
\begin{scope}[
yshift=170,every node/.append style={
yslant=0.5,xslant=-1},yslant=0.5,xslant=-1
]
\fill[white,fill opacity=.9] (0,0) rectangle (5,5);
\draw[black,very thick] (0,0) rectangle (5,5);
\draw[step=5mm, black] (0,0) grid (5,5);
\fill[red] (2.5,2.5) rectangle (3,3);
\end{scope}
\begin{scope}[
yshift=0,every node/.append style={
yslant=0.5,xslant=-1},yslant=0.5,xslant=-1
]
\fill[white,fill opacity=0.6] (0,0) rectangle (5,5);
\draw[step=5mm, black] (1.5,1.5) grid (4,4);
\draw[black,very thick] (1.5,1.5) rectangle (4,4);
\draw[black,dashed] (0,0) rectangle (5,5);
\fill[green] (2,2) rectangle (2.5,2.5);
\draw[->](2.75,2.75) -- (2.25, 2.25);
\end{scope}
\draw[-latex,thick,dotted](6.2,8.4)node[right]{Current Frame}
to[out=180,in=90] (4,8);
\draw[-latex,thick,dotted](5,10)node[right]{Current Block (B)}
to[out=180,in=90] (0,8.9);
\draw[-latex,thick,dotted] (3,5) node[right]{Motion vector}
to[out=180,in=90] (0,2.75);
\draw[-latex,thick,dotted] (4,4) node[right]{Search Area}
to[out=180,in=90] (1.5,3.25);
\draw[-latex,thick,dotted] (4,1.5) node[right]{Candidate Block (C)}
to[out=180,in=90] (0.4,2.2);
\draw[-latex,thick,dotted] (3,1) node[right]{Anchor Frame}
to[out=180,in=90] (2,1);
\end{tikzpicture}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment