commit 89a50b3ce62040342a57ef594936ded863231ac4 Author: ChUrl Date: Thu Nov 9 20:05:29 2023 +0100 add all diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0ad3ec7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +.direnv +.idea +*.aux +*.fdb_latexmk +*.fls +*.log +*.acn +*.acr +*.alg +*.bbl +*.bcf +*.blg +*.dvi +*.glg +*.glo +*.gls +*.ist +*.out +*.xml +*.pdf diff --git a/chap/appendix1.tex b/chap/appendix1.tex new file mode 100644 index 0000000..9f5942d --- /dev/null +++ b/chap/appendix1.tex @@ -0,0 +1,13 @@ +\chapter{Appendix 1} +\label{ch:appendix1} + +% Chapter Introduction + +\clearpage + +\section{Section 1} +\label{sec:appendixsection1} + +% Section Text + +\cleardoublepage \ No newline at end of file diff --git a/chap/chapter1.tex b/chap/chapter1.tex new file mode 100644 index 0000000..900967e --- /dev/null +++ b/chap/chapter1.tex @@ -0,0 +1,119 @@ +\chapter{Introduction} +\label{chap:introduction} + +Facial animation is an important discipline in computer animation, +as faces convey a significant part of human expression or emotion. +This makes good facial animation an essential requirement for character animation in film or video games. +At the same time, animation efficiency can't be disregarded completely for high-quality results, +so an approach combining both model quality and model usability is desired. +\textit{Inverse kinematics} provides such an approach, +as it enables direct manipulation of high-quality blend shape models or performance driven facial animation using motion capture. + +\section{Facial Animation Overview} +\label{sec:facialanimationmethods} + +The simplest approach to facial animation could possibly be freeform deformation mixed with keyframe animation, +which allows to recreate any emotion or expression at the cost of labor intensity and missing \textquote{guardrails}: +This technique imposes no modeling restrictions, so unnatural facial deformations can be produced easily (see \autoref{fig:unnaturaldeformation}). + +\begin{figure}[h] + \centering + \begin{subfigure}[b]{0.3\textwidth} + \includegraphics[scale=0.3]{img/unnatural_deformation.png} + \end{subfigure} + \caption{Unnatural Deformation.~\autocite{directmanipulationblendshapes}} + \label{fig:unnaturaldeformation} +\end{figure} + +To improve the model usability and prevent unnatural results, +the facial model can also be controlled through a set of parameters, +either chosen and implemented manually or automatically. + +The (probably) first parametric face model was produced by F.I.\ Parke in 1974~\autocite{parametricface}: +It contains manually chosen parameters like \code{JAW ROTATION} (see \autoref{fig:parametricjawrotation}) or \code{MOUTH WIDTH} and applies different deformation operations like translation, +rotation or scaling on certain facial regions to realize them. + +\begin{figure}[h] + \centering + \begin{subfigure}[b]{0.3\textwidth} + \includegraphics[scale=0.2]{img/parametric_model.png} + \end{subfigure} + \caption{Manually specified jaw rotation.~\autocite{parametricface}} + \label{fig:parametricjawrotation} +\end{figure} + +A different method to parameterize a face model is the \textquote{blend shape} approach: +Instead of using custom deformation operations on isolated parts of the mesh, +a blend shape model interpolates between different pre-modeled expressions that have identical vertex amounts and triangulation. +Multiple weighted expressions (\textquote{blend shape targets}) can be combined to generate the target expression. + +By generating the target expression through a weighted sum of complete face models, +unwanted scale deformations can be introduced by choosing \textquote{wrong} weights. +Thus, the blend shape method was refined to combine local deviations from a neutral face instead, +called \textquote{delta blend shapes}. + +Instead of manually associating each parameter with a certain expression, +model parameters can also be determined statistically, +e.g.\ by doing a principal component analysis of a range of facial expressions. +This generally results in non-interpretable model parameters, +which makes this model harder to animate, +as it is difficult to anticipate the resulting expression based on single parameter modifications. + +It is also possible to apply more general character animation techniques like skeletal animation to faces, +as is often done in video games. +This approach is efficient to animate, +but weaknesses like unnatural skin and muscle movement become more significant in the case of faces, +so skeletal face animation might not be suitable if quality requirements are high. + +Hybrid approaches, +like supplying a bone-driven model with a physical skin and muscle simulation, +can produce more realistic results, +but are also highly dependent on the character, +so the transfer of animations or \textquote{rigs} between characters might become difficult. +Also, physical simulation usually comes with a large performance impact, +which makes this technique unsuitable for real-time applications. + +Skeletal rigs can also be combined with blend shapes, +as certain facial components that have a clear rotational axis (like eyes or jaw) are conveniently animated using a skeleton. +Blend shapes can then be used to correct skin movement or add detail. + +\section{Kinematics} +\label{sec:kinematics} + +Kinematics is a subfield of physics, dealing with the motion of bodies in a system while ignoring masses or forces. +A kinematic system in computer animation, like a skeleton, is modeled using rigid \textquote{bones} and rotatable \textquote{joints}\footnote{ + This differs for the blend shape approach, + which is further described in \autoref{chap:blendshapemodels}. +}: + +\begin{figure}[h] + \centering + \begin{subfigure}[b]{0.3\textwidth} + \includegraphics[scale=0.1]{img/human_rig.png} + \end{subfigure} + \caption{Human skeleton rig.~\autocite{computeranimation}} + \label{fig:humanrig} +\end{figure} + +The bones are ordered in a hierarchical relationship: +Rotating a single \textquote{parent} bone around its joint also rotates all \textquote{children} bones accordingly along the same center of rotation. +Controlling such a kinematic model can happen in two ways: Forward and inverse kinematics. + +\textbf{Forward kinematics} calculates the absolute position of a joint (also called \textquote{end effector}) based on given joint orientations/angles of the parent joints. +In general, the forward kinematics problem can be expressed as \(x=f(\theta)\), +where \(x=(x_1,\dots,x_n)^T\) are the effector positions and \(\theta=(\theta_1,\dots,\theta_n)^T\) are the joint angles. + +\textbf{Inverse kinematics} describes the opposite problem \(\theta=f^{-1}(x)\): +The absolute effector positions are given and the angles that produce these positions are to be determined. +Solving this problem for real-world models is difficult for multiple reasons: + +\begin{itemize} + \item High-quality kinematic models (e.g.\ for character animation) can have hundreds of degrees of freedom + \item Multiple solutions or no solutions at all are possible + (for a given \(x_2\) in \autoref{fig:2dforwardkinematics} there are two solutions for \(\theta\) already, + as \(\theta_1\) and \(\theta_2\) can be exchanged) + \item Different solutions can be ordered by criteria that are difficult to define analytically, + for example by \textquote{intuitiveness} or if a solution is appropriate in the context of an animation +\end{itemize} + +In consequence, approximative solvers are typically preferred over analytical ones. diff --git a/chap/chapter2.tex b/chap/chapter2.tex new file mode 100644 index 0000000..b96a2b2 --- /dev/null +++ b/chap/chapter2.tex @@ -0,0 +1,159 @@ +\chapter{Skeletal Models} +\label{chap:skeletalmodels} + +Pure skeletal kinematic models are typically used for body animation, +but they are also applicable to faces, +especially when quality requirements are not as important. +Quality issues when using skeletal models for facial animation are mostly rooted in the difficulty to obtain realistic skin movement when deforming a face by moving bones (e.g. through linear blend skinning or dual quaternion skinning). +Another problem is the model fidelity: +To be able to express sufficient details through animation, +a highly-detailed skeleton is required. +When a weakness is discovered during the animation process (for example when a certain expression can not be realized fully), +a skeletal model might be hard to adapt/improve without invalidating existing animations. +Despite these problems, skeletal animation may remain valid for faces, +for example when it is deployed in combination with other methods, +like blend shapes (discussed in \autoref{chap:blendshapemodels}). + +\section{Skeletal Forward Kinematics} +\label{sec:skeletalforwardkinematics} + +Skeletal forward kinematics is the problem +\[x=f(\theta),\] +where \(x\) are effector positions and \(\theta\) joint angles, +as described in \autoref{sec:kinematics}. + +Take the following two-dimensional example (see \autoref{fig:2dforwardkinematics}) with two bones (green) and two \textquote{hinge}-joints (joints with a single degree of freedom, or a single rotational axis). + +\begin{figure}[h] + \centering + \begin{subfigure}[b]{0.8\textwidth} + \begin{tikzpicture}[scale=3] + \clip (-1.5, -0.2) rectangle (2, 1.5); + + % Coordinates + \coordinate (C) at (0, 0); + \coordinate (X) at ({cos(30)}, {sin(30)}); + \coordinate (Y) at ({cos(30)}, 0); + \coordinate (XX) at ({cos(30)+cos(60)}, {sin(30)+sin(60)}); + \coordinate (YY) at ($(X)+(30:{cos(30)})$); % Uses tikzlibrary "calc" for maths in ($...$) + + % Global axes + \draw[>-stealth] (C) -- +(2, 0); + \draw[>-stealth] (C) -- +(0, 1.5); + + % Circles + % \draw[dashed] (0, 0) circle [radius=1]; + % \draw[dashed] (X) circle [radius=1]; + + % Angle + \draw (0.5, 0) arc[start angle=0, end angle=30, radius=0.5] node[left=0.1cm, below=0.15cm]{\footnotesize\(\theta_1\)}; + \draw ($(X)+(30:0.5)$) arc[start angle=30, end angle=60, radius=0.5] node[left, below=0.25cm]{\footnotesize\(\theta_2\)}; + + % Bones + \draw[green, very thick] (C) node[left, text=black]{\(x_1\)} -- node[above, text=black]{\(r_1\)} (X) node[below right, text=black]{\(x_2\)}; + \draw[green, very thick] (X) -- node[above, left, text=black]{\(r_2\)} (XX) node[above, text=black]{\(x_3\)}; + + % Sine/Cosine sums + \draw[blue, thick] ({cos(30)}, 0) -- node[below]{\footnotesize\(r_2\cos\theta_1+\theta_2\)} +({cos(60)}, 0); + \draw[dashed] ({cos(30)+cos(60)}, 0) -- (XX); + \draw[red, thick] (0, {sin(30)}) -- node[right]{\footnotesize\(r_2\sin\theta_1+\theta_2\)} +(0, {sin(60)}); + \draw[dashed] (0, {sin(30)}) -- (X); + \draw[dashed] (0, {sin(30)+sin(60)}) -- (XX); + + % Sine/Cosine lines + \draw[blue, thick] (C) -- node[below]{\footnotesize\(r_1\cos\theta_1\)} (Y); + \draw[red, thick] (X) -- node[right]{\footnotesize\(r_1\sin\theta_1\)} (Y); + \draw[blue, thick] (X) -- node[below, sloped]{\footnotesize\(r_2\cos\theta_2\)} (YY); + \draw[red, thick] (XX) -- node[above, sloped]{\footnotesize\(r_2\sin\theta_2\)} (YY); + + % Local axes + \draw[->, very thick] (C) -- +(30:0.3); % Polar coordinates + \draw[->, very thick] (C) -- +(120:0.3); + \draw[->, very thick] (X) -- +(60:0.3); + \draw[->, very thick] (X) -- +(150:0.3); + \end{tikzpicture} + \end{subfigure} + \caption{Simple 2D kinematic model.} + \label{fig:2dforwardkinematics} +\end{figure} + +To calculate the absolute position of \(x_3\) in the global coordinate system (the large one), +we can first look at the transformation at each joint individually and then trace the \textquote{bone-path} from the system's root to the end effector. +Describing \(x_3\) relative to the second joint's local coordinate system (the small one with its origin in \(x_2\)) is simple, +as its just a translation without rotation (\(x_{2\rightarrow 3}\) denotes the position of effector \(x_3\) relative to the coordinate system with origin in \(x_2\)): +\[x_{2\rightarrow 3}=\begin{pmatrix*} + r_2\\ + 0 +\end{pmatrix*}.\] +To describe \(x_2\) relative to the first joint's local coordinate system (the small one with its origin in \(x_1\)), +we additionally have to consider to coordinate rotation caused by the second joint and the translation caused by the first bone (the one with length \(r_1\)). +The rotation is described using a two-dimensional rotation matrix \(R_2\) (\(2\times 2\) orthogonal matrix): +\[R_2=\begin{pmatrix*} + &\cos\theta_2 &-\sin\theta_2\\ + &\sin\theta_2 &\cos\theta_2 +\end{pmatrix*}.\] +The local translation caused by the first bone is +\[x_{1\rightarrow 2}=\begin{pmatrix*} + r_1\\ + 0 +\end{pmatrix*},\] +it follows the affine transformation +\[x_{1\rightarrow 3}=x_{1\rightarrow 2}+R_2 x_{2\rightarrow 3}.\] +To obtain the global coordinates (denoted by just \(x_3\)), the rotation \(R_1\) caused by the first joint needs to be included (assuming the system has origin \((0, 0)\)): +\[x_3=R_1 x_{1\rightarrow 3}=R_1(x_{1\rightarrow 2}+R_2 x_{2\rightarrow 3}),\] +where +\[R_1=\begin{pmatrix*} + &\cos\theta_1 &-\sin\theta_1\\ + &\sin\theta_1 &\cos\theta_1 +\end{pmatrix*}.\] +Using addition theorems for sine and cosine, this leaves us with +\[x_3=\begin{pmatrix*} + r_1\cos\theta_1+r_2(\cos\theta_1\cos\theta_2-\sin\theta_1\sin\theta_2)\\ + r_1\sin\theta_1+r_2(\sin\theta_1\cos\theta_2+\cos\theta_1\sin\theta_2) +\end{pmatrix*}=\begin{pmatrix*} + r_1\cos\theta_1+r_2\cos(\theta_1+\theta_2)\\ + r_1\sin\theta_1+r_2\sin(\theta_1+\theta_2) +\end{pmatrix*},\] +which is also the intuitive solution when looking at \autoref{fig:2dforwardkinematics}. + +\section{Skeletal Inverse Kinematics} +\label{sec:skeletalinversekinematics} + +Skeletal inverse kinematics is the problem +\[\theta=f^{-1}(x).\] +As mentioned earlier, analytical solvers are rarely applied to this problem, +approximative solvers are usually used instead. +A starting approach is using the first order Taylor approximation of the effector's target positions \(t\): +\[t=f(\theta+\delta\theta)\approx f(\theta)+J(\theta)\delta\theta,\] +where \(J(\theta)\) is the Jacobian\footnote{ + \textquote{Jacobian entry \(J_{i, j}\) contains derivative of effector position \(x_i\) with respect to rotation angle \(\theta_j\) of joint \(j\)}. +}. +Solving for the angle-update \(\delta\theta\) yields the linear system +\[t-f(\theta)\approx J(\theta)\delta\theta,\] +which is (probably) difficult to solve because the system is usually underconstrained, \(J(\theta)\) might not be invertible or maybe there is no solution at all (for example if the target positions are out of reach of the effectors). + +The approximative target to minimize to obtain a \(\delta\theta\) that best satisfies \(t-f(\theta)\approx J(\theta)\delta\theta\) when the inverse kinematics problem doesn't have a solution is the \textbf{least squares} solution +\[\delta\theta=\arg\min\limits_{\delta\theta}||J(\theta)\delta\theta-(t-f(\theta))||^2.\] +The target to minimize to obtain a \(\delta\theta\) that satisfies \(t-f(\theta)=J(\theta)\delta\theta\) when the inverse kinematics problem has a single or multiple solutions is the \textbf{least norm} solution +\[\delta\theta=\arg\min\limits_{\delta\theta}||\delta\theta||,\] +such that \(t-f(\theta)=J(\theta)\delta\theta\). + +\subsection{Moore-Penrose Inverse} +\label{subsec:moorepenroseinverse} + +A generally possible \textquote{best-effort} solution to linear systems with no/infinitely many solutions is given by the \textbf{Moore-Penrose Inverse}: +When solving a linear system \(Ax=b\) using \(x=A^{-1}b\) is not possible (e.g. because \(A\) is not invertible), +calculate \(x\approx A^+b\) instead, where \(A^+\) is the Moore-Penrose inverse (or \textquote{pseudo-inverse}). +If the system is overconstrained, this approach minimizes \(||Ax-b||^2\) (least squares), +if the system is underconstrained, it minimizes \(||x||\) (least norm) such that \(Ax=b\), +and if \(A\) is actually invertible, \(A^+=A^{-1}\). + +The pseudo-inverse can be calculated using a singular-value-decomposition: +Inverting a regular invertible matrix \(A=U\Sigma V^T\), \(A\in\mathbb{R}^{n\times n}\) yields +\[A^{-1}=(U\Sigma V^T)^{-1}=(V^T)^{-1}\Sigma^{-1}U^{-1}=V\Sigma^{-1}U^T\] +with \(\Sigma^{-1}=\text{diag}(\frac{1}{\lambda_1},\dots,\frac{1}{\lambda_n})\), +\textquote{pseudo-inverting} a non-invertible matrix \(A=U\Sigma V^T\), \(A\in\mathbb{R}^{n\times n}\) with \(\text{rank}(A)=m] (-1.5, 0) -- (1.5, 0); % x + \draw[->] (0, 0) -- (0, 1.3); % y + + % Cameras + \node[isosceles triangle, isosceles triangle apex angle=30, draw, fill=blue, minimum size=0.5, rotate=225] (TA) at (CA){}; + \node[isosceles triangle, isosceles triangle apex angle=30, draw, fill=blue, minimum size=0.5, rotate=315] (TB) at (CB){}; + + % Camera beams + \draw[->, blue] (CA) -- (M) -- +(0.2, 0.2); + \draw[->, blue] (CB) -- (M) -- +(-0.2, 0.2); + + % Marker + \draw[fill=red] (M) circle (0.025); + + % Face + \draw[green] (M) +(0, 0.05) circle (0.2); + \draw[green] (M) +(0.075, 0.1) circle (0.04); + \draw[green] (M) +(-0.075, 0.1) circle (0.04); + \draw[green] (M) +(-0.075, -0.075) arc[start angle=225, end angle=315, radius=0.1]{}; + \end{tikzpicture} + \end{subfigure} + \caption{2D Stereo Tracking.} + \label{fig:2dstereotracking} +\end{figure} + +When basic information about the camera is known (e.g. focal length and sensor size), +the beam directions can be inferred from the marker's pixel position in the image plane. +This allows defining straight line equations for both beams, +equating those and solving the resulting linear system leads to the distance from the camera. +Because the camera positions are known, the marker's position is also known. + +By adding more cameras to the tracking setup and thus increasing the size of the linear system to be solved, +errors can be reduced and the tracking area increased (surround cameras also enable tracking rotations). +Proprietary tracking systems like OptiTrack~\autocite{optitrack} use techniques like infrared cameras with infrared emitters and reflective markers +to lessen the influence of regular daylight and simplify the marker detection. + +Finally, when the marker positions have been calculated, +the inverse kinematics problem for either blend shapes or a skeleton can be solved, +since each marker corresponds to a vertex of the facial model. + +\section{Tracking Solutions in Consumer VR Products} +\label{sec:consumertrackingsolutions} + +Because head-mounted-displays hinder the application of facial markers, +facial tracking data for a portion of a face is typically extracted from a single camera feed instead of multiple. +Cameras might be mounted inside the HMD, facing the eyes and nose, and below the HMD, facing the mouth and chin. +Since a delta blend shape model linearly combines locally isolated deformations, +processing different facial regions individually does not impose a problem. + +Unlike the stereo tracking, this approach does not use the inverse kinematics method described in \autoref{sec:blendshapeinversekinematics}. +Instead, each camera feed is fed through a specialized computer vision model, +which directly calculates the blend shape weights for a particular facial region and blend shape model. diff --git a/class/thesis.cls b/class/thesis.cls new file mode 100644 index 0000000..46c1f48 --- /dev/null +++ b/class/thesis.cls @@ -0,0 +1,769 @@ +% @file thesis.cls +% +% @brief Document class for theses. +% +% @author Stefan Nothaas, Arbeitsgruppe Betriebssysteme, Institut für Informatik, HHU Düsseldorf +% @author Filip Krakowski, Arbeitsgruppe Betriebssyteme, Institut für Informatik, HHU Düsseldorf +% +% @since 2021/04/29 (major refactoring, minted, university logo) +% @since 2019/04/29 (bugfix, wrong page number for reference section) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{class/thesis}[2021/04/29 Template for theses] + +% Use book class as base +\LoadClass[12pt,oneside,a4paper]{report} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Packages +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\RequirePackage{silence} % Silence some warnings +\WarningFilter{latexfont}{Font shape} +\WarningFilter{latexfont}{Some font shapres were not available} +\WarningFilter{latexfont}{Size substitutions with differences} +\WarningFilter{latex}{`h' float specifier} +\WarningFilter{latex}{\include should only be used after} +\WarningFilter{fancyhdr}{\headheight} + +\RequirePackage[left=3cm,right=2.5cm,top=3cm,bottom=2.5cm]{geometry} + +\RequirePackage[utf8]{inputenc} +\RequirePackage[T1]{fontenc} +\RequirePackage[english]{babel} % ngerman +\RequirePackage{fancyhdr} % For headers +\RequirePackage{color} +\RequirePackage[usenames,dvipsnames]{xcolor} +% \RequirePackage{amssymb} +\RequirePackage{amsmath} % tcolorbox should load this anyway, but results in errors? +\RequirePackage[minted]{tcolorbox} % Load after xcolor, [minted] +% \RequirePackage{minted} +% \RequirePackage{graphicx} +\RequirePackage{tikz} +\RequirePackage{subcaption} % Floats in floats +\RequirePackage{float} +% \RequirePackage{multirow} % For tables +% \RequirePackage{todonotes} +\RequirePackage[hidelinks]{hyperref} % [hidelinks] +\RequirePackage{algorithm2e} +\RequirePackage{tocloft} +% \RequirePackage{listings} +\RequirePackage{textcomp} +\RequirePackage{ifthen} +% \RequirePackage{pgffor} +\RequirePackage{enumitem} + +% Some additions +\RequirePackage[inkscapelatex=false]{svg} % Autoconvert to pdf, don't let latex touch the fonts +\RequirePackage{csquotes} % \textquote{} +\RequirePackage{tabularx} +\RequirePackage[acronym,automake,nonumberlist,nogroupskip]{glossaries} % Must be loaded after hyperref, [toc] +\RequirePackage[page]{appendix} % [toc] +% \RequirePackage{tocbibind} % Add lists to toc, still needs [heading=bibintoc] for some reason, [nottoc]? +\RequirePackage{beton} % Computer Concrete font +\RequirePackage{eulerpx} % Math font (have no math :() +\RequirePackage{inconsolata} % Code font +\RequirePackage[activate={true,nocompatibility},final,expansion=false,tracking=true,kerning=true,factor=1100,stretch=10,shrink=10]{microtype} % Sadly, expansion does not work with concrete, as they are not scalable +\RequirePackage{etoolbox} +\RequirePackage{siunitx} +\RequirePackage{setspace} +\RequirePackage{pdfpages} + +% Options +\floatstyle{boxed} % boxes around figures +\restylefloat{figure} +\DeclareFontSeriesDefault[rm]{bf}{sbc} % beton Computer Concrete does not have bold font +\pretocmd{\chapter}{\addtocontents{listings}{\protect\addvspace{10pt}}}{}{} % Group listings by chap +\setlength{\cftfignumwidth}{3em} % Modify number width in LoF +\setlength{\cfttabnumwidth}{3em} % Modify number width in LoT +\sisetup{detect-all} +% \renewcommand{\baselinestretch}{0.95} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Package settings +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\tcbuselibrary{skins, breakable} +\usetikzlibrary{shadings, backgrounds, calc, decorations.pathreplacing, calligraphy, shapes.geometric} % angles, quotes + +\fancypagestyle{plain}{% + \fancyhf{} + \renewcommand{\headrulewidth}{0pt} + \fancyfoot[RO,LE]{\thepage} +} + +\fancypagestyle{thesis}{% + \fancyhf{} + \renewcommand{\headrulewidth}{0.4pt} + \fancyfoot[RO,LE]{\thepage} + \fancyhead[LO,RE]{\slshape \leftmark} +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Bibliography +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\RequirePackage[style=ieee,backend=biber]{biblatex} +\addbibresource{references.bib} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Translations +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\newcommand{\translatemastersthesis}{} +\newcommand{\translatebachelorsthesis}{} +\newcommand{\translateprojectwork}{} +\newcommand{\translateprimaryreviewer}{} +\newcommand{\translatesecondaryreviewer}{} +\newcommand{\translatesupervisor}{} +\newcommand{\translatesubmittedby}{} +\newcommand{\translatefrom}{} +\newcommand{\translateuniversityname}{} +\newcommand{\translatedepartment}{} +\newcommand{\translatedeclaration}{} +\newcommand{\translatedeclarationtitle}{} + +\addto\captionsenglish{ + \SetAlgorithmName{Algorithm}{Algorithm}{List of Algorithms} + \renewcommand{\chaptername}{Chapter} + \renewcommand{\translatemastersthesis}{Master's Thesis} + \renewcommand{\translatebachelorsthesis}{Bachelor's Thesis} + \renewcommand{\translateprojectwork}{Project Work} + \renewcommand{\translateprimaryreviewer}{Primary Reviewer} + \renewcommand{\translatesecondaryreviewer}{Secondary Reviewer} + \renewcommand{\translatesupervisor}{Supervisor} + \renewcommand{\translatesubmittedby}{submitted by} + \renewcommand{\translatefrom}{from} + \renewcommand{\translateuniversityname}{Heinrich Heine University Düsseldorf} + \renewcommand{\translatedepartment}{Department Operating Systems} + \renewcommand{\translatedeclarationtitle}{Statutory Declaration} + \renewcommand{\translatedeclaration}{I hereby state that I have written this {\thesistypename} independently and that I have not used any sources or aids other than those declared. All passages taken from the literature have been marked as such. This thesis has not yet been submitted to any examination authority in the same or a similar form.} +} + +\addto\captionsngerman{ + \SetAlgorithmName{Algorithmus}{Algorithmus}{Algorithmenverzeichniss} + \renewcommand{\chaptername}{Kapitel} + \renewcommand{\translatemastersthesis}{Masterarbeit} + \renewcommand{\translatebachelorsthesis}{Bachelorarbeit} + \renewcommand{\translateprojectwork}{Projektarbeit} + \renewcommand{\translateprimaryreviewer}{Erstgutachter} + \renewcommand{\translatesecondaryreviewer}{Zweitgutachter} + \renewcommand{\translatesupervisor}{Betreuer} + \renewcommand{\translatesubmittedby}{vorgelegt von} + \renewcommand{\translatefrom}{aus} + \renewcommand{\translateuniversityname}{Heinrich-Heine-Universität Düsseldorf} + \renewcommand{\translatedepartment}{Abteilung Betriebssysteme} + \renewcommand{\translatedeclarationtitle}{Ehrenwörtliche Erklärung} + \renewcommand{\translatedeclaration}{Hiermit versichere ich, die vorliegende {\thesistypename} selbstständig verfasst und keine anderen als die angegebenen Quellen und Hilfsmittel benutzt zu haben. Alle Stellen, die aus den Quellen entnommen wurden, sind als solche kenntlich gemacht worden. Diese Arbeit hat in gleicher oder ähnlicher Form noch keiner Prüfungsbehörde vorgelegen.} +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Variables +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\newcommand{\thesistitle}[1]{\title{#1}} + +\newcommand{\thesisauthor}[1]{\author{#1}} + +\newcommand{\submissiondate}[1]{\date{#1}} + +\def\@thesislanguage{} +\newcommand{\thesislanguage}[1]{\def\@thesislanguage{#1}} + +\def\@thesiskeywords{} +\newcommand{\thesiskeywords}[1]{\def\@thesiskeywords{#1}} + +\def\@authorbirthplace{} +\newcommand{\authorbirthplace}[1]{\def\@authorbirthplace{#1}} + +\def\@authorbirthname{} +\newcommand{\authorbirthname}[1]{\def\@authorbirthname{#1}} + +\def\@firstreviewer{} +\newcommand{\firstreviewer}[1]{\def\@firstreviewer{#1}} + +\def\@secondreviewer{} +\newcommand{\secondreviewer}[1]{\def\@secondreviewer{#1}} + +\def\@supervisor{} +\newcommand{\supervisor}[1]{\def\@supervisor{#1}} + +\def\@thesistype{} +\newcommand{\thesistype}[1]{\def\@thesistype{#1}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Feature Toggles +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\def\@listoffiguresenabled{} +\newcommand{\listoffiguresenabled}[1]{\def\@listoffiguresenabled{#1}} + +\def\@listoftablesenabled{} +\newcommand{\listoftablesenabled}[1]{\def\@listoftablesenabled{#1}} + +\def\@listofalgorithmsenabled{} +\newcommand{\listofalgorithmsenabled}[1]{\def\@listofalgorithmsenabled{#1}} + +\def\@tocenabled{} +\newcommand{\tocenabled}[1]{\def\@tocenabled{#1}} + +\def\@glossaryenabled{} +\newcommand{\glossaryenabled}[1]{\def\@glossaryenabled{#1}} + +\def\@titleenabled{} +\newcommand{\titleenabled}[1]{\def\@titleenabled{#1}} + +\def\@listoflistingsenabled{} +\newcommand{\listoflistingsenabled}[1]{\def\@listoflistingsenabled{#1}} + +\def\@bibliographyenabled{} +\newcommand{\bibliographyenabled}[1]{\def\@bibliographyenabled{#1}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Colors +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Primary +\definecolor{hhuCorporateBlue}{HTML}{006AB3} +\definecolor{hhuCorporateGrey}{HTML}{D9DADB} + +% Secondary +\definecolor{hhuCorporateGreen}{HTML}{97BF0D} +\definecolor{hhuCorporateOrange}{HTML}{F29400} +\definecolor{hhuCorporateRed}{HTML}{BE0A26} +\definecolor{hhuCorporateDarkBlue}{HTML}{003865} +\definecolor{hhuCorporateLightBlue}{HTML}{32B8C9} + +% Code +\colorlet{titlebg}{hhuCorporateGrey!80!white} +\colorlet{titlecolor}{black} +\colorlet{termbg}{hhuCorporateGrey!10!white} +\colorlet{termfg}{hhuCorporateGrey!20!white} +\colorlet{codebg}{white} +\colorlet{numberbg}{hhuCorporateGrey!25!white} +\colorlet{languagebg}{hhuCorporateGrey!20!white} +\definecolor{mintedtext}{HTML}{F8F8F2} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Document settings +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\setlength{\marginparwidth}{2.1cm} + +\AtBeginDocument{ + + \hypersetup{ + pdfauthor={\@author}, + pdftitle={\@title}, + pdfkeywords={\@thesiskeywords}, + pdfproducer={LaTeX with hyperref}, + pdfcreator={PDFLaTeX} + } + + \selectlanguage{\@thesislanguage} +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Thesis environment +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\newenvironment{thesis} +{ + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Global options + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + \setlength{\parindent}{0pt} + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Disable fancy headers + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + \pagestyle{empty} + \pagenumbering{gobble} + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Title page + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + \ifthenelse{\equal{\@titleenabled}{true}} + {% + \thesiscover + }% + {} + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Table of contents + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + \ifthenelse{\equal{\@tocenabled}{true}} + {% + \microtypesetup{protrusion=false} + \begin{spacing}{0.94} % Hamburger the TOC into two pages really unprofessionally + \tableofcontents + \end{spacing} + \cleardoublepage + \microtypesetup{protrusion=true} + }% + {} + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Re-enable fancy headers + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + \pagestyle{thesis} + + \ifthenelse{\equal{\@glossaryenabled}{true}} + {% + % \pagenumbering{arabic} % Only number chapters + + % Print Glossary + \setacronymstyle{short-long} + \printglossary[type=\acronymtype] + \cleardoublepage + \printglossary + + \cleardoublepage + }% + {} + + \pagenumbering{arabic} +} +% Document Content +{ + \pagenumbering{gobble} + + \ifthenelse{\equal{\@bibliographyenabled}{true}} + {% + \printbibliography % [heading=bibintoc] + %\cleardoublepage + \clearpage + }% + {} + + \ifthenelse{\equal{\@listoflistingsenabled}{true}} + {% + \tcblistof[\chapter*]{listings}{List of Listings} + % \addcontentsline{toc}{chapter}{List of Listings} + \cleardoublepage + % \clearpage + }% + {} + + % The lof/lot linespacing should match the lol linespacing + \setlength{\cftparskip}{2pt} + + \ifthenelse{\equal{\@listoftablesenabled}{true}} + {% + \listoftables + \cleardoublepage + % \clearpage + }% + {} + + \ifthenelse{\equal{\@listoffiguresenabled}{true}} + {% + \listoffigures + \cleardoublepage + % \clearpage + }% + {} + + \ifthenelse{\equal{\@listofalgorithmsenabled}{true}} + {% + \listofalgorithms + \cleardoublepage + % \clearpage + }% + {} + + % \declaration + % \includepdf[pages=-]{decl.pdf} +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Title page +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\newcommand{\thesiscover} +{ + \begin{titlepage} + + \newgeometry{left=2.5cm,right=2.5cm,top=3cm} + + \begin{center} + + \includesvg[width=5cm]{img/hhu_color.svg} + + \vspace{0.75cm} + + {\Large \thesistypename} + + \vspace{0.75cm} + + % Thesis title + \rule{\textwidth}{0.25mm}\\ + \vspace{-5pt} + \rule{\textwidth}{0.8mm}\\ + + {\Huge \textsc{\@title\\}} + + \rule{\textwidth}{0.8mm}\\ + \vspace{-5pt} + \rule{\textwidth}{0.25mm} + + \vspace{7.5em} + + {\translatesubmittedby} \\[.5em] + {\huge \@author} \\[.5em] + {{\translatefrom} \@authorbirthplace}\\ + + \vfill + + + % Department + + + {\translatedepartment}\\ + Prof. Dr. Michael Schöttner\\ + {\translateuniversityname}\\ + + \vspace{1cm} + + + % Date + \vspace{0.5cm} + \@date + \vspace{0.5cm} + + + % People + \begin{tabular}{r l} + {\translateprimaryreviewer}: & \@firstreviewer \\ + \ifthenelse{\equal{\@thesistype}{project}}{}{{\translatesecondaryreviewer}: & \@secondreviewer \\} + {\translatesupervisor}: & \@supervisor \\ + \end{tabular} + + + \end{center} + + \end{titlepage} + \clearpage{\pagestyle{empty}\cleardoublepage} +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Literature +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\newcommand{\literature} +{ + % \bibliography{\literaturebibtexdatei} + % \bibliographystyle{plain} + + % \addcontentsline{toc}{chapter}{Literaturverzeichnis} + % \cleardoublepage + \bibliography{\literaturebibtexdatei} + \bibliographystyle{plain} + + \clearpage{\pagestyle{empty}\cleardoublepage} +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Statutory Declaration +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\newcommand{\declaration} +{ + \cleardoublepage + \pagestyle{empty} + \huge + \noindent\textbf{\translatedeclarationtitle} + + \large + \vspace{3cm} + {\noindent\translatedeclaration} + + \vspace{4cm} + \begin{center} + \begin{tabular}{lc} + Düsseldorf, \@date \hspace{1.5cm} & \hspace{7cm} \\[-10pt] + & \hrulefill \\ + & \@author +\\ + \end{tabular} + \end{center} + + \clearpage{\pagestyle{empty}\cleardoublepage} +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Miscellaneous +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\newcommand{\thesistypename}{% + \ifthenelse{\equal{\@thesistype}{bachelor}} + {\translatebachelorsthesis} + {% + \ifthenelse{\equal{\@thesistype}{master}} + {\translatemastersthesis} + {\translateprojectwork} + }% +} + +\newtcolorbox[auto counter,list inside=listings,number within=chapter]{codeblock}[3][] +{% + enhanced, + colbacktitle=titlebg, + coltitle=titlecolor, + colframe=titlebg, + interior style={% + top color=codebg, + bottom color=codebg + }, + boxrule=.5pt, + arc=0.6mm, + width= (\linewidth), + fonttitle=\footnotesize, + adjusted title=\thetcbcounter\quad\texttt{#2}, + list entry=\thetcbcounter\quad\texttt{#2}, + list text={\hspace*{1ex}#2}, % Chapter - Caption spacing in list of listings + after title={% + \hfill\setlength{\fboxsep}{2pt} + \codelang{#3} + }, + overlay={% + \begin{tcbclipinterior}\fill[numberbg] (frame.south west) + rectangle ([xshift=5mm]frame.north west); + \end{tcbclipinterior} + }, + top=0mm, + bottom=0mm, + right=0mm, + left=5mm, + #1 +} + +\newtcolorbox{terminalblock} +{% + enhanced, + colbacktitle=titlebg, + coltitle=titlecolor, + colframe=titlebg, + interior style={% + top color=codebg, + bottom color=codebg + }, + boxrule=.5pt, + arc=0.6mm, + width= (\linewidth), + fonttitle=\footnotesize, + adjusted title={% + \tikz\draw[hhuCorporateGrey!50!black,fill=hhuCorporateGrey!50!black] (0,0) circle (.5ex); + \tikz\draw[hhuCorporateGrey!60!black,fill=hhuCorporateGrey!60!black] (0,0) circle (.5ex); + \tikz\draw[hhuCorporateGrey!70!black,fill=hhuCorporateGrey!70!black] (0,0) circle (.5ex); + }, + top=1mm, + bottom=0mm, + left=1mm, + right=1mm +} + +\newtcbox{\codehighlight}{nobeforeafter,boxrule=.5pt,colback=black!5,colframe=black!35, + arc=2pt,boxsep=0pt,left=2pt,right=2pt,top=2pt,bottom=1pt, tcbox raise base} + +\newcommand{\code}[1]{\codehighlight{\texttt{#1}}} + +\newtcbox{\languagehighlight}{nobeforeafter,boxrule=0pt,colback=black!5,arc=1pt, + boxsep=0pt,left=2pt,right=2pt,top=2pt,bottom=2pt, tcbox raise base} + +\newcommand{\codelang}[1]{\languagehighlight{\texttt{#1}}} + +\newenvironment{noteblock}% +{ + \setlength\topsep{4pt} + \setlength\parskip{0pt} + \begin{center} + \begin{tabular}{|p{.95\linewidth}} + } + % + { + \end{tabular} + \end{center} +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Code environments +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\newminted{java}{ + linenos, + autogobble, + breaklines=true, + breaksymbol=, + breakindent=4mm, + breakbefore=., + breakbeforesymbolpre=, + breakbeforesymbolpost=, + baselinestretch=0.8, + escapeinside=||, + framesep=5mm, + numbersep=7pt, + % fontfamily=tt, + fontsize=\footnotesize, + % style=bw, + escapeinside=|| +} + +\newminted{kotlin}{ + linenos, + autogobble, + breaklines=true, + breaksymbol=, + breakindent=4mm, + breakbefore=., + breakbeforesymbolpre=, + breakbeforesymbolpost=, + baselinestretch=0.8, + escapeinside=||, + framesep=5mm, + numbersep=7pt, + % fontfamily=tt, + fontsize=\footnotesize, + % style=bw, + escapeinside=|| +} + +\newminted{scala}{ + linenos, + autogobble, + breaklines=true, + breaksymbol=, + breakindent=4mm, + breakbefore=., + breakbeforesymbolpre=, + breakbeforesymbolpost=, + baselinestretch=0.8, + escapeinside=||, + framesep=5mm, + numbersep=7pt, + % fontfamily=tt, + fontsize=\footnotesize, + % style=bw, + escapeinside=|| +} + +\newminted{c}{ + linenos, + autogobble, + breaklines=true, + breaksymbol=, + breakindent=4mm, + breakbefore=., + breakbeforesymbolpre=, + breakbeforesymbolpost=, + baselinestretch=0.8, + escapeinside=||, + framesep=5mm, + numbersep=7pt, + % fontfamily=tt, + fontsize=\footnotesize, + % style=bw, + escapeinside=|| +} + +\newmintedfile[cppfile]{cpp}{ + linenos, + autogobble, + breaklines=true, + breaksymbol=, + breakindent=4mm, + breakbefore=., + breakbeforesymbolpre=, + breakbeforesymbolpost=, + baselinestretch=0.8, + escapeinside=||, + framesep=5mm, + numbersep=7pt, + % fontfamily=tt, + fontsize=\footnotesize, + % style=bw, + escapeinside=|| +} + +\newmintedfile[nasmfile]{nasm}{ + linenos, + autogobble, + breaklines=true, + breaksymbol=, + breakindent=4mm, + breakbefore=., + breakbeforesymbolpre=, + breakbeforesymbolpost=, + baselinestretch=0.8, + escapeinside=||, + framesep=5mm, + numbersep=7pt, + % fontfamily=tt, + fontsize=\footnotesize, + % style=bw, + escapeinside=|| +} + +\newminted{rust}{ + linenos, + autogobble, + breaklines=true, + breaksymbol=, + breakindent=4mm, + breakbefore=., + breakbeforesymbolpre=, + breakbeforesymbolpost=, + baselinestretch=1.0, + escapeinside=||, + framesep=5mm, + numbersep=7pt, + % fontfamily=tt, + fontsize=\footnotesize, + % style=bw, + escapeinside=|| +} + +\newminted{go}{ + linenos, + autogobble, + breaklines=true, + breaksymbol=, + breakindent=4mm, + breakbefore=., + breakbeforesymbolpre=, + breakbeforesymbolpost=, + baselinestretch=1.0, + escapeinside=||, + framesep=5mm, + numbersep=7pt, + % fontfamily=tt, + fontsize=\footnotesize, + % style=bw, + escapeinside=|| +} + +\newminted{text}{ + autogobble, + breaklines=true, + breaksymbol=, + breakindent=4mm, + breakbefore=., + breakbeforesymbolpre=, + breakbeforesymbolpost=, + baselinestretch=1.0, + escapeinside=||, + framesep=5mm, + numbersep=7pt, + % fontfamily=tt, + fontsize=\footnotesize, + % style=bw, + escapeinside=|| +} \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..937bcbc --- /dev/null +++ b/flake.lock @@ -0,0 +1,112 @@ +{ + "nodes": { + "devshell": { + "inputs": { + "nixpkgs": "nixpkgs", + "systems": "systems" + }, + "locked": { + "lastModified": 1685972731, + "narHash": "sha256-VpwVUthxs3AFgvWxGTHu+KVDnS/zT3xkCtmjX2PjNQs=", + "owner": "numtide", + "repo": "devshell", + "rev": "6b2554d28d46bfa6e24b941e999a145760dad0e1", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1685518550, + "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1677383253, + "narHash": "sha256-UfpzWfSxkfXHnb4boXZNaKsAcUrZT9Hw+tao1oZxd08=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9952d6bc395f5841262b006fbace8dd7e143b634", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1685938391, + "narHash": "sha256-96Jw6TbWDLSopt5jqCW8w1Fc1cjQyZlhfBnJ3OZGpME=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "31cd1b4afbaf0b1e81272ee9c31d1ab606503aed", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "devshell": "devshell", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs_2" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..7670fe5 --- /dev/null +++ b/flake.nix @@ -0,0 +1,40 @@ +{ + description = "Python Environment"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + inputs.devshell.url = "github:numtide/devshell"; + + outputs = { + self, + nixpkgs, + flake-utils, + devshell, + }: + flake-utils.lib.eachDefaultSystem (system: let + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + overlays = [devshell.overlays.default]; + }; + + myPython = pkgs.python310.withPackages (p: + with p; [ + rich + pygments + ]); + in { + devShell = pkgs.devshell.mkShell { + name = "Python Environment"; + + packages = with pkgs; [ + myPython + texlab + ]; + + # Use $1 for positional args + # commands = [ + # ]; + }; + }); +} diff --git a/glossary.tex b/glossary.tex new file mode 100644 index 0000000..ebeb88b --- /dev/null +++ b/glossary.tex @@ -0,0 +1,18 @@ +\makeglossaries{} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Acronyms +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Example: +% \newacronym{acpi}{ACPI}{advanced configuration and power interface} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Glossary Entries +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Example: +% \newglossaryentry{}{ +% name={}, +% description={} +% } \ No newline at end of file diff --git a/img/combination_vs_intermediate.png b/img/combination_vs_intermediate.png new file mode 100644 index 0000000..bc307e0 Binary files /dev/null and b/img/combination_vs_intermediate.png differ diff --git a/img/effector_face.png b/img/effector_face.png new file mode 100644 index 0000000..158de47 Binary files /dev/null and b/img/effector_face.png differ diff --git a/img/human_rig.png b/img/human_rig.png new file mode 100644 index 0000000..7f8ae4d Binary files /dev/null and b/img/human_rig.png differ diff --git a/img/parametric_model.png b/img/parametric_model.png new file mode 100644 index 0000000..0a5f033 Binary files /dev/null and b/img/parametric_model.png differ diff --git a/img/unconstrained_weights.png b/img/unconstrained_weights.png new file mode 100644 index 0000000..fce1935 Binary files /dev/null and b/img/unconstrained_weights.png differ diff --git a/img/unnatural_deformation.png b/img/unnatural_deformation.png new file mode 100644 index 0000000..ee03b25 Binary files /dev/null and b/img/unnatural_deformation.png differ diff --git a/properties.tex b/properties.tex new file mode 100644 index 0000000..0cbe975 --- /dev/null +++ b/properties.tex @@ -0,0 +1,71 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Titel der Arbeit % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\thesistitle{Facial Animation using Inverse Kinematics} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Schlüsselwörter % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\thesiskeywords{Computer Graphics, Facial Animation, Inverse Kinematics, Blendshapes} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Sprache der Arbeit % +% % +% ngerman - Deutsch (neue Rechtschreibung) % +% english - Englisch % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\thesislanguage{english} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Art der Arbeit % +% % +% bachelor - Bachelorarbeit % +% master - Masterarbeit % +% project - Projektarbeit % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\thesistype{bachelor} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Ausgabe von Verzeichnissen % +% % +% true - Aktiviert % +% false - Deaktiviert % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\listofalgorithmsenabled{false} +\listoffiguresenabled{false} +\listoftablesenabled{false} +\listoflistingsenabled{false} +\titleenabled{false} +\tocenabled{false} +\glossaryenabled{false} +\bibliographyenabled{true} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Vollständiger Name % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\thesisauthor{Christoph Urlacher} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Geburtsort % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\authorbirthplace{Ratingen} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Datum der Abgabe % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\submissiondate{March 8th, 2023} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Erstgutachter % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\firstreviewer{} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Zweitgutachter % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\secondreviewer{} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Betreuer % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\supervisor{} diff --git a/references.bib b/references.bib new file mode 100644 index 0000000..07c5214 --- /dev/null +++ b/references.bib @@ -0,0 +1,73 @@ +@inproceedings{parametricface, + title = {A parametric model for human faces.}, + author = {Frederic I. Parke}, + year = {1974}, + url = {https://api.semanticscholar.org/CorpusID:60759533}, +} + +@article{directmanipulationblendshapes, + author = {Lewis, J.P. and Anjyo, Ken}, + year = {2010}, + month = {09}, + pages = {42-50}, + title = {Direct-Manipulation Blendshapes}, + volume = {30}, + journal = {IEEE computer graphics and applications}, + doi = {10.1109/MCG.2010.41}, +}⏎ + +@inproceedings{transpositiondirectmanipulationblendshapes, + author = {Cetinaslan, Ozan and Lewis, John and Orvalho, Veronica}, + year = {2017}, + month = {01}, + pages = {105-115}, + title = {Transposition Based Blendshape Direct Manipulation}, + doi = {10.5220/0006131901050115}, +}⏎ + +@article{jacobiantranspose, + author = {Buss, Samuel}, + year = {2004}, + month = {05}, + pages = {}, + title = {Introduction to inverse kinematics with Jacobian transpose, + pseudoinverse and damped least squares methods}, + volume = {17}, + journal = {IEEE Transactions in Robotics and Automation}, +}⏎ + +@article{nonconvexblendshapes, + author = {Rackovic, Stevo and Soares, Cláudia and Jakovetic, Dusan and + Desnica, Zoranka}, + year = {2023}, + month = {05}, + pages = {1-15}, + title = {A majorization–minimization-based method for nonconvex inverse rig + problems in facial animation: algorithm derivation}, + journal = {Optimization Letters}, + doi = {10.1007/s11590-023-02012-w}, +}⏎ + +@inproceedings{practicetheoryblendshapes, + booktitle = {Eurographics 2014 - State of the Art Reports}, + editor = {Sylvain Lefebvre and Michela Spagnuolo}, + title = {{Practice and Theory of Blendshape Facial Models}}, + author = {Lewis, J. P. and Anjyo, Ken and Rhee, Taehyun and Zhang, Mengjie + and Pighin, Fred and Deng, Zhigang}, + year = {2014}, + publisher = {The Eurographics Association}, + ISSN = {1017-4656}, + DOI = {10.2312/egst.20141042}, +} + +@misc{computeranimation, + author = {Botsch}, + title = {Computer Animation}, + organization = {TU Dortmund}, + year = {2022}, +} + +@misc{optitrack, + url = {https://optitrack.com/cameras/primex-13w/specs.html}, + urldate = {2023-10-27}, +} diff --git a/thesis.tex b/thesis.tex new file mode 100644 index 0000000..3f3b4fd --- /dev/null +++ b/thesis.tex @@ -0,0 +1,44 @@ +\documentclass{class/thesis} +\usepackage{mathtools} % [draft] + +\include{properties} +\include{glossary} + +\begin{document} +\begin{thesis} + + % Detect overfull boxes + % \overfullrule=2cm + + % Capitalize all the section names + \renewcommand{\figureautorefname}{Figure} + \renewcommand{\tableautorefname}{Table} + \renewcommand{\partautorefname}{Part} + \renewcommand{\appendixautorefname}{Appendix} + \renewcommand{\chapterautorefname}{Chapter} + \renewcommand{\sectionautorefname}{Section} + \renewcommand{\subsectionautorefname}{Section} + \renewcommand{\subsubsectionautorefname}{Section} + \makeatletter\newcommand{\tcb@cnt@codeblockautorefname}{Listing}\makeatother + + % Title + \title{Facial Animation and Inverse Kinematics} + \author{Christoph Urlacher} + + \setcounter{page}{0} + \maketitle + \clearpage + \setcounter{page}{1} + + % Chapters + \include{chap/chapter1} % Introduction + \include{chap/chapter2} % Skeletal models + \include{chap/chapter3} % Blend shape models + \include{chap/chapter4} % Performance capture + + % \begin{appendices} + % \include{chap/appendix1} + % \end{appendices} + +\end{thesis} +\end{document} \ No newline at end of file