Commit 978acd8b authored by Patrik Huber's avatar Patrik Huber

Updated doxygen pages to eos v0.7.1

parent 800770dd
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/morphablemodel/Blendshape.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos
&#160;<span id="projectnumber">0.7.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_8c2f38a39d6204ca353f500c7575d762.html">morphablemodel</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Blendshape.hpp</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/morphablemodel/Blendshape.hpp</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2015 Patrik Huber</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef BLENDSHAPE_HPP_</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define BLENDSHAPE_HPP_</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;eos/morphablemodel/io/mat_cerealisation.hpp&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &quot;cereal/types/string.hpp&quot;</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;cereal/archives/binary.hpp&quot;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#include &lt;fstream&gt;</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; <span class="keyword">namespace </span>morphablemodel {</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;</div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="structeos_1_1morphablemodel_1_1_blendshape.html"> 44</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structeos_1_1morphablemodel_1_1_blendshape.html">Blendshape</a></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;{</div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="structeos_1_1morphablemodel_1_1_blendshape.html#ab87c9b282061a3dd72a8176fffa99594"> 46</a></span>&#160; std::string <a class="code" href="structeos_1_1morphablemodel_1_1_blendshape.html#ab87c9b282061a3dd72a8176fffa99594">name</a>; </div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="structeos_1_1morphablemodel_1_1_blendshape.html#ae5d056f2f0473ddf1c0f000714c0b709"> 47</a></span>&#160; cv::Mat <a class="code" href="structeos_1_1morphablemodel_1_1_blendshape.html#ae5d056f2f0473ddf1c0f000714c0b709">deformation</a>; </div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span>cereal::access;</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">class</span> Archive&gt;</div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="structeos_1_1morphablemodel_1_1_blendshape.html#aeccd060e4fa63cf3c417625d118f0602"> 56</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="structeos_1_1morphablemodel_1_1_blendshape.html#aeccd060e4fa63cf3c417625d118f0602">serialize</a>(Archive&amp; archive)</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; {</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; archive(name, deformation);</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; };</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;};</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="namespaceeos_1_1morphablemodel.html#a408184d7cae7e40c5c8e76c2bc114811"> 70</a></span>&#160;std::vector&lt;Blendshape&gt; <a class="code" href="namespaceeos_1_1morphablemodel.html#a408184d7cae7e40c5c8e76c2bc114811">load_blendshapes</a>(std::string filename)</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;{</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; std::vector&lt;Blendshape&gt; blendshapes;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; std::ifstream file(filename, std::ios::binary);</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <span class="keywordflow">if</span> (file.fail()) {</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">&quot;Error opening given file: &quot;</span> + filename);</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; }</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; cereal::BinaryInputArchive input_archive(file);</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; input_archive(blendshapes);</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="keywordflow">return</span> blendshapes;</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;};</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; } <span class="comment">/* namespace morphablemodel */</span></div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;} <span class="comment">/* namespace eos */</span></div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* BLENDSHAPE_HPP_ */</span><span class="preprocessor"></span></div><div class="ttc" id="namespaceeos_1_1morphablemodel_html_a408184d7cae7e40c5c8e76c2bc114811"><div class="ttname"><a href="namespaceeos_1_1morphablemodel.html#a408184d7cae7e40c5c8e76c2bc114811">eos::morphablemodel::load_blendshapes</a></div><div class="ttdeci">std::vector&lt; Blendshape &gt; load_blendshapes(std::string filename)</div><div class="ttdef"><b>Definition:</b> Blendshape.hpp:70</div></div>
<div class="ttc" id="structeos_1_1morphablemodel_1_1_blendshape_html_ae5d056f2f0473ddf1c0f000714c0b709"><div class="ttname"><a href="structeos_1_1morphablemodel_1_1_blendshape.html#ae5d056f2f0473ddf1c0f000714c0b709">eos::morphablemodel::Blendshape::deformation</a></div><div class="ttdeci">cv::Mat deformation</div><div class="ttdoc">A 3m x 1 col-vector (xyzxyz...)&amp;#39;, where m is the number of model-vertices. Has the same format as Pca...</div><div class="ttdef"><b>Definition:</b> Blendshape.hpp:47</div></div>
<div class="ttc" id="structeos_1_1morphablemodel_1_1_blendshape_html_aeccd060e4fa63cf3c417625d118f0602"><div class="ttname"><a href="structeos_1_1morphablemodel_1_1_blendshape.html#aeccd060e4fa63cf3c417625d118f0602">eos::morphablemodel::Blendshape::serialize</a></div><div class="ttdeci">void serialize(Archive &amp;archive)</div><div class="ttdef"><b>Definition:</b> Blendshape.hpp:56</div></div>
<div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&amp;#39;s 3D model fitting functionality. </div></div>
<div class="ttc" id="structeos_1_1morphablemodel_1_1_blendshape_html"><div class="ttname"><a href="structeos_1_1morphablemodel_1_1_blendshape.html">eos::morphablemodel::Blendshape</a></div><div class="ttdoc">A class representing a 3D blendshape. </div><div class="ttdef"><b>Definition:</b> Blendshape.hpp:44</div></div>
<div class="ttc" id="structeos_1_1morphablemodel_1_1_blendshape_html_ab87c9b282061a3dd72a8176fffa99594"><div class="ttname"><a href="structeos_1_1morphablemodel_1_1_blendshape.html#ab87c9b282061a3dd72a8176fffa99594">eos::morphablemodel::Blendshape::name</a></div><div class="ttdeci">std::string name</div><div class="ttdoc">Name of the blendshape. </div><div class="ttdef"><b>Definition:</b> Blendshape.hpp:46</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/core/Landmark.hpp Source File</title> <title>eos: include/eos/core/Landmark.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div id="nav-path" class="navpath"> <div id="nav-path" class="navpath">
<ul> <ul>
<li class="navelem"><a class="el" href="dir_ce53d3124a8ddb93985ce6ec479297f4.html">include</a></li><li class="navelem"><a class="el" href="dir_c7ebde285fcef06dba0b090642612638.html">eos</a></li><li class="navelem"><a class="el" href="dir_bfe318604057f18fe4ea65f858b9b42f.html">core</a></li> </ul> <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_1d6e0dec1b83a3cd88e652cf81228044.html">core</a></li> </ul>
</div> </div>
</div><!-- top --> </div><!-- top -->
<div class="header"> <div class="header">
...@@ -95,74 +95,18 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -95,74 +95,18 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="title">Landmark.hpp</div> </div> <div class="title">Landmark.hpp</div> </div>
</div><!--header--> </div><!--header-->
<div class="contents"> <div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div> <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/core/Landmark.hpp</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2014, 2015 Patrik Huber</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef EOS_LANDMARK_HPP_</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define EOS_LANDMARK_HPP_</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &lt;algorithm&gt;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; <span class="keyword">namespace </span>core {</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">class</span> LandmarkType&gt;</div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="structeos_1_1core_1_1_landmark.html"> 37</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structeos_1_1core_1_1_landmark.html">Landmark</a></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;{</div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="structeos_1_1core_1_1_landmark.html#a85c0f001e311e994314e900dcb284ad3"> 39</a></span>&#160; std::string <a class="code" href="structeos_1_1core_1_1_landmark.html#a85c0f001e311e994314e900dcb284ad3">name</a>; </div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="structeos_1_1core_1_1_landmark.html#aa3ffa0bd40290634e485e3c5ca99229c"> 40</a></span>&#160; LandmarkType <a class="code" href="structeos_1_1core_1_1_landmark.html#aa3ffa0bd40290634e485e3c5ca99229c">coordinates</a>; </div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;};</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b"> 46</a></span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">class</span> LandmarkType&gt; <span class="keyword">using</span> <a class="code" href="namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b">LandmarkCollection</a> = std::vector&lt;Landmark&lt;LandmarkType&gt;&gt;;</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;</div><div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="namespaceeos_1_1core.html#aacf41dc417a1dbfc929c9cc7f2c7feeb"> 57</a></span>&#160;<a class="code" href="namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b">LandmarkCollection&lt;T&gt;</a> <a class="code" href="namespaceeos_1_1core.html#aacf41dc417a1dbfc929c9cc7f2c7feeb">filter</a>(<span class="keyword">const</span> <a class="code" href="namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b">LandmarkCollection&lt;T&gt;</a>&amp; landmarks, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; <a class="code" href="namespaceeos_1_1core.html#aacf41dc417a1dbfc929c9cc7f2c7feeb">filter</a>)</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;{</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; <a class="code" href="namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b">LandmarkCollection&lt;T&gt;</a> filtered_landmarks;</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="keyword">using</span> std::begin;</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; <span class="keyword">using</span> std::end;</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; std::copy_if(begin(landmarks), end(landmarks), std::back_inserter(filtered_landmarks),</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; [&amp;](<span class="keyword">const</span> <a class="code" href="structeos_1_1core_1_1_landmark.html">Landmark&lt;T&gt;</a>&amp; lm) { <span class="keywordflow">return</span> std::find(begin(filter), end(filter), lm.<a class="code" href="structeos_1_1core_1_1_landmark.html#a85c0f001e311e994314e900dcb284ad3">name</a>) != end(filter); }</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; );</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="keywordflow">return</span> filtered_landmarks;</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;};</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; } <span class="comment">/* namespace core */</span></div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;} <span class="comment">/* namespace eos */</span></div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* EOS_LANDMARK_HPP_ */</span><span class="preprocessor"></span></div><div class="ttc" id="structeos_1_1core_1_1_landmark_html_a85c0f001e311e994314e900dcb284ad3"><div class="ttname"><a href="structeos_1_1core_1_1_landmark.html#a85c0f001e311e994314e900dcb284ad3">eos::core::Landmark::name</a></div><div class="ttdeci">std::string name</div><div class="ttdoc">Name of the landmark, often used as identifier. </div><div class="ttdef"><b>Definition:</b> Landmark.hpp:39</div></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/core/Landmark.hpp</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2014, 2015 Patrik Huber</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef EOS_LANDMARK_HPP_</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define EOS_LANDMARK_HPP_</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &lt;algorithm&gt;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; <span class="keyword">namespace </span>core {</div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">class</span> LandmarkType&gt;</div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="structeos_1_1core_1_1_landmark.html"> 37</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structeos_1_1core_1_1_landmark.html">Landmark</a></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;{</div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="structeos_1_1core_1_1_landmark.html#a85c0f001e311e994314e900dcb284ad3"> 39</a></span>&#160; std::string <a class="code" href="structeos_1_1core_1_1_landmark.html#a85c0f001e311e994314e900dcb284ad3">name</a>; </div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="structeos_1_1core_1_1_landmark.html#aa3ffa0bd40290634e485e3c5ca99229c"> 40</a></span>&#160; LandmarkType <a class="code" href="structeos_1_1core_1_1_landmark.html#aa3ffa0bd40290634e485e3c5ca99229c">coordinates</a>; </div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;};</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;</div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b"> 46</a></span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">class</span> LandmarkType&gt; <span class="keyword">using</span> <a class="code" href="namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b">LandmarkCollection</a> = std::vector&lt;Landmark&lt;LandmarkType&gt;&gt;;</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;</div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="namespaceeos_1_1core.html#aacf41dc417a1dbfc929c9cc7f2c7feeb"> 57</a></span>&#160;<a class="code" href="namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b">LandmarkCollection&lt;T&gt;</a> <a class="code" href="namespaceeos_1_1core.html#aacf41dc417a1dbfc929c9cc7f2c7feeb">filter</a>(<span class="keyword">const</span> <a class="code" href="namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b">LandmarkCollection&lt;T&gt;</a>&amp; landmarks, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; <a class="code" href="namespaceeos_1_1core.html#aacf41dc417a1dbfc929c9cc7f2c7feeb">filter</a>)</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;{</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; <a class="code" href="namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b">LandmarkCollection&lt;T&gt;</a> filtered_landmarks;</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="keyword">using</span> std::begin;</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; <span class="keyword">using</span> std::end;</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; std::copy_if(begin(landmarks), end(landmarks), std::back_inserter(filtered_landmarks),</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; [&amp;](<span class="keyword">const</span> <a class="code" href="structeos_1_1core_1_1_landmark.html">Landmark&lt;T&gt;</a>&amp; lm) { <span class="keywordflow">return</span> std::find(begin(filter), end(filter), lm.<a class="code" href="structeos_1_1core_1_1_landmark.html#a85c0f001e311e994314e900dcb284ad3">name</a>) != end(filter); }</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; );</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="keywordflow">return</span> filtered_landmarks;</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;};</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; } <span class="comment">/* namespace core */</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;} <span class="comment">/* namespace eos */</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* EOS_LANDMARK_HPP_ */</span><span class="preprocessor"></span></div>
<div class="ttc" id="structeos_1_1core_1_1_landmark_html_a85c0f001e311e994314e900dcb284ad3"><div class="ttname"><a href="structeos_1_1core_1_1_landmark.html#a85c0f001e311e994314e900dcb284ad3">eos::core::Landmark::name</a></div><div class="ttdeci">std::string name</div><div class="ttdoc">Name of the landmark, often used as identifier. </div><div class="ttdef"><b>Definition:</b> Landmark.hpp:39</div></div>
<div class="ttc" id="namespaceeos_1_1core_html_a6d6a8533690b5860236f55afafa14d2b"><div class="ttname"><a href="namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b">eos::core::LandmarkCollection</a></div><div class="ttdeci">std::vector&lt; Landmark&lt; LandmarkType &gt;&gt; LandmarkCollection</div><div class="ttdoc">A trivial collection of landmarks that belong together. </div><div class="ttdef"><b>Definition:</b> Landmark.hpp:46</div></div> <div class="ttc" id="namespaceeos_1_1core_html_a6d6a8533690b5860236f55afafa14d2b"><div class="ttname"><a href="namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b">eos::core::LandmarkCollection</a></div><div class="ttdeci">std::vector&lt; Landmark&lt; LandmarkType &gt;&gt; LandmarkCollection</div><div class="ttdoc">A trivial collection of landmarks that belong together. </div><div class="ttdef"><b>Definition:</b> Landmark.hpp:46</div></div>
<div class="ttc" id="structeos_1_1core_1_1_landmark_html_aa3ffa0bd40290634e485e3c5ca99229c"><div class="ttname"><a href="structeos_1_1core_1_1_landmark.html#aa3ffa0bd40290634e485e3c5ca99229c">eos::core::Landmark::coordinates</a></div><div class="ttdeci">LandmarkType coordinates</div><div class="ttdoc">The position or coordinates of the landmark. </div><div class="ttdef"><b>Definition:</b> Landmark.hpp:40</div></div> <div class="ttc" id="structeos_1_1core_1_1_landmark_html_aa3ffa0bd40290634e485e3c5ca99229c"><div class="ttname"><a href="structeos_1_1core_1_1_landmark.html#aa3ffa0bd40290634e485e3c5ca99229c">eos::core::Landmark::coordinates</a></div><div class="ttdeci">LandmarkType coordinates</div><div class="ttdoc">The position or coordinates of the landmark. </div><div class="ttdef"><b>Definition:</b> Landmark.hpp:40</div></div>
<div class="ttc" id="namespaceeos_1_1core_html_aacf41dc417a1dbfc929c9cc7f2c7feeb"><div class="ttname"><a href="namespaceeos_1_1core.html#aacf41dc417a1dbfc929c9cc7f2c7feeb">eos::core::filter</a></div><div class="ttdeci">LandmarkCollection&lt; T &gt; filter(const LandmarkCollection&lt; T &gt; &amp;landmarks, const std::vector&lt; std::string &gt; &amp;filter)</div><div class="ttdoc">Filters the given LandmarkCollection and returns a new LandmarkCollection containing all landmarks wh...</div><div class="ttdef"><b>Definition:</b> Landmark.hpp:57</div></div> <div class="ttc" id="namespaceeos_1_1core_html_aacf41dc417a1dbfc929c9cc7f2c7feeb"><div class="ttname"><a href="namespaceeos_1_1core.html#aacf41dc417a1dbfc929c9cc7f2c7feeb">eos::core::filter</a></div><div class="ttdeci">LandmarkCollection&lt; T &gt; filter(const LandmarkCollection&lt; T &gt; &amp;landmarks, const std::vector&lt; std::string &gt; &amp;filter)</div><div class="ttdoc">Filters the given LandmarkCollection and returns a new LandmarkCollection containing all landmarks wh...</div><div class="ttdef"><b>Definition:</b> Landmark.hpp:57</div></div>
<div class="ttc" id="structeos_1_1core_1_1_landmark_html"><div class="ttname"><a href="structeos_1_1core_1_1_landmark.html">eos::core::Landmark</a></div><div class="ttdoc">Representation of a landmark, consisting of a landmark name and coordinates of the given type...</div><div class="ttdef"><b>Definition:</b> Landmark.hpp:37</div></div> <div class="ttc" id="structeos_1_1core_1_1_landmark_html"><div class="ttname"><a href="structeos_1_1core_1_1_landmark.html">eos::core::Landmark</a></div><div class="ttdoc">Representation of a landmark, consisting of a landmark name and coordinates of the given type...</div><div class="ttdef"><b>Definition:</b> Landmark.hpp:37</div></div>
<div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&#39;s 3D model fitting functionality. </div></div> <div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&amp;#39;s 3D model fitting functionality. </div></div>
</div><!-- fragment --></div><!-- contents --> </div><!-- fragment --></div><!-- contents -->
<!-- start footer part --> <!-- start footer part -->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/core/LandmarkMapper.hpp Source File</title> <title>eos: include/eos/core/LandmarkMapper.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div id="nav-path" class="navpath"> <div id="nav-path" class="navpath">
<ul> <ul>
<li class="navelem"><a class="el" href="dir_ce53d3124a8ddb93985ce6ec479297f4.html">include</a></li><li class="navelem"><a class="el" href="dir_c7ebde285fcef06dba0b090642612638.html">eos</a></li><li class="navelem"><a class="el" href="dir_bfe318604057f18fe4ea65f858b9b42f.html">core</a></li> </ul> <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_1d6e0dec1b83a3cd88e652cf81228044.html">core</a></li> </ul>
</div> </div>
</div><!-- top --> </div><!-- top -->
<div class="header"> <div class="header">
...@@ -95,118 +95,18 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -95,118 +95,18 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="title">LandmarkMapper.hpp</div> </div> <div class="title">LandmarkMapper.hpp</div> </div>
</div><!--header--> </div><!--header-->
<div class="contents"> <div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div> <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/core/LandmarkMapper.hpp</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2014, 2015 Patrik Huber</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef LANDMARKMAPPER_HPP_</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define LANDMARKMAPPER_HPP_</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;boost/optional.hpp&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &quot;boost/filesystem/path.hpp&quot;</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;boost/property_tree/ptree.hpp&quot;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &quot;boost/property_tree/info_parser.hpp&quot;</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &lt;map&gt;</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; <span class="keyword">namespace </span>core {</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;</div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="classeos_1_1core_1_1_landmark_mapper.html"> 52</a></span>&#160;<span class="keyword">class </span><a class="code" href="classeos_1_1core_1_1_landmark_mapper.html">LandmarkMapper</a> {</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <a class="code" href="classeos_1_1core_1_1_landmark_mapper.html#ab31ea1ec78c463ce54e2372fce103889">LandmarkMapper</a>() = <span class="keywordflow">default</span>;</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;</div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="classeos_1_1core_1_1_landmark_mapper.html#a7da2756a772bd7dd7708bf20fcc95fc4"> 71</a></span>&#160; <a class="code" href="classeos_1_1core_1_1_landmark_mapper.html#a7da2756a772bd7dd7708bf20fcc95fc4">LandmarkMapper</a>(boost::filesystem::path filename)</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; {</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keyword">using</span> std::string;</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="keyword">using</span> boost::property_tree::ptree;</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; ptree configtree;</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="keywordflow">try</span> {</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; boost::property_tree::info_parser::read_info(filename.string(), configtree);</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; }</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keywordflow">catch</span> (<span class="keyword">const</span> boost::property_tree::ptree_error&amp; error) {</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(<span class="keywordtype">string</span>(<span class="stringliteral">&quot;LandmarkMapper: Error reading landmark-mappings file: &quot;</span>) + error.what());</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; }</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="keywordflow">try</span> {</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; ptree pt_landmark_mappings = configtree.get_child(<span class="stringliteral">&quot;landmarkMappings&quot;</span>);</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp;&amp; mapping : pt_landmark_mappings) {</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; landmark_mappings.insert(make_pair(mapping.first, mapping.second.get_value&lt;<span class="keywordtype">string</span>&gt;()));</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; }</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; }</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="keywordflow">catch</span> (<span class="keyword">const</span> boost::property_tree::ptree_error&amp; error) {</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(<span class="keywordtype">string</span>(<span class="stringliteral">&quot;LandmarkMapper: Error while parsing the mappings file: &quot;</span>) + error.what());</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; }</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="keywordflow">catch</span> (<span class="keyword">const</span> std::runtime_error&amp; error) {</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(<span class="keywordtype">string</span>(<span class="stringliteral">&quot;LandmarkMapper: Error while parsing the mappings file: &quot;</span>) + error.what());</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; }</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; };</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;</div><div class="line"><a name="l00105"></a><span class="lineno"><a class="line" href="classeos_1_1core_1_1_landmark_mapper.html#aa0d5463e00e3b8f074b1f81dbd9390a7"> 105</a></span>&#160; boost::optional&lt;std::string&gt; <a class="code" href="classeos_1_1core_1_1_landmark_mapper.html#aa0d5463e00e3b8f074b1f81dbd9390a7">convert</a>(std::string landmark_name)<span class="keyword"> const</span></div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <span class="keywordflow">if</span> (landmark_mappings.empty()) {</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="comment">// perform identity mapping, i.e. return the input</span></div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="keywordflow">return</span> landmark_name;</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; }</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keywordflow">else</span> {</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="keyword">auto</span>&amp;&amp; converted_landmark = landmark_mappings.find(landmark_name);</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="keywordflow">if</span> (converted_landmark != std::end(landmark_mappings)) {</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <span class="comment">// landmark mapping found, return it</span></div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keywordflow">return</span> converted_landmark-&gt;second;</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; }</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="keywordflow">else</span> { <span class="comment">// landmark_name does not match the key of any element in the map</span></div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="keywordflow">return</span> boost::none;</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; }</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; }</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; };</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;</div><div class="line"><a name="l00128"></a><span class="lineno"><a class="line" href="classeos_1_1core_1_1_landmark_mapper.html#a7e3a46e6aeb522d96066a3d73f4c92c6"> 128</a></span>&#160; <span class="keyword">auto</span> <a class="code" href="classeos_1_1core_1_1_landmark_mapper.html#a7e3a46e6aeb522d96066a3d73f4c92c6">size</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="keywordflow">return</span> landmark_mappings.size();</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; };</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; std::map&lt;std::string, std::string&gt; landmark_mappings; </div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;};</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; } <span class="comment">/* namespace core */</span></div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160;} <span class="comment">/* namespace eos */</span></div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* LANDMARKMAPPER_HPP_ */</span><span class="preprocessor"></span></div><div class="ttc" id="classeos_1_1core_1_1_landmark_mapper_html_ab31ea1ec78c463ce54e2372fce103889"><div class="ttname"><a href="classeos_1_1core_1_1_landmark_mapper.html#ab31ea1ec78c463ce54e2372fce103889">eos::core::LandmarkMapper::LandmarkMapper</a></div><div class="ttdeci">LandmarkMapper()=default</div><div class="ttdoc">Constructs a new landmark mapper that performs an identity mapping, that is, its output is the same a...</div></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div> <div class="ttc" id="classeos_1_1core_1_1_landmark_mapper_html_a7e3a46e6aeb522d96066a3d73f4c92c6"><div class="ttname"><a href="classeos_1_1core_1_1_landmark_mapper.html#a7e3a46e6aeb522d96066a3d73f4c92c6">eos::core::LandmarkMapper::size</a></div><div class="ttdeci">auto size() const </div><div class="ttdoc">Returns the number of loaded landmark mappings. </div><div class="ttdef"><b>Definition:</b> LandmarkMapper.hpp:128</div></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div> <div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&amp;#39;s 3D model fitting functionality. </div></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/core/LandmarkMapper.hpp</span></div> <div class="ttc" id="classeos_1_1core_1_1_landmark_mapper_html_aa0d5463e00e3b8f074b1f81dbd9390a7"><div class="ttname"><a href="classeos_1_1core_1_1_landmark_mapper.html#aa0d5463e00e3b8f074b1f81dbd9390a7">eos::core::LandmarkMapper::convert</a></div><div class="ttdeci">boost::optional&lt; std::string &gt; convert(std::string landmark_name) const </div><div class="ttdoc">Converts the given landmark name to the mapped name. </div><div class="ttdef"><b>Definition:</b> LandmarkMapper.hpp:105</div></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div> <div class="ttc" id="classeos_1_1core_1_1_landmark_mapper_html_a7da2756a772bd7dd7708bf20fcc95fc4"><div class="ttname"><a href="classeos_1_1core_1_1_landmark_mapper.html#a7da2756a772bd7dd7708bf20fcc95fc4">eos::core::LandmarkMapper::LandmarkMapper</a></div><div class="ttdeci">LandmarkMapper(boost::filesystem::path filename)</div><div class="ttdoc">Constructs a new landmark mapper from a file containing mappings from one set of landmark identifiers...</div><div class="ttdef"><b>Definition:</b> LandmarkMapper.hpp:71</div></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2014, 2015 Patrik Huber</span></div> <div class="ttc" id="classeos_1_1core_1_1_landmark_mapper_html"><div class="ttname"><a href="classeos_1_1core_1_1_landmark_mapper.html">eos::core::LandmarkMapper</a></div><div class="ttdoc">Represents a mapping from one kind of landmarks to a different format (e.g. model vertices)...</div><div class="ttdef"><b>Definition:</b> LandmarkMapper.hpp:52</div></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef LANDMARKMAPPER_HPP_</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define LANDMARKMAPPER_HPP_</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#ifdef WIN32</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor"> #define BOOST_ALL_DYN_LINK // Link against the dynamic boost lib. Seems to be necessary because we use /MD, i.e. link to the dynamic CRT.</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor"> #define BOOST_ALL_NO_LIB // Don&#39;t use the automatic library linking by boost with VS2010 (#pragma ...). Instead, we specify everything in cmake.</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &quot;boost/optional.hpp&quot;</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &quot;boost/filesystem/path.hpp&quot;</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &quot;boost/property_tree/ptree.hpp&quot;</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#include &quot;boost/property_tree/info_parser.hpp&quot;</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="preprocessor">#include &lt;map&gt;</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; <span class="keyword">namespace </span>core {</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;</div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="classeos_1_1core_1_1_landmark_mapper.html"> 56</a></span>&#160;<span class="keyword">class </span><a class="code" href="classeos_1_1core_1_1_landmark_mapper.html">LandmarkMapper</a> {</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <a class="code" href="classeos_1_1core_1_1_landmark_mapper.html#ab31ea1ec78c463ce54e2372fce103889">LandmarkMapper</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;</div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="classeos_1_1core_1_1_landmark_mapper.html#a7da2756a772bd7dd7708bf20fcc95fc4"> 75</a></span>&#160; <a class="code" href="classeos_1_1core_1_1_landmark_mapper.html#a7da2756a772bd7dd7708bf20fcc95fc4">LandmarkMapper</a>(boost::filesystem::path filename)</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; {</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="keyword">using</span> std::string;</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="keyword">using</span> boost::property_tree::ptree;</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; ptree configtree;</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; boost::property_tree::info_parser::read_info(filename.string(), configtree);</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; }</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="keywordflow">catch</span> (<span class="keyword">const</span> boost::property_tree::ptree_error&amp; error) {</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(<span class="keywordtype">string</span>(<span class="stringliteral">&quot;LandmarkMapper: Error reading landmark-mappings file: &quot;</span>) + error.what());</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; }</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; ptree pt_landmark_mappings = configtree.get_child(<span class="stringliteral">&quot;landmarkMappings&quot;</span>);</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp;&amp; mapping : pt_landmark_mappings) {</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; landmark_mappings.insert(make_pair(mapping.first, mapping.second.get_value&lt;<span class="keywordtype">string</span>&gt;()));</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; }</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; }</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keywordflow">catch</span> (<span class="keyword">const</span> boost::property_tree::ptree_error&amp; error) {</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(<span class="keywordtype">string</span>(<span class="stringliteral">&quot;LandmarkMapper: Error while parsing the mappings file: &quot;</span>) + error.what());</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; }</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="keywordflow">catch</span> (<span class="keyword">const</span> std::runtime_error&amp; error) {</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(<span class="keywordtype">string</span>(<span class="stringliteral">&quot;LandmarkMapper: Error while parsing the mappings file: &quot;</span>) + error.what());</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; }</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; };</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;</div>
<div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="classeos_1_1core_1_1_landmark_mapper.html#aa0d5463e00e3b8f074b1f81dbd9390a7"> 109</a></span>&#160; boost::optional&lt;std::string&gt; <a class="code" href="classeos_1_1core_1_1_landmark_mapper.html#aa0d5463e00e3b8f074b1f81dbd9390a7">convert</a>(std::string landmark_name)<span class="keyword"> const</span></div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160;<span class="keyword"> </span>{</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keywordflow">if</span> (landmark_mappings.empty()) {</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="comment">// perform identity mapping, i.e. return the input</span></div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="keywordflow">return</span> landmark_name;</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; }</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="keyword">auto</span>&amp;&amp; converted_landmark = landmark_mappings.find(landmark_name);</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="keywordflow">if</span> (converted_landmark != std::end(landmark_mappings)) {</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="comment">// landmark mapping found, return it</span></div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="keywordflow">return</span> converted_landmark-&gt;second;</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; }</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <span class="keywordflow">else</span> { <span class="comment">// landmark_name does not match the key of any element in the map</span></div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="keywordflow">return</span> boost::none;</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; }</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; }</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; };</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;</div>
<div class="line"><a name="l00132"></a><span class="lineno"><a class="line" href="classeos_1_1core_1_1_landmark_mapper.html#a7e3a46e6aeb522d96066a3d73f4c92c6"> 132</a></span>&#160; <span class="keyword">auto</span> <a class="code" href="classeos_1_1core_1_1_landmark_mapper.html#a7e3a46e6aeb522d96066a3d73f4c92c6">size</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;<span class="keyword"> </span>{</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <span class="keywordflow">return</span> landmark_mappings.size();</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; };</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; std::map&lt;std::string, std::string&gt; landmark_mappings; </div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;};</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; } <span class="comment">/* namespace core */</span></div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;} <span class="comment">/* namespace eos */</span></div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* LANDMARKMAPPER_HPP_ */</span><span class="preprocessor"></span></div>
<div class="ttc" id="classeos_1_1core_1_1_landmark_mapper_html_ab31ea1ec78c463ce54e2372fce103889"><div class="ttname"><a href="classeos_1_1core_1_1_landmark_mapper.html#ab31ea1ec78c463ce54e2372fce103889">eos::core::LandmarkMapper::LandmarkMapper</a></div><div class="ttdeci">LandmarkMapper()=default</div><div class="ttdoc">Constructs a new landmark mapper that performs an identity mapping, that is, its output is the same a...</div></div>
<div class="ttc" id="classeos_1_1core_1_1_landmark_mapper_html_a7e3a46e6aeb522d96066a3d73f4c92c6"><div class="ttname"><a href="classeos_1_1core_1_1_landmark_mapper.html#a7e3a46e6aeb522d96066a3d73f4c92c6">eos::core::LandmarkMapper::size</a></div><div class="ttdeci">auto size() const </div><div class="ttdoc">Returns the number of loaded landmark mappings. </div><div class="ttdef"><b>Definition:</b> LandmarkMapper.hpp:132</div></div>
<div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&#39;s 3D model fitting functionality. </div></div>
<div class="ttc" id="classeos_1_1core_1_1_landmark_mapper_html_aa0d5463e00e3b8f074b1f81dbd9390a7"><div class="ttname"><a href="classeos_1_1core_1_1_landmark_mapper.html#aa0d5463e00e3b8f074b1f81dbd9390a7">eos::core::LandmarkMapper::convert</a></div><div class="ttdeci">boost::optional&lt; std::string &gt; convert(std::string landmark_name) const </div><div class="ttdoc">Converts the given landmark name to the mapped name. </div><div class="ttdef"><b>Definition:</b> LandmarkMapper.hpp:109</div></div>
<div class="ttc" id="classeos_1_1core_1_1_landmark_mapper_html_a7da2756a772bd7dd7708bf20fcc95fc4"><div class="ttname"><a href="classeos_1_1core_1_1_landmark_mapper.html#a7da2756a772bd7dd7708bf20fcc95fc4">eos::core::LandmarkMapper::LandmarkMapper</a></div><div class="ttdeci">LandmarkMapper(boost::filesystem::path filename)</div><div class="ttdoc">Constructs a new landmark mapper from a file containing mappings from one set of landmark identifiers...</div><div class="ttdef"><b>Definition:</b> LandmarkMapper.hpp:75</div></div>
<div class="ttc" id="classeos_1_1core_1_1_landmark_mapper_html"><div class="ttname"><a href="classeos_1_1core_1_1_landmark_mapper.html">eos::core::LandmarkMapper</a></div><div class="ttdoc">Represents a mapping from one kind of landmarks to a different format (e.g. model vertices)...</div><div class="ttdef"><b>Definition:</b> LandmarkMapper.hpp:56</div></div>
</div><!-- fragment --></div><!-- contents --> </div><!-- fragment --></div><!-- contents -->
<!-- start footer part --> <!-- start footer part -->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/render/Mesh.hpp Source File</title> <title>eos: include/eos/render/Mesh.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div id="nav-path" class="navpath"> <div id="nav-path" class="navpath">
<ul> <ul>
<li class="navelem"><a class="el" href="dir_ce53d3124a8ddb93985ce6ec479297f4.html">include</a></li><li class="navelem"><a class="el" href="dir_c7ebde285fcef06dba0b090642612638.html">eos</a></li><li class="navelem"><a class="el" href="dir_fab380b22e1724065a4c65606be96940.html">render</a></li> </ul> <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_9294a830dcc230dfe8b5c804d7e8b91a.html">render</a></li> </ul>
</div> </div>
</div><!-- top --> </div><!-- top -->
<div class="header"> <div class="header">
...@@ -95,149 +95,22 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -95,149 +95,22 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="title">Mesh.hpp</div> </div> <div class="title">Mesh.hpp</div> </div>
</div><!--header--> </div><!--header-->
<div class="contents"> <div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div> <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/render/Mesh.hpp</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2014, 2015 Patrik Huber</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef MESH_HPP_</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define MESH_HPP_</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;boost/filesystem/path.hpp&quot;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &lt;array&gt;</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#include &lt;cassert&gt;</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="preprocessor">#include &lt;fstream&gt;</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; <span class="keyword">namespace </span><a class="code" href="namespaceeos_1_1render.html#a097a630659b6c06a4596ca138f66ec94">render</a> {</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="structeos_1_1render_1_1_mesh.html"> 45</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structeos_1_1render_1_1_mesh.html">Mesh</a></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;{</div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e"> 47</a></span>&#160; std::vector&lt;cv::Vec4f&gt; <a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>; </div><div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b"> 48</a></span>&#160; std::vector&lt;cv::Vec3f&gt; <a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>; </div><div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4"> 49</a></span>&#160; std::vector&lt;cv::Vec2f&gt; <a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>; </div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b"> 51</a></span>&#160; std::vector&lt;std::array&lt;int, 3&gt;&gt; <a class="code" href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">tvi</a>; </div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="structeos_1_1render_1_1_mesh.html#a81c47a35a1b0a6a6cb440cfbb67b8c28"> 52</a></span>&#160; std::vector&lt;std::array&lt;int, 3&gt;&gt; <a class="code" href="structeos_1_1render_1_1_mesh.html#a81c47a35a1b0a6a6cb440cfbb67b8c28">tci</a>; </div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;};</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;</div><div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="namespaceeos_1_1render.html#a9b4673997fae6d670d7a9cc23543e8d7"> 63</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespaceeos_1_1render.html#a9b4673997fae6d670d7a9cc23543e8d7">write_obj</a>(<a class="code" href="structeos_1_1render_1_1_mesh.html">Mesh</a> mesh, std::string filename)</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;{</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; assert(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size() == mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.size() || mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.empty());</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; std::ofstream obj_file(filename);</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="keywordflow">if</span> (mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.empty()) {</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="keywordflow">for</span> (std::size_t i = 0; i &lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size(); ++i) {</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; obj_file &lt;&lt; <span class="stringliteral">&quot;v &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][0] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][1] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][2] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; }</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; }</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="keywordflow">else</span> {</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <span class="keywordflow">for</span> (std::size_t i = 0; i &lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size(); ++i) {</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; obj_file &lt;&lt; <span class="stringliteral">&quot;v &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][0] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][1] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][2] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>[i][0] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>[i][1] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>[i][2] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; }</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; }</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp;&amp; v : mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">tvi</a>) {</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="comment">// Add one because obj starts counting triangle indices at 1</span></div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; obj_file &lt;&lt; <span class="stringliteral">&quot;f &quot;</span> &lt;&lt; v[0] + 1 &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; v[1] + 1 &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; v[2] + 1 &lt;&lt; std::endl;</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; }</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="keywordflow">return</span>;</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;}</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;</div><div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="namespaceeos_1_1render.html#afd6561b065b9c0dd6815580ab12c3204"> 99</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespaceeos_1_1render.html#afd6561b065b9c0dd6815580ab12c3204">write_textured_obj</a>(<a class="code" href="structeos_1_1render_1_1_mesh.html">Mesh</a> mesh, std::string filename)</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;{</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; assert((mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size() == mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.size() || mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.empty()) &amp;&amp; !mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>.empty());</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; std::ofstream obj_file(filename);</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; boost::filesystem::path mtl_filename(filename);</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; mtl_filename.replace_extension(<span class="stringliteral">&quot;.mtl&quot;</span>);</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; obj_file &lt;&lt; <span class="stringliteral">&quot;mtllib &quot;</span> &lt;&lt; mtl_filename.filename().string() &lt;&lt; std::endl; <span class="comment">// first line of the obj file</span></div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="comment">// same as in write_obj():</span></div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keywordflow">if</span> (mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.empty()) {</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="keywordflow">for</span> (std::size_t i = 0; i &lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size(); ++i) {</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; obj_file &lt;&lt; <span class="stringliteral">&quot;v &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][0] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][1] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][2] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; }</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; }</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="keywordflow">else</span> {</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="keywordflow">for</span> (std::size_t i = 0; i &lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size(); ++i) {</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; obj_file &lt;&lt; <span class="stringliteral">&quot;v &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][0] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][1] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][2] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>[i][0] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>[i][1] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>[i][2] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; }</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; }</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <span class="comment">// end</span></div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <span class="keywordflow">for</span> (std::size_t i = 0; i &lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>.size(); ++i) {</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; obj_file &lt;&lt; <span class="stringliteral">&quot;vt &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[i][0] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; 1.0f - mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[i][1] &lt;&lt; std::endl;</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; <span class="comment">// We invert y because Meshlab&#39;s uv origin (0, 0) is on the bottom-left</span></div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; }</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; obj_file &lt;&lt; <span class="stringliteral">&quot;usemtl FaceTexture&quot;</span> &lt;&lt; std::endl; <span class="comment">// the name of our texture (material) will be &#39;FaceTexture&#39;</span></div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp;&amp; v : mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">tvi</a>) {</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="comment">// This assumes mesh.texcoords.size() == mesh.vertices.size(). The texture indices could theoretically be different (for example in the cube-mapped 3D scan)</span></div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="comment">// Add one because obj starts counting triangle indices at 1</span></div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; obj_file &lt;&lt; <span class="stringliteral">&quot;f &quot;</span> &lt;&lt; v[0] + 1 &lt;&lt; <span class="stringliteral">&quot;/&quot;</span> &lt;&lt; v[0] + 1 &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; v[1] + 1 &lt;&lt; <span class="stringliteral">&quot;/&quot;</span> &lt;&lt; v[1] + 1 &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; v[2] + 1 &lt;&lt; <span class="stringliteral">&quot;/&quot;</span> &lt;&lt; v[2] + 1 &lt;&lt; std::endl;</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; }</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; std::ofstream mtl_file(mtl_filename.string());</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; boost::filesystem::path texture_filename(filename);</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; texture_filename.replace_extension(<span class="stringliteral">&quot;.isomap.png&quot;</span>);</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; mtl_file &lt;&lt; <span class="stringliteral">&quot;newmtl FaceTexture&quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; mtl_file &lt;&lt; <span class="stringliteral">&quot;map_Kd &quot;</span> &lt;&lt; texture_filename.filename().string() &lt;&lt; std::endl;</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="keywordflow">return</span>;</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;};</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160;</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; } <span class="comment">/* namespace render */</span></div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;} <span class="comment">/* namespace eos */</span></div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* MESH_HPP_ */</span><span class="preprocessor"></span></div><div class="ttc" id="structeos_1_1render_1_1_mesh_html_a81c47a35a1b0a6a6cb440cfbb67b8c28"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#a81c47a35a1b0a6a6cb440cfbb67b8c28">eos::render::Mesh::tci</a></div><div class="ttdeci">std::vector&lt; std::array&lt; int, 3 &gt; &gt; tci</div><div class="ttdoc">Triangle color indices. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:52</div></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div> <div class="ttc" id="namespaceeos_1_1render_html_a097a630659b6c06a4596ca138f66ec94"><div class="ttname"><a href="namespaceeos_1_1render.html#a097a630659b6c06a4596ca138f66ec94">eos::render::render</a></div><div class="ttdeci">std::pair&lt; cv::Mat, cv::Mat &gt; render(Mesh mesh, cv::Mat model_view_matrix, cv::Mat projection_matrix, int viewport_width, int viewport_height, const boost::optional&lt; Texture &gt; &amp;texture=boost::none, bool enable_backface_culling=false, bool enable_near_clipping=true, bool enable_far_clipping=true)</div><div class="ttdef"><b>Definition:</b> render.hpp:125</div></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div> <div class="ttc" id="namespaceeos_1_1render_html_a9b4673997fae6d670d7a9cc23543e8d7"><div class="ttname"><a href="namespaceeos_1_1render.html#a9b4673997fae6d670d7a9cc23543e8d7">eos::render::write_obj</a></div><div class="ttdeci">void write_obj(Mesh mesh, std::string filename)</div><div class="ttdoc">Writes the given Mesh to an obj file that for example can be read by MeshLab. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:63</div></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/render/Mesh.hpp</span></div> <div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&amp;#39;s 3D model fitting functionality. </div></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html_a305d17e6453f6be320331e00e8c8816e"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">eos::render::Mesh::vertices</a></div><div class="ttdeci">std::vector&lt; cv::Vec4f &gt; vertices</div><div class="ttdoc">3D vertex positions. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:47</div></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2014, 2015 Patrik Huber</span></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html_ae3b0e946a77b4f434b382b315ea7c24b"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">eos::render::Mesh::colors</a></div><div class="ttdeci">std::vector&lt; cv::Vec3f &gt; colors</div><div class="ttdoc">Colour information for each vertex. Expected to be in RGB order. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:48</div></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html">eos::render::Mesh</a></div><div class="ttdoc">This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordin...</div><div class="ttdef"><b>Definition:</b> Mesh.hpp:45</div></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html_ab6fb80c460656bf7830a526f0692681b"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">eos::render::Mesh::tvi</a></div><div class="ttdeci">std::vector&lt; std::array&lt; int, 3 &gt; &gt; tvi</div><div class="ttdoc">Triangle vertex indices. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:51</div></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html_a64fddf0a7200e7f66b0426773542eea4"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">eos::render::Mesh::texcoords</a></div><div class="ttdeci">std::vector&lt; cv::Vec2f &gt; texcoords</div><div class="ttdoc">Texture coordinates for each vertex. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:49</div></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div> <div class="ttc" id="namespaceeos_1_1render_html_afd6561b065b9c0dd6815580ab12c3204"><div class="ttname"><a href="namespaceeos_1_1render.html#afd6561b065b9c0dd6815580ab12c3204">eos::render::write_textured_obj</a></div><div class="ttdeci">void write_textured_obj(Mesh mesh, std::string filename)</div><div class="ttdoc">Writes an obj file of the given Mesh, including texture coordinates, and an mtl file containing a ref...</div><div class="ttdef"><b>Definition:</b> Mesh.hpp:99</div></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef MESH_HPP_</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define MESH_HPP_</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#ifdef WIN32</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor"> #define BOOST_ALL_DYN_LINK // Link against the dynamic boost lib. Seems to be necessary because we use /MD, i.e. link to the dynamic CRT.</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor"> #define BOOST_ALL_NO_LIB // Don&#39;t use the automatic library linking by boost with VS2010 (#pragma ...). Instead, we specify everything in cmake.</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &quot;boost/filesystem/path.hpp&quot;</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor">#include &lt;array&gt;</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="preprocessor">#include &lt;cassert&gt;</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="preprocessor">#include &lt;fstream&gt;</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; <span class="keyword">namespace </span><a class="code" href="namespaceeos_1_1render.html#a7628a42875570658bea6ffb4f46723e5">render</a> {</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;</div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="structeos_1_1render_1_1_mesh.html"> 49</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structeos_1_1render_1_1_mesh.html">Mesh</a></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;{</div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e"> 51</a></span>&#160; std::vector&lt;cv::Vec4f&gt; <a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>; </div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b"> 52</a></span>&#160; std::vector&lt;cv::Vec3f&gt; <a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>; </div>
<div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4"> 53</a></span>&#160; std::vector&lt;cv::Vec2f&gt; <a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>; </div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;</div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b"> 55</a></span>&#160; std::vector&lt;std::array&lt;int, 3&gt;&gt; <a class="code" href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">tvi</a>; </div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="structeos_1_1render_1_1_mesh.html#a81c47a35a1b0a6a6cb440cfbb67b8c28"> 56</a></span>&#160; std::vector&lt;std::array&lt;int, 3&gt;&gt; <a class="code" href="structeos_1_1render_1_1_mesh.html#a81c47a35a1b0a6a6cb440cfbb67b8c28">tci</a>; </div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;};</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;</div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="namespaceeos_1_1render.html#a9b4673997fae6d670d7a9cc23543e8d7"> 67</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespaceeos_1_1render.html#a9b4673997fae6d670d7a9cc23543e8d7">write_obj</a>(<a class="code" href="structeos_1_1render_1_1_mesh.html">Mesh</a> mesh, std::string filename)</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;{</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; assert(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size() == mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.size() || mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.empty());</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; std::ofstream obj_file(filename);</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keywordflow">if</span> (mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.empty()) {</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="keywordflow">for</span> (std::size_t i = 0; i &lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size(); ++i) {</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; obj_file &lt;&lt; <span class="stringliteral">&quot;v &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][0] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][1] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][2] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; }</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; }</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keywordflow">for</span> (std::size_t i = 0; i &lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size(); ++i) {</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; obj_file &lt;&lt; <span class="stringliteral">&quot;v &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][0] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][1] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][2] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>[i][0] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>[i][1] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>[i][2] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; }</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; }</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp;&amp; v : mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">tvi</a>) {</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="comment">// Add one because obj starts counting triangle indices at 1</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; obj_file &lt;&lt; <span class="stringliteral">&quot;f &quot;</span> &lt;&lt; v[0] + 1 &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; v[1] + 1 &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; v[2] + 1 &lt;&lt; std::endl;</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; }</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;}</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160;</div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="namespaceeos_1_1render.html#afd6561b065b9c0dd6815580ab12c3204"> 103</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespaceeos_1_1render.html#afd6561b065b9c0dd6815580ab12c3204">write_textured_obj</a>(<a class="code" href="structeos_1_1render_1_1_mesh.html">Mesh</a> mesh, std::string filename)</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;{</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; assert((mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size() == mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.size() || mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.empty()) &amp;&amp; !mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>.empty());</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; std::ofstream obj_file(filename);</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160;</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; boost::filesystem::path mtl_filename(filename);</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; mtl_filename.replace_extension(<span class="stringliteral">&quot;.mtl&quot;</span>);</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; obj_file &lt;&lt; <span class="stringliteral">&quot;mtllib &quot;</span> &lt;&lt; mtl_filename.string() &lt;&lt; std::endl; <span class="comment">// first line of the obj file</span></div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <span class="comment">// same as in write_obj():</span></div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keywordflow">if</span> (mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.empty()) {</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="keywordflow">for</span> (std::size_t i = 0; i &lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size(); ++i) {</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; obj_file &lt;&lt; <span class="stringliteral">&quot;v &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][0] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][1] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][2] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; }</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; }</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <span class="keywordflow">for</span> (std::size_t i = 0; i &lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size(); ++i) {</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; obj_file &lt;&lt; <span class="stringliteral">&quot;v &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][0] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][1] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i][2] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>[i][0] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>[i][1] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>[i][2] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; }</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; }</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; <span class="comment">// end</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <span class="keywordflow">for</span> (std::size_t i = 0; i &lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>.size(); ++i) {</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; obj_file &lt;&lt; <span class="stringliteral">&quot;vt &quot;</span> &lt;&lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[i][0] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; 1.0f - mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[i][1] &lt;&lt; std::endl;</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <span class="comment">// We invert y because Meshlab&#39;s uv origin (0, 0) is on the bottom-left</span></div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; }</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; obj_file &lt;&lt; <span class="stringliteral">&quot;usemtl FaceTexture&quot;</span> &lt;&lt; std::endl; <span class="comment">// the name of our texture (material) will be &#39;FaceTexture&#39;</span></div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp;&amp; v : mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">tvi</a>) {</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="comment">// This assumes mesh.texcoords.size() == mesh.vertices.size(). The texture indices could theoretically be different (for example in the cube-mapped 3D scan)</span></div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <span class="comment">// Add one because obj starts counting triangle indices at 1</span></div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; obj_file &lt;&lt; <span class="stringliteral">&quot;f &quot;</span> &lt;&lt; v[0] + 1 &lt;&lt; <span class="stringliteral">&quot;/&quot;</span> &lt;&lt; v[0] + 1 &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; v[1] + 1 &lt;&lt; <span class="stringliteral">&quot;/&quot;</span> &lt;&lt; v[1] + 1 &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; v[2] + 1 &lt;&lt; <span class="stringliteral">&quot;/&quot;</span> &lt;&lt; v[2] + 1 &lt;&lt; std::endl;</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; }</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; std::ofstream mtl_file(mtl_filename.string());</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; boost::filesystem::path texture_filename(filename);</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; texture_filename.replace_extension(<span class="stringliteral">&quot;.isomap.png&quot;</span>);</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; mtl_file &lt;&lt; <span class="stringliteral">&quot;newmtl FaceTexture&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; mtl_file &lt;&lt; <span class="stringliteral">&quot;map_Kd &quot;</span> &lt;&lt; texture_filename.string() &lt;&lt; std::endl;</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;};</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; } <span class="comment">/* namespace render */</span></div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;} <span class="comment">/* namespace eos */</span></div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160;</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* MESH_HPP_ */</span><span class="preprocessor"></span></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html_a81c47a35a1b0a6a6cb440cfbb67b8c28"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#a81c47a35a1b0a6a6cb440cfbb67b8c28">eos::render::Mesh::tci</a></div><div class="ttdeci">std::vector&lt; std::array&lt; int, 3 &gt; &gt; tci</div><div class="ttdoc">Triangle color indices. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:56</div></div>
<div class="ttc" id="namespaceeos_1_1render_html_a9b4673997fae6d670d7a9cc23543e8d7"><div class="ttname"><a href="namespaceeos_1_1render.html#a9b4673997fae6d670d7a9cc23543e8d7">eos::render::write_obj</a></div><div class="ttdeci">void write_obj(Mesh mesh, std::string filename)</div><div class="ttdoc">Writes the given Mesh to an obj file that for example can be read by Meshlab. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:67</div></div>
<div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&#39;s 3D model fitting functionality. </div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html_a305d17e6453f6be320331e00e8c8816e"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">eos::render::Mesh::vertices</a></div><div class="ttdeci">std::vector&lt; cv::Vec4f &gt; vertices</div><div class="ttdoc">3D vertex positions. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:51</div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html_ae3b0e946a77b4f434b382b315ea7c24b"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">eos::render::Mesh::colors</a></div><div class="ttdeci">std::vector&lt; cv::Vec3f &gt; colors</div><div class="ttdoc">Colour information for each vertex. Expected to be in RGB order. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:52</div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html">eos::render::Mesh</a></div><div class="ttdoc">This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordin...</div><div class="ttdef"><b>Definition:</b> Mesh.hpp:49</div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html_ab6fb80c460656bf7830a526f0692681b"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">eos::render::Mesh::tvi</a></div><div class="ttdeci">std::vector&lt; std::array&lt; int, 3 &gt; &gt; tvi</div><div class="ttdoc">Triangle vertex indices. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:55</div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html_a64fddf0a7200e7f66b0426773542eea4"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">eos::render::Mesh::texcoords</a></div><div class="ttdeci">std::vector&lt; cv::Vec2f &gt; texcoords</div><div class="ttdoc">Texture coordinates for each vertex. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:53</div></div>
<div class="ttc" id="namespaceeos_1_1render_html_afd6561b065b9c0dd6815580ab12c3204"><div class="ttname"><a href="namespaceeos_1_1render.html#afd6561b065b9c0dd6815580ab12c3204">eos::render::write_textured_obj</a></div><div class="ttdeci">void write_textured_obj(Mesh mesh, std::string filename)</div><div class="ttdoc">Writes an obj file of the given Mesh, including texture coordinates, and an mtl file containing a ref...</div><div class="ttdef"><b>Definition:</b> Mesh.hpp:103</div></div>
<div class="ttc" id="namespaceeos_1_1render_html_a7628a42875570658bea6ffb4f46723e5"><div class="ttname"><a href="namespaceeos_1_1render.html#a7628a42875570658bea6ffb4f46723e5">eos::render::render</a></div><div class="ttdeci">std::pair&lt; cv::Mat, cv::Mat &gt; render(Mesh mesh, cv::Mat model_view_matrix, cv::Mat projection_matrix, int viewport_width, int viewport_height, const Texture &amp;texture, bool enable_backface_culling=false, bool enable_near_clipping=true, bool enable_far_clipping=true)</div><div class="ttdef"><b>Definition:</b> render.hpp:129</div></div>
</div><!-- fragment --></div><!-- contents --> </div><!-- fragment --></div><!-- contents -->
<!-- start footer part --> <!-- start footer part -->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/morphablemodel/MorphableModel.hpp Source File</title> <title>eos: include/eos/morphablemodel/MorphableModel.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div id="nav-path" class="navpath"> <div id="nav-path" class="navpath">
<ul> <ul>
<li class="navelem"><a class="el" href="dir_ce53d3124a8ddb93985ce6ec479297f4.html">include</a></li><li class="navelem"><a class="el" href="dir_c7ebde285fcef06dba0b090642612638.html">eos</a></li><li class="navelem"><a class="el" href="dir_a487f496b1daaab0ce4d44d536b7440b.html">morphablemodel</a></li> </ul> <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_8c2f38a39d6204ca353f500c7575d762.html">morphablemodel</a></li> </ul>
</div> </div>
</div><!-- top --> </div><!-- top -->
<div class="header"> <div class="header">
...@@ -95,250 +95,27 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -95,250 +95,27 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="title">MorphableModel.hpp</div> </div> <div class="title">MorphableModel.hpp</div> </div>
</div><!--header--> </div><!--header-->
<div class="contents"> <div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div> <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/morphablemodel/MorphableModel.hpp</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2014, 2015 Patrik Huber</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef MORPHABLEMODEL_HPP_</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define MORPHABLEMODEL_HPP_</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;eos/morphablemodel/PcaModel.hpp&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;eos/render/Mesh.hpp&quot;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &quot;eos/morphablemodel/io/mat_cerealisation.hpp&quot;</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &quot;cereal/cereal.hpp&quot;</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &quot;cereal/access.hpp&quot;</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#include &quot;cereal/types/vector.hpp&quot;</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="preprocessor">#include &quot;cereal/archives/binary.hpp&quot;</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="preprocessor">#include &lt;array&gt;</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="preprocessor">#include &lt;cstdint&gt;</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="comment">// Forward declaration of an internal function</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> { <span class="keyword">namespace </span>morphablemodel { <span class="keyword">namespace </span>detail {</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <a class="code" href="structeos_1_1render_1_1_mesh.html">eos::render::Mesh</a> sample_to_mesh(cv::Mat shape, cv::Mat color, std::vector&lt;std::array&lt;int, 3&gt;&gt; tvi, std::vector&lt;std::array&lt;int, 3&gt;&gt; tci, std::vector&lt;cv::Vec2f&gt; texture_coordinates = std::vector&lt;cv::Vec2f&gt;());</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;} } }</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; <span class="keyword">namespace </span>morphablemodel {</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;</div><div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_morphable_model.html"> 54</a></span>&#160;<span class="keyword">class </span><a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html">MorphableModel</a></div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;{</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html">MorphableModel</a>() = <span class="keywordflow">default</span>;</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;</div><div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a438898cd4578c1998e452de7d521f8cc"> 67</a></span>&#160; <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a438898cd4578c1998e452de7d521f8cc">MorphableModel</a>(<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html">PcaModel</a> shape_model, <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html">PcaModel</a> color_model, std::vector&lt;cv::Vec2f&gt; texture_coordinates = std::vector&lt;cv::Vec2f&gt;()) : shape_model(shape_model), color_model(color_model), texture_coordinates(texture_coordinates)</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; {</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; };</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;</div><div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11"> 77</a></span>&#160; <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html">PcaModel</a> <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11">get_shape_model</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keywordflow">return</span> shape_model;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; };</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; </div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a1fff16d5d749831fa90049199101298c"> 87</a></span>&#160; <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html">PcaModel</a> <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a1fff16d5d749831fa90049199101298c">get_color_model</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="keywordflow">return</span> color_model;</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; };</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160;</div><div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a43dcaaff84e217ea9643e37705136f31"> 97</a></span>&#160; <a class="code" href="structeos_1_1render_1_1_mesh.html">render::Mesh</a> <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a43dcaaff84e217ea9643e37705136f31">get_mean</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; assert(shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">get_data_dimension</a>() == color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">get_data_dimension</a>() || !has_color_model()); <span class="comment">// The number of vertices (= model.getDataDimension() / 3) has to be equal for both models, or, alternatively, it has to be a shape-only model.</span></div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; cv::Mat shape = shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495">get_mean</a>();</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; cv::Mat color = color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495">get_mean</a>();</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <a class="code" href="structeos_1_1render_1_1_mesh.html">render::Mesh</a> mesh;</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <span class="keywordflow">if</span> (has_texture_coordinates()) {</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; mesh = detail::sample_to_mesh(shape, color, shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>(), color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>(), texture_coordinates);</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; }</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="keywordflow">else</span> {</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; mesh = detail::sample_to_mesh(shape, color, shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>(), color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>());</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; }</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keywordflow">return</span> mesh;</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; };</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;</div><div class="line"><a name="l00123"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a5fd1b15edc89e89808339859570a4c09"> 123</a></span>&#160; <a class="code" href="structeos_1_1render_1_1_mesh.html">render::Mesh</a> <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a5fd1b15edc89e89808339859570a4c09">draw_sample</a>(<span class="keywordtype">float</span> shape_sigma = 1.0f, <span class="keywordtype">float</span> color_sigma = 1.0f)</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; {</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; assert(shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">get_data_dimension</a>() == color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">get_data_dimension</a>()); <span class="comment">// The number of vertices (= model.getDataDimension() / 3) has to be equal for both models.</span></div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; cv::Mat shapeSample = shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">draw_sample</a>(shape_sigma);</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; cv::Mat colorSample = color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">draw_sample</a>(color_sigma);</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <a class="code" href="structeos_1_1render_1_1_mesh.html">render::Mesh</a> mesh;</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="keywordflow">if</span> (has_texture_coordinates()) {</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; mesh = detail::sample_to_mesh(shapeSample, colorSample, shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>(), color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>(), texture_coordinates);</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; }</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <span class="keywordflow">else</span> {</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; mesh = detail::sample_to_mesh(shapeSample, colorSample, shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>(), color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>());</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; }</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <span class="keywordflow">return</span> mesh;</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; };</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;</div><div class="line"><a name="l00154"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a92ab3e9941de492954a1c603cf3e11c9"> 154</a></span>&#160; <a class="code" href="structeos_1_1render_1_1_mesh.html">render::Mesh</a> <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a92ab3e9941de492954a1c603cf3e11c9">draw_sample</a>(std::vector&lt;float&gt; shape_coefficients, std::vector&lt;float&gt; color_coefficients)<span class="keyword"> const</span></div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; assert(shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">get_data_dimension</a>() == color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">get_data_dimension</a>() || !has_color_model()); <span class="comment">// The number of vertices (= model.getDataDimension() / 3) has to be equal for both models, or, alternatively, it has to be a shape-only model.</span></div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; cv::Mat shape_sample;</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; cv::Mat color_sample;</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <span class="keywordflow">if</span> (shape_coefficients.empty()) {</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; shape_sample = shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495">get_mean</a>();</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; }</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <span class="keywordflow">else</span> {</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; shape_sample = shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">draw_sample</a>(shape_coefficients);</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; }</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <span class="keywordflow">if</span> (color_coefficients.empty()) {</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; color_sample = color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495">get_mean</a>();</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; }</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <span class="keywordflow">else</span> {</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; color_sample = color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">draw_sample</a>(color_coefficients);</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; }</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160;</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <a class="code" href="structeos_1_1render_1_1_mesh.html">render::Mesh</a> mesh;</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="keywordflow">if</span> (has_texture_coordinates()) {</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; mesh = detail::sample_to_mesh(shape_sample, color_sample, shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>(), color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>(), texture_coordinates);</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; }</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; <span class="keywordflow">else</span> {</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; mesh = detail::sample_to_mesh(shape_sample, color_sample, shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>(), color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>());</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; }</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="keywordflow">return</span> mesh;</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; };</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160;</div><div class="line"><a name="l00190"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a253ca65b7f6c6cb48d4abd7b9a7f9a83"> 190</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a253ca65b7f6c6cb48d4abd7b9a7f9a83">has_color_model</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <span class="keywordflow">return</span> !color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495">get_mean</a>().empty();</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; };</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160;</div><div class="line"><a name="l00200"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_morphable_model.html#aeffacfcafaf7dff6e21b047a2a6d22ae"> 200</a></span>&#160; std::vector&lt;cv::Vec2f&gt; <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#aeffacfcafaf7dff6e21b047a2a6d22ae">get_texture_coordinates</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <span class="keywordflow">return</span> texture_coordinates;</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; };</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160;</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html">PcaModel</a> shape_model; </div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html">PcaModel</a> color_model; </div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; std::vector&lt;cv::Vec2f&gt; texture_coordinates; </div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160;</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; <span class="keywordtype">bool</span> has_texture_coordinates()<span class="keyword"> const </span>{</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; <span class="keywordflow">return</span> texture_coordinates.size() &gt; 0 ? <span class="keyword">true</span> : <span class="keyword">false</span>;</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; };</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160;</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span>cereal::access;</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">class</span> Archive&gt;</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; <span class="keywordtype">void</span> serialize(Archive&amp; archive, <span class="keyword">const</span> std::uint32_t version)</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; {</div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; archive(shape_model, color_model, texture_coordinates);</div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; };</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160;};</div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160;</div><div class="line"><a name="l00241"></a><span class="lineno"><a class="line" href="namespaceeos_1_1morphablemodel.html#a0da6e35ec49f1ebdf55f9596540cf8f8"> 241</a></span>&#160;<a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html">MorphableModel</a> <a class="code" href="namespaceeos_1_1morphablemodel.html#a0da6e35ec49f1ebdf55f9596540cf8f8">load_model</a>(std::string filename)</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160;{</div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html">MorphableModel</a> model;</div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160;</div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; std::ifstream file(filename, std::ios::binary);</div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; <span class="keywordflow">if</span> (file.fail()) {</div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">&quot;Error opening given file: &quot;</span> + filename);</div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; }</div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; cereal::BinaryInputArchive input_archive(file);</div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; input_archive(model);</div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160;</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; <span class="keywordflow">return</span> model;</div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160;};</div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160;</div><div class="line"><a name="l00262"></a><span class="lineno"><a class="line" href="namespaceeos_1_1morphablemodel.html#aad09e0fd0788cb7fea41ed799c653e71"> 262</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespaceeos_1_1morphablemodel.html#aad09e0fd0788cb7fea41ed799c653e71">save_model</a>(<a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html">MorphableModel</a> model, std::string filename)</div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160;{</div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160; std::ofstream file(filename, std::ios::binary);</div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; cereal::BinaryOutputArchive output_archive(file);</div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160; output_archive(model);</div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160;};</div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160;</div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160;</div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160;<span class="keyword">namespace </span>detail { <span class="comment">/* eos::morphablemodel::detail */</span></div><div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160;<a class="code" href="structeos_1_1render_1_1_mesh.html">eos::render::Mesh</a> sample_to_mesh(cv::Mat shape, cv::Mat color, std::vector&lt;std::array&lt;int, 3&gt;&gt; tvi, std::vector&lt;std::array&lt;int, 3&gt;&gt; tci, std::vector&lt;cv::Vec2f&gt; texture_coordinates <span class="comment">/* = std::vector&lt;cv::Vec2f&gt;() */</span>)</div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160;{</div><div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160; assert(shape.rows == color.rows || color.empty()); <span class="comment">// The number of vertices (= model.getDataDimension() / 3) has to be equal for both models, or, alternatively, it has to be a shape-only model.</span></div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160;</div><div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160; <span class="keyword">auto</span> num_vertices = shape.rows / 3;</div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160;</div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; <a class="code" href="structeos_1_1render_1_1_mesh.html">eos::render::Mesh</a> mesh;</div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160;</div><div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; <span class="comment">// Construct the mesh vertices:</span></div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.resize(num_vertices);</div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span> i = 0; i &lt; num_vertices; ++i) {</div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i] = cv::Vec4f(shape.at&lt;<span class="keywordtype">float</span>&gt;(i * 3 + 0), shape.at&lt;<span class="keywordtype">float</span>&gt;(i * 3 + 1), shape.at&lt;<span class="keywordtype">float</span>&gt;(i * 3 + 2), 1.0f);</div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160; }</div><div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160;</div><div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160; <span class="comment">// Assign the vertex color information if it&#39;s not a shape-only model:</span></div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160; <span class="keywordflow">if</span> (!color.empty()) {</div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.resize(num_vertices);</div><div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span> i = 0; i &lt; num_vertices; ++i) {</div><div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>[i] = cv::Vec3f(color.at&lt;<span class="keywordtype">float</span>&gt;(i * 3 + 0), color.at&lt;<span class="keywordtype">float</span>&gt;(i * 3 + 1), color.at&lt;<span class="keywordtype">float</span>&gt;(i * 3 + 2)); <span class="comment">// order in hdf5: RGB. Order in OCV: BGR. But order in vertex.color: RGB</span></div><div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160; }</div><div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160; }</div><div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160;</div><div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160; <span class="comment">// Assign the triangle lists:</span></div><div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">tvi</a> = tvi;</div><div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a81c47a35a1b0a6a6cb440cfbb67b8c28">tci</a> = tci; <span class="comment">// tci will be empty in case of a shape-only model</span></div><div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160;</div><div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160; <span class="comment">// Texture coordinates, if the model has them:</span></div><div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160; <span class="keywordflow">if</span> (!texture_coordinates.empty()) {</div><div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>.resize(num_vertices);</div><div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span> i = 0; i &lt; num_vertices; ++i) {</div><div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[i] = texture_coordinates[i];</div><div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160; }</div><div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160; }</div><div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160;</div><div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160; <span class="keywordflow">return</span> mesh;</div><div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160;};</div><div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160;} <span class="comment">/* namespace eos::morphablemodel::detail */</span></div><div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160;</div><div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160; } <span class="comment">/* namespace morphablemodel */</span></div><div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160;} <span class="comment">/* namespace eos */</span></div><div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160;</div><div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160;CEREAL_CLASS_VERSION(<a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a>, 0);</div><div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160;</div><div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* MORPHABLEMODEL_HPP_ */</span><span class="preprocessor"></span></div><div class="ttc" id="structeos_1_1render_1_1_mesh_html_a81c47a35a1b0a6a6cb440cfbb67b8c28"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#a81c47a35a1b0a6a6cb440cfbb67b8c28">eos::render::Mesh::tci</a></div><div class="ttdeci">std::vector&lt; std::array&lt; int, 3 &gt; &gt; tci</div><div class="ttdoc">Triangle color indices. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:52</div></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html">eos::morphablemodel::PcaModel</a></div><div class="ttdoc">This class represents a PCA-model that consists of: </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:55</div></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/morphablemodel/MorphableModel.hpp</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2014, 2015 Patrik Huber</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef MORPHABLEMODEL_HPP_</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define MORPHABLEMODEL_HPP_</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;eos/morphablemodel/PcaModel.hpp&quot;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;eos/render/Mesh.hpp&quot;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &quot;eos/morphablemodel/io/mat_cerealisation.hpp&quot;</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &quot;cereal/cereal.hpp&quot;</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &quot;cereal/access.hpp&quot;</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#include &quot;cereal/types/vector.hpp&quot;</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="preprocessor">#include &quot;cereal/archives/binary.hpp&quot;</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="preprocessor">#include &lt;array&gt;</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="preprocessor">#include &lt;cstdint&gt;</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="comment">// Forward declaration of an internal function</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> { <span class="keyword">namespace </span>morphablemodel { <span class="keyword">namespace </span>detail {</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <a class="code" href="structeos_1_1render_1_1_mesh.html">eos::render::Mesh</a> sample_to_mesh(cv::Mat shape, cv::Mat color, std::vector&lt;std::array&lt;int, 3&gt;&gt; tvi, std::vector&lt;std::array&lt;int, 3&gt;&gt; tci, std::vector&lt;cv::Vec2f&gt; texture_coordinates = std::vector&lt;cv::Vec2f&gt;());</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;} } }</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; <span class="keyword">namespace </span>morphablemodel {</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;</div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_morphable_model.html"> 54</a></span>&#160;<span class="keyword">class </span><a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html">MorphableModel</a></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;{</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html">MorphableModel</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;</div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a438898cd4578c1998e452de7d521f8cc"> 67</a></span>&#160; <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a438898cd4578c1998e452de7d521f8cc">MorphableModel</a>(<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html">PcaModel</a> shape_model, <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html">PcaModel</a> color_model, std::vector&lt;cv::Vec2f&gt; texture_coordinates = std::vector&lt;cv::Vec2f&gt;()) : shape_model(shape_model), color_model(color_model), texture_coordinates(texture_coordinates)</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; {</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; };</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;</div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11"> 77</a></span>&#160; <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html">PcaModel</a> <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11">get_shape_model</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;<span class="keyword"> </span>{</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keywordflow">return</span> shape_model;</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; };</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; </div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a1fff16d5d749831fa90049199101298c"> 87</a></span>&#160; <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html">PcaModel</a> <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a1fff16d5d749831fa90049199101298c">get_color_model</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;<span class="keyword"> </span>{</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="keywordflow">return</span> color_model;</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; };</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160;</div>
<div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a43dcaaff84e217ea9643e37705136f31"> 97</a></span>&#160; <a class="code" href="structeos_1_1render_1_1_mesh.html">render::Mesh</a> <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a43dcaaff84e217ea9643e37705136f31">get_mean</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;<span class="keyword"> </span>{</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; assert(shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">get_data_dimension</a>() == color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">get_data_dimension</a>() || !<a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a253ca65b7f6c6cb48d4abd7b9a7f9a83">has_color_model</a>()); <span class="comment">// The number of vertices (= model.getDataDimension() / 3) has to be equal for both models, or, alternatively, it has to be a shape-only model.</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; cv::Mat shape = shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495">get_mean</a>();</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; cv::Mat color = color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495">get_mean</a>();</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <a class="code" href="structeos_1_1render_1_1_mesh.html">render::Mesh</a> mesh;</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <span class="keywordflow">if</span> (has_texture_coordinates()) {</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; mesh = detail::sample_to_mesh(shape, color, shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>(), color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>(), texture_coordinates);</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; }</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; mesh = detail::sample_to_mesh(shape, color, shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>(), color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>());</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; }</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keywordflow">return</span> mesh;</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; };</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;</div>
<div class="line"><a name="l00123"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a5fd1b15edc89e89808339859570a4c09"> 123</a></span>&#160; <a class="code" href="structeos_1_1render_1_1_mesh.html">render::Mesh</a> <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a5fd1b15edc89e89808339859570a4c09">draw_sample</a>(<span class="keywordtype">float</span> shape_sigma = 1.0f, <span class="keywordtype">float</span> color_sigma = 1.0f)</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; {</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; assert(shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">get_data_dimension</a>() == color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">get_data_dimension</a>()); <span class="comment">// The number of vertices (= model.getDataDimension() / 3) has to be equal for both models.</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; cv::Mat shapeSample = shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">draw_sample</a>(shape_sigma);</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; cv::Mat colorSample = color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">draw_sample</a>(color_sigma);</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <a class="code" href="structeos_1_1render_1_1_mesh.html">render::Mesh</a> mesh;</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="keywordflow">if</span> (has_texture_coordinates()) {</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; mesh = detail::sample_to_mesh(shapeSample, colorSample, shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>(), color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>(), texture_coordinates);</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; }</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; mesh = detail::sample_to_mesh(shapeSample, colorSample, shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>(), color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>());</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; }</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <span class="keywordflow">return</span> mesh;</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; };</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;</div>
<div class="line"><a name="l00153"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a14787e8e29f390277b10f2d0e19aa587"> 153</a></span>&#160; <a class="code" href="structeos_1_1render_1_1_mesh.html">render::Mesh</a> <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a14787e8e29f390277b10f2d0e19aa587">draw_sample</a>(std::vector&lt;float&gt; shape_coefficients, std::vector&lt;float&gt; color_coefficients)</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; {</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; assert(shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">get_data_dimension</a>() == color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">get_data_dimension</a>() || !<a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a253ca65b7f6c6cb48d4abd7b9a7f9a83">has_color_model</a>()); <span class="comment">// The number of vertices (= model.getDataDimension() / 3) has to be equal for both models, or, alternatively, it has to be a shape-only model.</span></div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160;</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; cv::Mat shape_sample;</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; cv::Mat color_sample;</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <span class="keywordflow">if</span> (shape_coefficients.empty()) {</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; shape_sample = shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495">get_mean</a>();</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; }</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; shape_sample = shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">draw_sample</a>(shape_coefficients);</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; }</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; <span class="keywordflow">if</span> (color_coefficients.empty()) {</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; color_sample = color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495">get_mean</a>();</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; }</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; color_sample = color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">draw_sample</a>(color_coefficients);</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; }</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160;</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <a class="code" href="structeos_1_1render_1_1_mesh.html">render::Mesh</a> mesh;</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <span class="keywordflow">if</span> (has_texture_coordinates()) {</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; mesh = detail::sample_to_mesh(shape_sample, color_sample, shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>(), color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>(), texture_coordinates);</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; }</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; mesh = detail::sample_to_mesh(shape_sample, color_sample, shape_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>(), color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>());</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; }</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <span class="keywordflow">return</span> mesh;</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; };</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;</div>
<div class="line"><a name="l00189"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a253ca65b7f6c6cb48d4abd7b9a7f9a83"> 189</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a253ca65b7f6c6cb48d4abd7b9a7f9a83">has_color_model</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160;<span class="keyword"> </span>{</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <span class="keywordflow">return</span> !color_model.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495">get_mean</a>().empty();</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; };</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160;</div>
<div class="line"><a name="l00199"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_morphable_model.html#aeffacfcafaf7dff6e21b047a2a6d22ae"> 199</a></span>&#160; std::vector&lt;cv::Vec2f&gt; <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#aeffacfcafaf7dff6e21b047a2a6d22ae">get_texture_coordinates</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160;<span class="keyword"> </span>{</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; <span class="keywordflow">return</span> texture_coordinates;</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; };</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160;</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html">PcaModel</a> shape_model; </div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html">PcaModel</a> color_model; </div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; std::vector&lt;cv::Vec2f&gt; texture_coordinates; </div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160;</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; <span class="keywordtype">bool</span> has_texture_coordinates()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; <span class="keywordflow">return</span> texture_coordinates.size() &gt; 0 ? <span class="keyword">true</span> : <span class="keyword">false</span>;</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; };</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160;</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span>cereal::access;</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">class</span> Archive&gt;</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; <span class="keywordtype">void</span> serialize(Archive&amp; archive, <span class="keyword">const</span> std::uint32_t version)</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; {</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; archive(shape_model, color_model, texture_coordinates);</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; };</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160;};</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160;</div>
<div class="line"><a name="l00240"></a><span class="lineno"><a class="line" href="namespaceeos_1_1morphablemodel.html#a0da6e35ec49f1ebdf55f9596540cf8f8"> 240</a></span>&#160;<a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html">MorphableModel</a> <a class="code" href="namespaceeos_1_1morphablemodel.html#a0da6e35ec49f1ebdf55f9596540cf8f8">load_model</a>(std::string filename)</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160;{</div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html">MorphableModel</a> model;</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160;</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; std::ifstream file(filename, std::ios::binary);</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; <span class="keywordflow">if</span> (file.fail()) {</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">&quot;Error opening given file: &quot;</span> + filename);</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; }</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; cereal::BinaryInputArchive input_archive(file);</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; input_archive(model);</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160;</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; <span class="keywordflow">return</span> model;</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160;};</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160;</div>
<div class="line"><a name="l00261"></a><span class="lineno"><a class="line" href="namespaceeos_1_1morphablemodel.html#aad09e0fd0788cb7fea41ed799c653e71"> 261</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespaceeos_1_1morphablemodel.html#aad09e0fd0788cb7fea41ed799c653e71">save_model</a>(<a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html">MorphableModel</a> model, std::string filename)</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160;{</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; std::ofstream file(filename, std::ios::binary);</div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160; cereal::BinaryOutputArchive output_archive(file);</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; output_archive(model);</div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160;};</div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160;</div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160;</div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160;<span class="keyword">namespace </span>detail { <span class="comment">/* eos::morphablemodel::detail */</span></div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160;<a class="code" href="structeos_1_1render_1_1_mesh.html">eos::render::Mesh</a> sample_to_mesh(cv::Mat shape, cv::Mat color, std::vector&lt;std::array&lt;int, 3&gt;&gt; tvi, std::vector&lt;std::array&lt;int, 3&gt;&gt; tci, std::vector&lt;cv::Vec2f&gt; texture_coordinates <span class="comment">/* = std::vector&lt;cv::Vec2f&gt;() */</span>)</div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160;{</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; assert(shape.rows == color.rows || color.empty()); <span class="comment">// The number of vertices (= model.getDataDimension() / 3) has to be equal for both models, or, alternatively, it has to be a shape-only model.</span></div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160;</div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; <span class="keyword">auto</span> num_vertices = shape.rows / 3;</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160;</div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160; <a class="code" href="structeos_1_1render_1_1_mesh.html">eos::render::Mesh</a> mesh;</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160;</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; <span class="comment">// Construct the mesh vertices:</span></div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.resize(num_vertices);</div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span> i = 0; i &lt; num_vertices; ++i) {</div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i] = cv::Vec4f(shape.at&lt;<span class="keywordtype">float</span>&gt;(i * 3 + 0), shape.at&lt;<span class="keywordtype">float</span>&gt;(i * 3 + 1), shape.at&lt;<span class="keywordtype">float</span>&gt;(i * 3 + 2), 1.0f);</div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160; }</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160;</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; <span class="comment">// Assign the vertex color information if it&#39;s not a shape-only model:</span></div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160; <span class="keywordflow">if</span> (!color.empty()) {</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.resize(num_vertices);</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span> i = 0; i &lt; num_vertices; ++i) {</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>[i] = cv::Vec3f(color.at&lt;<span class="keywordtype">float</span>&gt;(i * 3 + 0), color.at&lt;<span class="keywordtype">float</span>&gt;(i * 3 + 1), color.at&lt;<span class="keywordtype">float</span>&gt;(i * 3 + 2)); <span class="comment">// order in hdf5: RGB. Order in OCV: BGR. But order in vertex.color: RGB</span></div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160; }</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160; }</div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160;</div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160; <span class="comment">// Assign the triangle lists:</span></div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">tvi</a> = tvi;</div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a81c47a35a1b0a6a6cb440cfbb67b8c28">tci</a> = tci; <span class="comment">// tci will be empty in case of a shape-only model</span></div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160;</div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160; <span class="comment">// Texture coordinates, if the model has them:</span></div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160; <span class="keywordflow">if</span> (!texture_coordinates.empty()) {</div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>.resize(num_vertices);</div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span> i = 0; i &lt; num_vertices; ++i) {</div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[i] = texture_coordinates[i];</div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160; }</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160; }</div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160;</div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160; <span class="keywordflow">return</span> mesh;</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160;};</div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160;} <span class="comment">/* namespace eos::morphablemodel::detail */</span></div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160;</div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160; } <span class="comment">/* namespace morphablemodel */</span></div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160;} <span class="comment">/* namespace eos */</span></div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160;</div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160;CEREAL_CLASS_VERSION(<a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a>, 0);</div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160;</div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* MORPHABLEMODEL_HPP_ */</span><span class="preprocessor"></span></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html_a81c47a35a1b0a6a6cb440cfbb67b8c28"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#a81c47a35a1b0a6a6cb440cfbb67b8c28">eos::render::Mesh::tci</a></div><div class="ttdeci">std::vector&lt; std::array&lt; int, 3 &gt; &gt; tci</div><div class="ttdoc">Triangle color indices. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:56</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html">eos::morphablemodel::PcaModel</a></div><div class="ttdoc">This class represents a PCA-model that consists of: </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:54</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html_a1fff16d5d749831fa90049199101298c"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html#a1fff16d5d749831fa90049199101298c">eos::morphablemodel::MorphableModel::get_color_model</a></div><div class="ttdeci">PcaModel get_color_model() const </div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:87</div></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html_a1fff16d5d749831fa90049199101298c"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html#a1fff16d5d749831fa90049199101298c">eos::morphablemodel::MorphableModel::get_color_model</a></div><div class="ttdeci">PcaModel get_color_model() const </div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:87</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html_a43dcaaff84e217ea9643e37705136f31"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html#a43dcaaff84e217ea9643e37705136f31">eos::morphablemodel::MorphableModel::get_mean</a></div><div class="ttdeci">render::Mesh get_mean() const </div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:97</div></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html_a43dcaaff84e217ea9643e37705136f31"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html#a43dcaaff84e217ea9643e37705136f31">eos::morphablemodel::MorphableModel::get_mean</a></div><div class="ttdeci">render::Mesh get_mean() const </div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:97</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_a8dfc5fa04f9853f2e06b971b90415538"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">eos::morphablemodel::PcaModel::draw_sample</a></div><div class="ttdeci">cv::Mat draw_sample(float sigma=1.0f)</div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:145</div></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_a8dfc5fa04f9853f2e06b971b90415538"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">eos::morphablemodel::PcaModel::draw_sample</a></div><div class="ttdeci">cv::Mat draw_sample(float sigma=1.0f)</div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:143</div></div>
<div class="ttc" id="namespaceeos_1_1morphablemodel_html_aad09e0fd0788cb7fea41ed799c653e71"><div class="ttname"><a href="namespaceeos_1_1morphablemodel.html#aad09e0fd0788cb7fea41ed799c653e71">eos::morphablemodel::save_model</a></div><div class="ttdeci">void save_model(MorphableModel model, std::string filename)</div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:261</div></div> <div class="ttc" id="namespaceeos_1_1morphablemodel_html_aad09e0fd0788cb7fea41ed799c653e71"><div class="ttname"><a href="namespaceeos_1_1morphablemodel.html#aad09e0fd0788cb7fea41ed799c653e71">eos::morphablemodel::save_model</a></div><div class="ttdeci">void save_model(MorphableModel model, std::string filename)</div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:262</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html_a14787e8e29f390277b10f2d0e19aa587"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html#a14787e8e29f390277b10f2d0e19aa587">eos::morphablemodel::MorphableModel::draw_sample</a></div><div class="ttdeci">render::Mesh draw_sample(std::vector&lt; float &gt; shape_coefficients, std::vector&lt; float &gt; color_coefficients)</div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:153</div></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_acdf68d929079eab57ab4990c468a9e0d"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">eos::morphablemodel::PcaModel::get_data_dimension</a></div><div class="ttdeci">int get_data_dimension() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:98</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_acdf68d929079eab57ab4990c468a9e0d"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">eos::morphablemodel::PcaModel::get_data_dimension</a></div><div class="ttdeci">int get_data_dimension() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:97</div></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_aab14825974f9512ba3b7b88afd2521b3"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">eos::morphablemodel::PcaModel::get_triangle_list</a></div><div class="ttdeci">std::vector&lt; std::array&lt; int, 3 &gt; &gt; get_triangle_list() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:109</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_aab14825974f9512ba3b7b88afd2521b3"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">eos::morphablemodel::PcaModel::get_triangle_list</a></div><div class="ttdeci">std::vector&lt; std::array&lt; int, 3 &gt; &gt; get_triangle_list() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:108</div></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html_aeffacfcafaf7dff6e21b047a2a6d22ae"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html#aeffacfcafaf7dff6e21b047a2a6d22ae">eos::morphablemodel::MorphableModel::get_texture_coordinates</a></div><div class="ttdeci">std::vector&lt; cv::Vec2f &gt; get_texture_coordinates() const </div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:200</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html_aeffacfcafaf7dff6e21b047a2a6d22ae"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html#aeffacfcafaf7dff6e21b047a2a6d22ae">eos::morphablemodel::MorphableModel::get_texture_coordinates</a></div><div class="ttdeci">std::vector&lt; cv::Vec2f &gt; get_texture_coordinates() const </div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:199</div></div> <div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&amp;#39;s 3D model fitting functionality. </div></div>
<div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&#39;s 3D model fitting functionality. </div></div> <div class="ttc" id="namespaceeos_1_1morphablemodel_html_a0da6e35ec49f1ebdf55f9596540cf8f8"><div class="ttname"><a href="namespaceeos_1_1morphablemodel.html#a0da6e35ec49f1ebdf55f9596540cf8f8">eos::morphablemodel::load_model</a></div><div class="ttdeci">MorphableModel load_model(std::string filename)</div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:241</div></div>
<div class="ttc" id="namespaceeos_1_1morphablemodel_html_a0da6e35ec49f1ebdf55f9596540cf8f8"><div class="ttname"><a href="namespaceeos_1_1morphablemodel.html#a0da6e35ec49f1ebdf55f9596540cf8f8">eos::morphablemodel::load_model</a></div><div class="ttdeci">MorphableModel load_model(std::string filename)</div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:240</div></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html_a305d17e6453f6be320331e00e8c8816e"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">eos::render::Mesh::vertices</a></div><div class="ttdeci">std::vector&lt; cv::Vec4f &gt; vertices</div><div class="ttdoc">3D vertex positions. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:47</div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html_a305d17e6453f6be320331e00e8c8816e"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">eos::render::Mesh::vertices</a></div><div class="ttdeci">std::vector&lt; cv::Vec4f &gt; vertices</div><div class="ttdoc">3D vertex positions. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:51</div></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html_ae3b0e946a77b4f434b382b315ea7c24b"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">eos::render::Mesh::colors</a></div><div class="ttdeci">std::vector&lt; cv::Vec3f &gt; colors</div><div class="ttdoc">Colour information for each vertex. Expected to be in RGB order. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:48</div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html_ae3b0e946a77b4f434b382b315ea7c24b"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">eos::render::Mesh::colors</a></div><div class="ttdeci">std::vector&lt; cv::Vec3f &gt; colors</div><div class="ttdoc">Colour information for each vertex. Expected to be in RGB order. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:52</div></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html_a253ca65b7f6c6cb48d4abd7b9a7f9a83"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html#a253ca65b7f6c6cb48d4abd7b9a7f9a83">eos::morphablemodel::MorphableModel::has_color_model</a></div><div class="ttdeci">bool has_color_model() const </div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:190</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html_a253ca65b7f6c6cb48d4abd7b9a7f9a83"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html#a253ca65b7f6c6cb48d4abd7b9a7f9a83">eos::morphablemodel::MorphableModel::has_color_model</a></div><div class="ttdeci">bool has_color_model() const </div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:189</div></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_af05c96c2a5d3936503b961a9b4238495"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495">eos::morphablemodel::PcaModel::get_mean</a></div><div class="ttdeci">cv::Mat get_mean() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:119</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_af05c96c2a5d3936503b961a9b4238495"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495">eos::morphablemodel::PcaModel::get_mean</a></div><div class="ttdeci">cv::Mat get_mean() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:118</div></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html">eos::render::Mesh</a></div><div class="ttdoc">This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordin...</div><div class="ttdef"><b>Definition:</b> Mesh.hpp:45</div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html">eos::render::Mesh</a></div><div class="ttdoc">This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordin...</div><div class="ttdef"><b>Definition:</b> Mesh.hpp:49</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html_a438898cd4578c1998e452de7d521f8cc"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html#a438898cd4578c1998e452de7d521f8cc">eos::morphablemodel::MorphableModel::MorphableModel</a></div><div class="ttdeci">MorphableModel(PcaModel shape_model, PcaModel color_model, std::vector&lt; cv::Vec2f &gt; texture_coordinates=std::vector&lt; cv::Vec2f &gt;())</div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:67</div></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html_a438898cd4578c1998e452de7d521f8cc"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html#a438898cd4578c1998e452de7d521f8cc">eos::morphablemodel::MorphableModel::MorphableModel</a></div><div class="ttdeci">MorphableModel(PcaModel shape_model, PcaModel color_model, std::vector&lt; cv::Vec2f &gt; texture_coordinates=std::vector&lt; cv::Vec2f &gt;())</div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:67</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html_a990bf9c518307c811691facb8c1daa11"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11">eos::morphablemodel::MorphableModel::get_shape_model</a></div><div class="ttdeci">PcaModel get_shape_model() const </div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:77</div></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html_a990bf9c518307c811691facb8c1daa11"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11">eos::morphablemodel::MorphableModel::get_shape_model</a></div><div class="ttdeci">PcaModel get_shape_model() const </div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:77</div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html_ab6fb80c460656bf7830a526f0692681b"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">eos::render::Mesh::tvi</a></div><div class="ttdeci">std::vector&lt; std::array&lt; int, 3 &gt; &gt; tvi</div><div class="ttdoc">Triangle vertex indices. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:55</div></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html_ab6fb80c460656bf7830a526f0692681b"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">eos::render::Mesh::tvi</a></div><div class="ttdeci">std::vector&lt; std::array&lt; int, 3 &gt; &gt; tvi</div><div class="ttdoc">Triangle vertex indices. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:51</div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html_a64fddf0a7200e7f66b0426773542eea4"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">eos::render::Mesh::texcoords</a></div><div class="ttdeci">std::vector&lt; cv::Vec2f &gt; texcoords</div><div class="ttdoc">Texture coordinates for each vertex. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:53</div></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html_a64fddf0a7200e7f66b0426773542eea4"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">eos::render::Mesh::texcoords</a></div><div class="ttdeci">std::vector&lt; cv::Vec2f &gt; texcoords</div><div class="ttdoc">Texture coordinates for each vertex. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:49</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html_a92ab3e9941de492954a1c603cf3e11c9"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html#a92ab3e9941de492954a1c603cf3e11c9">eos::morphablemodel::MorphableModel::draw_sample</a></div><div class="ttdeci">render::Mesh draw_sample(std::vector&lt; float &gt; shape_coefficients, std::vector&lt; float &gt; color_coefficients) const </div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:154</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html_a5fd1b15edc89e89808339859570a4c09"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html#a5fd1b15edc89e89808339859570a4c09">eos::morphablemodel::MorphableModel::draw_sample</a></div><div class="ttdeci">render::Mesh draw_sample(float shape_sigma=1.0f, float color_sigma=1.0f)</div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:123</div></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html_a5fd1b15edc89e89808339859570a4c09"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html#a5fd1b15edc89e89808339859570a4c09">eos::morphablemodel::MorphableModel::draw_sample</a></div><div class="ttdeci">render::Mesh draw_sample(float shape_sigma=1.0f, float color_sigma=1.0f)</div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:123</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a></div><div class="ttdoc">A class representing a 3D Morphable Model, consisting of a shape- and colour (albedo) PCA model...</div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:54</div></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a></div><div class="ttdoc">A class representing a 3D Morphable Model, consisting of a shape- and colour (albedo) PCA model...</div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:54</div></div>
</div><!-- fragment --></div><!-- contents --> </div><!-- fragment --></div><!-- contents -->
...@@ -346,7 +123,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -346,7 +123,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/morphablemodel/PcaModel.hpp Source File</title> <title>eos: include/eos/morphablemodel/PcaModel.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div id="nav-path" class="navpath"> <div id="nav-path" class="navpath">
<ul> <ul>
<li class="navelem"><a class="el" href="dir_ce53d3124a8ddb93985ce6ec479297f4.html">include</a></li><li class="navelem"><a class="el" href="dir_c7ebde285fcef06dba0b090642612638.html">eos</a></li><li class="navelem"><a class="el" href="dir_a487f496b1daaab0ce4d44d536b7440b.html">morphablemodel</a></li> </ul> <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_8c2f38a39d6204ca353f500c7575d762.html">morphablemodel</a></li> </ul>
</div> </div>
</div><!-- top --> </div><!-- top -->
<div class="header"> <div class="header">
...@@ -95,227 +95,29 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -95,227 +95,29 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="title">PcaModel.hpp</div> </div> <div class="title">PcaModel.hpp</div> </div>
</div><!--header--> </div><!--header-->
<div class="contents"> <div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div> <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/morphablemodel/PcaModel.hpp</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2014, 2015 Patrik Huber</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef PCAMODEL_HPP_</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define PCAMODEL_HPP_</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;eos/morphablemodel/io/mat_cerealisation.hpp&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &quot;cereal/access.hpp&quot;</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;cereal/types/array.hpp&quot;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &quot;cereal/types/vector.hpp&quot;</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor">#include &lt;array&gt;</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="preprocessor">#include &lt;random&gt;</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="preprocessor">#include &lt;cassert&gt;</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; <span class="keyword">namespace </span>morphablemodel {</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="comment">// Forward declarations of free functions</span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;cv::Mat <a class="code" href="namespaceeos_1_1morphablemodel.html#a31a2b98e73170ae558f6c50e76524817">normalise_pca_basis</a>(cv::Mat unnormalised_basis, cv::Mat eigenvalues);</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;cv::Mat <a class="code" href="namespaceeos_1_1morphablemodel.html#a90682d9e8a88243a1113b5a6c149799e">unnormalise_pca_basis</a>(cv::Mat normalised_basis, cv::Mat eigenvalues);</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html"> 55</a></span>&#160;<span class="keyword">class </span><a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html">PcaModel</a></div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;{</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html">PcaModel</a>() {}; <span class="comment">// workaround for a VS2015 RC bug. Change to &#39;=default&#39; in RTM.</span></div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;</div><div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#ab2e45689de5f00a6109ecf00b0625d2f"> 72</a></span>&#160; <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#ab2e45689de5f00a6109ecf00b0625d2f">PcaModel</a>(cv::Mat mean, cv::Mat pca_basis, cv::Mat eigenvalues, std::vector&lt;std::array&lt;int, 3&gt;&gt; triangle_list) : mean(mean), normalised_pca_basis(pca_basis), eigenvalues(eigenvalues), triangle_list(triangle_list)</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; {</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="keyword">const</span> <span class="keyword">auto</span> seed = std::random_device()();</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; engine.seed(seed);</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; unnormalised_pca_basis = <a class="code" href="namespaceeos_1_1morphablemodel.html#a90682d9e8a88243a1113b5a6c149799e">unnormalise_pca_basis</a>(normalised_pca_basis, eigenvalues);</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; };</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#a309148e123fc5fecd3cf10513f75b657"> 84</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a309148e123fc5fecd3cf10513f75b657">get_num_principal_components</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="comment">// Note: we could assert(normalised_pca_basis.cols==unnormalised_pca_basis.cols)</span></div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="keywordflow">return</span> normalised_pca_basis.cols;</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; };</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;</div><div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d"> 98</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">get_data_dimension</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="comment">// Note: we could assert(normalised_pca_basis.rows==unnormalised_pca_basis.rows)</span></div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <span class="keywordflow">return</span> normalised_pca_basis.rows;</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; };</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3"> 109</a></span>&#160; std::vector&lt;std::array&lt;int, 3&gt;&gt; <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keywordflow">return</span> triangle_list;</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; };</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;</div><div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495"> 119</a></span>&#160; cv::Mat <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495">get_mean</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <span class="keywordflow">return</span> mean;</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; };</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;</div><div class="line"><a name="l00130"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#a1820ad4e0b9719884811188f3c932592"> 130</a></span>&#160; cv::Vec4f <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a1820ad4e0b9719884811188f3c932592">get_mean_at_point</a>(<span class="keywordtype">int</span> vertex_index)<span class="keyword"> const</span></div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; vertex_index *= 3;</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="keywordflow">return</span> cv::Vec4f(mean.at&lt;<span class="keywordtype">float</span>&gt;(vertex_index), mean.at&lt;<span class="keywordtype">float</span>&gt;(vertex_index + 1), mean.at&lt;<span class="keywordtype">float</span>&gt;(vertex_index + 2), 1.0f);</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; };</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;</div><div class="line"><a name="l00143"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538"> 143</a></span>&#160; cv::Mat <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">draw_sample</a>(<span class="keywordtype">float</span> sigma = 1.0f)</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; {</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; std::normal_distribution&lt;float&gt; distribution(0.0f, sigma); <span class="comment">// this constructor takes the stddev</span></div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; std::vector&lt;float&gt; alphas(<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a309148e123fc5fecd3cf10513f75b657">get_num_principal_components</a>());</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp;&amp; a : alphas) {</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; a = distribution(engine);</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; }</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160;</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">draw_sample</a>(alphas);</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; };</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160;</div><div class="line"><a name="l00164"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#a1ec80573ada0d7ff6ce4e937944edeb2"> 164</a></span>&#160; cv::Mat <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a1ec80573ada0d7ff6ce4e937944edeb2">draw_sample</a>(std::vector&lt;float&gt; coefficients)<span class="keyword"> const</span></div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; <span class="comment">// Fill the rest with zeros if not all coefficients are given:</span></div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <span class="keywordflow">if</span> (coefficients.size() &lt; <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a309148e123fc5fecd3cf10513f75b657">get_num_principal_components</a>()) {</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; coefficients.resize(<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a309148e123fc5fecd3cf10513f75b657">get_num_principal_components</a>());</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; }</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; cv::Mat alphas(coefficients);</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160;</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; cv::Mat model_sample = mean + normalised_pca_basis * alphas;</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160;</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <span class="keywordflow">return</span> model_sample;</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; };</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160;</div><div class="line"><a name="l00188"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#af0597eb2cf01c98e397773740f3a8258"> 188</a></span>&#160; cv::Mat <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#af0597eb2cf01c98e397773740f3a8258">get_normalised_pca_basis</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; <span class="keywordflow">return</span> normalised_pca_basis.clone();</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; };</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160;</div><div class="line"><a name="l00201"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#a66e4ef89182a98845a8a6804047f2b77"> 201</a></span>&#160; cv::Mat <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a66e4ef89182a98845a8a6804047f2b77">get_normalised_pca_basis</a>(<span class="keywordtype">int</span> vertex_id)<span class="keyword"> const</span></div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; vertex_id *= 3; <span class="comment">// the basis is stored in the format [x y z x y z ...]</span></div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; assert(vertex_id &lt; <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">get_data_dimension</a>()); <span class="comment">// Make sure the given vertex index isn&#39;t larger than the number of model vertices.</span></div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <span class="keywordflow">return</span> normalised_pca_basis.rowRange(vertex_id, vertex_id + 3);</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; };</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160;</div><div class="line"><a name="l00218"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8d0f31b08aca934b7cf86dd92a1abbe2"> 218</a></span>&#160; cv::Mat <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8d0f31b08aca934b7cf86dd92a1abbe2">get_unnormalised_pca_basis</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; <span class="keywordflow">return</span> unnormalised_pca_basis.clone();</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; };</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160;</div><div class="line"><a name="l00230"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#a059f3e3f68307fd97b3e4aa38e4b6d34"> 230</a></span>&#160; cv::Mat <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a059f3e3f68307fd97b3e4aa38e4b6d34">get_unnormalised_pca_basis</a>(<span class="keywordtype">int</span> vertex_id)<span class="keyword"> const</span></div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; vertex_id *= 3; <span class="comment">// the basis is stored in the format [x y z x y z ...]</span></div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; assert(vertex_id &lt; <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">get_data_dimension</a>()); <span class="comment">// Make sure the given vertex index isn&#39;t larger than the number of model vertices.</span></div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; <span class="keywordflow">return</span> unnormalised_pca_basis.rowRange(vertex_id, vertex_id + 3);</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; };</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160;</div><div class="line"><a name="l00243"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8315679e0893b1bcde4f9a9aa08a137d"> 243</a></span>&#160; <span class="keywordtype">float</span> <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8315679e0893b1bcde4f9a9aa08a137d">get_eigenvalue</a>(<span class="keywordtype">int</span> index)<span class="keyword"> const</span></div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; <span class="comment">// no assert - OpenCV checks ::at in debug builds</span></div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; <span class="keywordflow">return</span> eigenvalues.at&lt;<span class="keywordtype">float</span>&gt;(index);</div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; };</div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160;</div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; std::mt19937 engine; </div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160;</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; cv::Mat mean; </div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; cv::Mat normalised_pca_basis; </div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; cv::Mat unnormalised_pca_basis; </div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; cv::Mat eigenvalues; </div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160;</div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; std::vector&lt;std::array&lt;int, 3&gt;&gt; triangle_list; </div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160;</div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span>cereal::access;</div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">class</span> Archive&gt;</div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160; <span class="keywordtype">void</span> serialize(Archive&amp; archive)</div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160; {</div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160; archive(mean, normalised_pca_basis, unnormalised_pca_basis, eigenvalues, triangle_list);</div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160; <span class="comment">// Note: If the files are too big, We could split this in save/load, only</span></div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; <span class="comment">// store one of the bases, and calculate the other one when loading.</span></div><div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; };</div><div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160;};</div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160;</div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160;</div><div class="line"><a name="l00285"></a><span class="lineno"><a class="line" href="namespaceeos_1_1morphablemodel.html#a31a2b98e73170ae558f6c50e76524817"> 285</a></span>&#160;<span class="keyword">inline</span> cv::Mat <a class="code" href="namespaceeos_1_1morphablemodel.html#a31a2b98e73170ae558f6c50e76524817">normalise_pca_basis</a>(cv::Mat unnormalised_basis, cv::Mat eigenvalues)</div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160;{</div><div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160; <span class="keyword">using</span> cv::Mat;</div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; Mat normalised_basis(unnormalised_basis.size(), unnormalised_basis.type()); <span class="comment">// empty matrix with the same dimensions</span></div><div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160; Mat sqrt_of_eigenvalues = eigenvalues.clone();</div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; eigenvalues.rows; ++i) {</div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; sqrt_of_eigenvalues.at&lt;<span class="keywordtype">float</span>&gt;(i) = std::sqrt(eigenvalues.at&lt;<span class="keywordtype">float</span>&gt;(i));</div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; }</div><div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; <span class="comment">// Normalise the basis: We multiply each eigenvector (i.e. each column) with the square root of its corresponding eigenvalue</span></div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> basis = 0; basis &lt; unnormalised_basis.cols; ++basis) {</div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; Mat normalised_eigenvector = unnormalised_basis.col(basis).mul(sqrt_of_eigenvalues.at&lt;<span class="keywordtype">float</span>&gt;(basis));</div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160; normalised_eigenvector.copyTo(normalised_basis.col(basis));</div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160; }</div><div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160;</div><div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160; <span class="keywordflow">return</span> normalised_basis;</div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160;};</div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160;</div><div class="line"><a name="l00312"></a><span class="lineno"><a class="line" href="namespaceeos_1_1morphablemodel.html#a90682d9e8a88243a1113b5a6c149799e"> 312</a></span>&#160;<span class="keyword">inline</span> cv::Mat <a class="code" href="namespaceeos_1_1morphablemodel.html#a90682d9e8a88243a1113b5a6c149799e">unnormalise_pca_basis</a>(cv::Mat normalised_basis, cv::Mat eigenvalues)</div><div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160;{</div><div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160; <span class="keyword">using</span> cv::Mat;</div><div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160; Mat unnormalised_basis(normalised_basis.size(), normalised_basis.type()); <span class="comment">// empty matrix with the same dimensions</span></div><div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160; Mat one_over_sqrt_of_eigenvalues = eigenvalues.clone();</div><div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; eigenvalues.rows; ++i) {</div><div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160; one_over_sqrt_of_eigenvalues.at&lt;<span class="keywordtype">float</span>&gt;(i) = 1.0f / std::sqrt(eigenvalues.at&lt;<span class="keywordtype">float</span>&gt;(i));</div><div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160; }</div><div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160; <span class="comment">// De-normalise the basis: We multiply each eigenvector (i.e. each column) with 1 over the square root of its corresponding eigenvalue</span></div><div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> basis = 0; basis &lt; normalised_basis.cols; ++basis) {</div><div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160; Mat unnormalised_eigenvector = normalised_basis.col(basis).mul(one_over_sqrt_of_eigenvalues.at&lt;<span class="keywordtype">float</span>&gt;(basis));</div><div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160; unnormalised_eigenvector.copyTo(unnormalised_basis.col(basis));</div><div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160; }</div><div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160;</div><div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160; <span class="keywordflow">return</span> unnormalised_basis;</div><div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160;};</div><div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160;</div><div class="line"><a name="l00329"></a><span class="lineno"> 329</span>&#160; } <span class="comment">/* namespace morphablemodel */</span></div><div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160;} <span class="comment">/* namespace eos */</span></div><div class="line"><a name="l00331"></a><span class="lineno"> 331</span>&#160;</div><div class="line"><a name="l00332"></a><span class="lineno"> 332</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* PCAMODEL_HPP_ */</span><span class="preprocessor"></span></div><div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html">eos::morphablemodel::PcaModel</a></div><div class="ttdoc">This class represents a PCA-model that consists of: </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:55</div></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_af0597eb2cf01c98e397773740f3a8258"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#af0597eb2cf01c98e397773740f3a8258">eos::morphablemodel::PcaModel::get_normalised_pca_basis</a></div><div class="ttdeci">cv::Mat get_normalised_pca_basis() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:188</div></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_a8dfc5fa04f9853f2e06b971b90415538"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">eos::morphablemodel::PcaModel::draw_sample</a></div><div class="ttdeci">cv::Mat draw_sample(float sigma=1.0f)</div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:143</div></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/morphablemodel/PcaModel.hpp</span></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_a309148e123fc5fecd3cf10513f75b657"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#a309148e123fc5fecd3cf10513f75b657">eos::morphablemodel::PcaModel::get_num_principal_components</a></div><div class="ttdeci">int get_num_principal_components() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:84</div></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div> <div class="ttc" id="namespaceeos_1_1morphablemodel_html_a90682d9e8a88243a1113b5a6c149799e"><div class="ttname"><a href="namespaceeos_1_1morphablemodel.html#a90682d9e8a88243a1113b5a6c149799e">eos::morphablemodel::unnormalise_pca_basis</a></div><div class="ttdeci">cv::Mat unnormalise_pca_basis(cv::Mat normalised_basis, cv::Mat eigenvalues)</div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:312</div></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2014, 2015 Patrik Huber</span></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_acdf68d929079eab57ab4990c468a9e0d"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">eos::morphablemodel::PcaModel::get_data_dimension</a></div><div class="ttdeci">int get_data_dimension() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:98</div></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_a1ec80573ada0d7ff6ce4e937944edeb2"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#a1ec80573ada0d7ff6ce4e937944edeb2">eos::morphablemodel::PcaModel::draw_sample</a></div><div class="ttdeci">cv::Mat draw_sample(std::vector&lt; float &gt; coefficients) const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:164</div></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_a059f3e3f68307fd97b3e4aa38e4b6d34"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#a059f3e3f68307fd97b3e4aa38e4b6d34">eos::morphablemodel::PcaModel::get_unnormalised_pca_basis</a></div><div class="ttdeci">cv::Mat get_unnormalised_pca_basis(int vertex_id) const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:230</div></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_aab14825974f9512ba3b7b88afd2521b3"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">eos::morphablemodel::PcaModel::get_triangle_list</a></div><div class="ttdeci">std::vector&lt; std::array&lt; int, 3 &gt; &gt; get_triangle_list() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:109</div></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef PCAMODEL_HPP_</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define PCAMODEL_HPP_</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;eos/morphablemodel/io/mat_cerealisation.hpp&quot;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &quot;cereal/access.hpp&quot;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;cereal/types/array.hpp&quot;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &quot;cereal/types/vector.hpp&quot;</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor">#include &lt;array&gt;</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="preprocessor">#include &lt;random&gt;</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; <span class="keyword">namespace </span>morphablemodel {</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="comment">// Forward declarations of free functions</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;cv::Mat <a class="code" href="namespaceeos_1_1morphablemodel.html#a73d9baeb67f25d4604fc291a23e5e2d8">normalise_pca_basis</a>(cv::Mat unnormalisedBasis, cv::Mat eigenvalues);</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;cv::Mat <a class="code" href="namespaceeos_1_1morphablemodel.html#a3d9ed5fa969cbd540ebe9587540f3607">unnormalise_pca_basis</a>(cv::Mat normalisedBasis, cv::Mat eigenvalues);</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;</div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html"> 54</a></span>&#160;<span class="keyword">class </span><a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html">PcaModel</a></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;{</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html">PcaModel</a>() {}; <span class="comment">// workaround for a VS2015 RC bug. Change to &#39;=default&#39; in RTM.</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;</div>
<div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#ab2e45689de5f00a6109ecf00b0625d2f"> 71</a></span>&#160; <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#ab2e45689de5f00a6109ecf00b0625d2f">PcaModel</a>(cv::Mat mean, cv::Mat pca_basis, cv::Mat eigenvalues, std::vector&lt;std::array&lt;int, 3&gt;&gt; triangle_list) : mean(mean), normalised_pca_basis(pca_basis), eigenvalues(eigenvalues), triangle_list(triangle_list)</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; {</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keyword">const</span> <span class="keyword">auto</span> seed = std::random_device()();</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; engine.seed(seed);</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; unnormalised_pca_basis = <a class="code" href="namespaceeos_1_1morphablemodel.html#a3d9ed5fa969cbd540ebe9587540f3607">unnormalise_pca_basis</a>(normalised_pca_basis, eigenvalues);</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; };</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;</div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#a309148e123fc5fecd3cf10513f75b657"> 83</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a309148e123fc5fecd3cf10513f75b657">get_num_principal_components</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;<span class="keyword"> </span>{</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="comment">// Note: we could assert(normalisedPcaBasis.cols==unnormalisedPcaBasis.cols)</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="keywordflow">return</span> normalised_pca_basis.cols;</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; };</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;</div>
<div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d"> 97</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">get_data_dimension</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;<span class="keyword"> </span>{</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="comment">// Note: we could assert(normalisedPcaBasis.rows==unnormalisedPcaBasis.rows)</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="keywordflow">return</span> normalised_pca_basis.rows;</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; };</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;</div>
<div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3"> 108</a></span>&#160; std::vector&lt;std::array&lt;int, 3&gt;&gt; <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">get_triangle_list</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;<span class="keyword"> </span>{</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="keywordflow">return</span> triangle_list;</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; };</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;</div>
<div class="line"><a name="l00118"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495"> 118</a></span>&#160; cv::Mat <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495">get_mean</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;<span class="keyword"> </span>{</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <span class="keywordflow">return</span> mean;</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; };</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;</div>
<div class="line"><a name="l00129"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#a1820ad4e0b9719884811188f3c932592"> 129</a></span>&#160; cv::Vec4f <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a1820ad4e0b9719884811188f3c932592">get_mean_at_point</a>(<span class="keywordtype">int</span> vertex_index)<span class="keyword"> const</span></div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;<span class="keyword"> </span>{</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; vertex_index *= 3;</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="keywordflow">if</span> (vertex_index &gt;= mean.rows) {</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="keywordflow">throw</span> std::out_of_range(<span class="stringliteral">&quot;The given vertex id is larger than the dimension of the mean.&quot;</span>);</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; }</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="keywordflow">return</span> cv::Vec4f(mean.at&lt;<span class="keywordtype">float</span>&gt;(vertex_index), mean.at&lt;<span class="keywordtype">float</span>&gt;(vertex_index + 1), mean.at&lt;<span class="keywordtype">float</span>&gt;(vertex_index + 2), 1.0f);</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; };</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;</div>
<div class="line"><a name="l00145"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538"> 145</a></span>&#160; cv::Mat <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">draw_sample</a>(<span class="keywordtype">float</span> sigma = 1.0f)</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; {</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; std::normal_distribution&lt;float&gt; distribution(0.0f, sigma); <span class="comment">// this constructor takes the stddev</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; std::vector&lt;float&gt; alphas(<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a309148e123fc5fecd3cf10513f75b657">get_num_principal_components</a>());</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160;</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp;&amp; a : alphas) {</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; a = distribution(engine);</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; }</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">draw_sample</a>(alphas);</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; };</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;</div>
<div class="line"><a name="l00166"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#abb5f0c6f86ab0cf9b35016441d877745"> 166</a></span>&#160; cv::Mat <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#abb5f0c6f86ab0cf9b35016441d877745">draw_sample</a>(std::vector&lt;float&gt; coefficients)</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; {</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; <span class="comment">// Fill the rest with zeros if not all coefficients are given:</span></div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <span class="keywordflow">if</span> (coefficients.size() &lt; <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a309148e123fc5fecd3cf10513f75b657">get_num_principal_components</a>()) {</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; coefficients.resize(<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a309148e123fc5fecd3cf10513f75b657">get_num_principal_components</a>());</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; }</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; cv::Mat alphas(coefficients);</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160;</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; cv::Mat model_sample = mean + normalised_pca_basis * alphas;</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160;</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="keywordflow">return</span> model_sample;</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; };</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160;</div>
<div class="line"><a name="l00190"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#af0597eb2cf01c98e397773740f3a8258"> 190</a></span>&#160; cv::Mat <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#af0597eb2cf01c98e397773740f3a8258">get_normalised_pca_basis</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160;<span class="keyword"> </span>{</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <span class="keywordflow">return</span> normalised_pca_basis.clone();</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; };</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160;</div>
<div class="line"><a name="l00203"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#a66e4ef89182a98845a8a6804047f2b77"> 203</a></span>&#160; cv::Mat <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a66e4ef89182a98845a8a6804047f2b77">get_normalised_pca_basis</a>(<span class="keywordtype">int</span> vertex_id)<span class="keyword"> const</span></div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160;<span class="keyword"> </span>{</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; vertex_id *= 3; <span class="comment">// the basis is stored in the format [x y z x y z ...]</span></div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; <span class="keywordflow">return</span> normalised_pca_basis.rowRange(vertex_id, vertex_id + 3);</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; };</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160;</div>
<div class="line"><a name="l00219"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8d0f31b08aca934b7cf86dd92a1abbe2"> 219</a></span>&#160; cv::Mat <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8d0f31b08aca934b7cf86dd92a1abbe2">get_unnormalised_pca_basis</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160;<span class="keyword"> </span>{</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; <span class="keywordflow">return</span> unnormalised_pca_basis.clone();</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; };</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160;</div>
<div class="line"><a name="l00231"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#a059f3e3f68307fd97b3e4aa38e4b6d34"> 231</a></span>&#160; cv::Mat <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a059f3e3f68307fd97b3e4aa38e4b6d34">get_unnormalised_pca_basis</a>(<span class="keywordtype">int</span> vertex_id)<span class="keyword"> const</span></div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160;<span class="keyword"> </span>{</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; vertex_id *= 3; <span class="comment">// the basis is stored in the format [x y z x y z ...]</span></div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; <span class="keywordflow">return</span> unnormalised_pca_basis.rowRange(vertex_id, vertex_id + 3);</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; };</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160;</div>
<div class="line"><a name="l00243"></a><span class="lineno"><a class="line" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8315679e0893b1bcde4f9a9aa08a137d"> 243</a></span>&#160; <span class="keywordtype">float</span> <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8315679e0893b1bcde4f9a9aa08a137d">get_eigenvalue</a>(<span class="keywordtype">int</span> index)<span class="keyword"> const</span></div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160;<span class="keyword"> </span>{</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; <span class="keywordflow">return</span> eigenvalues.at&lt;<span class="keywordtype">float</span>&gt;(index);</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; };</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160;</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; std::mt19937 engine; </div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160;</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; cv::Mat mean; </div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; cv::Mat normalised_pca_basis; </div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; cv::Mat unnormalised_pca_basis; </div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; cv::Mat eigenvalues; </div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160;</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; std::vector&lt;std::array&lt;int, 3&gt;&gt; triangle_list; </div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160;</div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span>cereal::access;</div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">class</span> Archive&gt;</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; <span class="keywordtype">void</span> serialize(Archive&amp; archive)</div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160; {</div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160; archive(mean, normalised_pca_basis, unnormalised_pca_basis, eigenvalues, triangle_list);</div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160; <span class="comment">// Note: If the files are too big, We could split this in save/load, only</span></div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160; <span class="comment">// store one of the bases, and calculate the other one when loading.</span></div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; };</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160;};</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160;</div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160;</div>
<div class="line"><a name="l00284"></a><span class="lineno"><a class="line" href="namespaceeos_1_1morphablemodel.html#a73d9baeb67f25d4604fc291a23e5e2d8"> 284</a></span>&#160;<span class="keyword">inline</span> cv::Mat <a class="code" href="namespaceeos_1_1morphablemodel.html#a73d9baeb67f25d4604fc291a23e5e2d8">normalise_pca_basis</a>(cv::Mat unnormalised_basis, cv::Mat eigenvalues)</div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160;{</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; <span class="keyword">using</span> cv::Mat;</div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160; Mat normalised_basis(unnormalised_basis.size(), unnormalised_basis.type()); <span class="comment">// empty matrix with the same dimensions</span></div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; Mat sqrt_of_eigenvalues = eigenvalues.clone();</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; eigenvalues.rows; ++i) {</div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160; sqrt_of_eigenvalues.at&lt;<span class="keywordtype">float</span>&gt;(i) = std::sqrt(eigenvalues.at&lt;<span class="keywordtype">float</span>&gt;(i));</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; }</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; <span class="comment">// Normalise the basis: We multiply each eigenvector (i.e. each column) with the square root of its corresponding eigenvalue</span></div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> basis = 0; basis &lt; unnormalised_basis.cols; ++basis) {</div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160; Mat normalised_eigenvector = unnormalised_basis.col(basis).mul(sqrt_of_eigenvalues.at&lt;<span class="keywordtype">float</span>&gt;(basis));</div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; normalised_eigenvector.copyTo(normalised_basis.col(basis));</div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160; }</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160;</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; <span class="keywordflow">return</span> normalised_basis;</div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160;};</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160;</div>
<div class="line"><a name="l00311"></a><span class="lineno"><a class="line" href="namespaceeos_1_1morphablemodel.html#a3d9ed5fa969cbd540ebe9587540f3607"> 311</a></span>&#160;<span class="keyword">inline</span> cv::Mat <a class="code" href="namespaceeos_1_1morphablemodel.html#a3d9ed5fa969cbd540ebe9587540f3607">unnormalise_pca_basis</a>(cv::Mat normalised_basis, cv::Mat eigenvalues)</div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160;{</div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160; <span class="keyword">using</span> cv::Mat;</div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160; Mat unnormalised_basis(normalised_basis.size(), normalised_basis.type()); <span class="comment">// empty matrix with the same dimensions</span></div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160; Mat one_over_sqrt_of_eigenvalues = eigenvalues.clone();</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; eigenvalues.rows; ++i) {</div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160; one_over_sqrt_of_eigenvalues.at&lt;<span class="keywordtype">float</span>&gt;(i) = 1.0f / std::sqrt(eigenvalues.at&lt;<span class="keywordtype">float</span>&gt;(i));</div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160; }</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160; <span class="comment">// De-normalise the basis: We multiply each eigenvector (i.e. each column) with 1 over the square root of its corresponding eigenvalue</span></div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> basis = 0; basis &lt; normalised_basis.cols; ++basis) {</div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160; Mat unnormalised_eigenvector = normalised_basis.col(basis).mul(one_over_sqrt_of_eigenvalues.at&lt;<span class="keywordtype">float</span>&gt;(basis));</div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160; unnormalised_eigenvector.copyTo(unnormalised_basis.col(basis));</div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160; }</div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160;</div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160; <span class="keywordflow">return</span> unnormalised_basis;</div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160;};</div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160;</div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160; } <span class="comment">/* namespace morphablemodel */</span></div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>&#160;} <span class="comment">/* namespace eos */</span></div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160;</div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* PCAMODEL_HPP_ */</span><span class="preprocessor"></span></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html">eos::morphablemodel::PcaModel</a></div><div class="ttdoc">This class represents a PCA-model that consists of: </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:54</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_af0597eb2cf01c98e397773740f3a8258"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#af0597eb2cf01c98e397773740f3a8258">eos::morphablemodel::PcaModel::get_normalised_pca_basis</a></div><div class="ttdeci">cv::Mat get_normalised_pca_basis() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:190</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_a8dfc5fa04f9853f2e06b971b90415538"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">eos::morphablemodel::PcaModel::draw_sample</a></div><div class="ttdeci">cv::Mat draw_sample(float sigma=1.0f)</div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:145</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_a309148e123fc5fecd3cf10513f75b657"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#a309148e123fc5fecd3cf10513f75b657">eos::morphablemodel::PcaModel::get_num_principal_components</a></div><div class="ttdeci">int get_num_principal_components() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:83</div></div>
<div class="ttc" id="namespaceeos_1_1morphablemodel_html_a73d9baeb67f25d4604fc291a23e5e2d8"><div class="ttname"><a href="namespaceeos_1_1morphablemodel.html#a73d9baeb67f25d4604fc291a23e5e2d8">eos::morphablemodel::normalise_pca_basis</a></div><div class="ttdeci">cv::Mat normalise_pca_basis(cv::Mat unnormalisedBasis, cv::Mat eigenvalues)</div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:284</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_acdf68d929079eab57ab4990c468a9e0d"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">eos::morphablemodel::PcaModel::get_data_dimension</a></div><div class="ttdeci">int get_data_dimension() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:97</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_a059f3e3f68307fd97b3e4aa38e4b6d34"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#a059f3e3f68307fd97b3e4aa38e4b6d34">eos::morphablemodel::PcaModel::get_unnormalised_pca_basis</a></div><div class="ttdeci">cv::Mat get_unnormalised_pca_basis(int vertex_id) const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:231</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_aab14825974f9512ba3b7b88afd2521b3"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3">eos::morphablemodel::PcaModel::get_triangle_list</a></div><div class="ttdeci">std::vector&lt; std::array&lt; int, 3 &gt; &gt; get_triangle_list() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:108</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_a8315679e0893b1bcde4f9a9aa08a137d"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#a8315679e0893b1bcde4f9a9aa08a137d">eos::morphablemodel::PcaModel::get_eigenvalue</a></div><div class="ttdeci">float get_eigenvalue(int index) const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:243</div></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_a8315679e0893b1bcde4f9a9aa08a137d"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#a8315679e0893b1bcde4f9a9aa08a137d">eos::morphablemodel::PcaModel::get_eigenvalue</a></div><div class="ttdeci">float get_eigenvalue(int index) const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:243</div></div>
<div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&#39;s 3D model fitting functionality. </div></div> <div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&amp;#39;s 3D model fitting functionality. </div></div>
<div class="ttc" id="namespaceeos_1_1morphablemodel_html_a3d9ed5fa969cbd540ebe9587540f3607"><div class="ttname"><a href="namespaceeos_1_1morphablemodel.html#a3d9ed5fa969cbd540ebe9587540f3607">eos::morphablemodel::unnormalise_pca_basis</a></div><div class="ttdeci">cv::Mat unnormalise_pca_basis(cv::Mat normalisedBasis, cv::Mat eigenvalues)</div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:311</div></div> <div class="ttc" id="namespaceeos_1_1morphablemodel_html_a31a2b98e73170ae558f6c50e76524817"><div class="ttname"><a href="namespaceeos_1_1morphablemodel.html#a31a2b98e73170ae558f6c50e76524817">eos::morphablemodel::normalise_pca_basis</a></div><div class="ttdeci">cv::Mat normalise_pca_basis(cv::Mat unnormalised_basis, cv::Mat eigenvalues)</div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:285</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_a66e4ef89182a98845a8a6804047f2b77"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#a66e4ef89182a98845a8a6804047f2b77">eos::morphablemodel::PcaModel::get_normalised_pca_basis</a></div><div class="ttdeci">cv::Mat get_normalised_pca_basis(int vertex_id) const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:203</div></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_a66e4ef89182a98845a8a6804047f2b77"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#a66e4ef89182a98845a8a6804047f2b77">eos::morphablemodel::PcaModel::get_normalised_pca_basis</a></div><div class="ttdeci">cv::Mat get_normalised_pca_basis(int vertex_id) const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:201</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_a8d0f31b08aca934b7cf86dd92a1abbe2"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#a8d0f31b08aca934b7cf86dd92a1abbe2">eos::morphablemodel::PcaModel::get_unnormalised_pca_basis</a></div><div class="ttdeci">cv::Mat get_unnormalised_pca_basis() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:219</div></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_a8d0f31b08aca934b7cf86dd92a1abbe2"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#a8d0f31b08aca934b7cf86dd92a1abbe2">eos::morphablemodel::PcaModel::get_unnormalised_pca_basis</a></div><div class="ttdeci">cv::Mat get_unnormalised_pca_basis() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:218</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_abb5f0c6f86ab0cf9b35016441d877745"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#abb5f0c6f86ab0cf9b35016441d877745">eos::morphablemodel::PcaModel::draw_sample</a></div><div class="ttdeci">cv::Mat draw_sample(std::vector&lt; float &gt; coefficients)</div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:166</div></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_ab2e45689de5f00a6109ecf00b0625d2f"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#ab2e45689de5f00a6109ecf00b0625d2f">eos::morphablemodel::PcaModel::PcaModel</a></div><div class="ttdeci">PcaModel(cv::Mat mean, cv::Mat pca_basis, cv::Mat eigenvalues, std::vector&lt; std::array&lt; int, 3 &gt;&gt; triangle_list)</div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:72</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_ab2e45689de5f00a6109ecf00b0625d2f"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#ab2e45689de5f00a6109ecf00b0625d2f">eos::morphablemodel::PcaModel::PcaModel</a></div><div class="ttdeci">PcaModel(cv::Mat mean, cv::Mat pca_basis, cv::Mat eigenvalues, std::vector&lt; std::array&lt; int, 3 &gt;&gt; triangle_list)</div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:71</div></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_af05c96c2a5d3936503b961a9b4238495"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495">eos::morphablemodel::PcaModel::get_mean</a></div><div class="ttdeci">cv::Mat get_mean() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:119</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_af05c96c2a5d3936503b961a9b4238495"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495">eos::morphablemodel::PcaModel::get_mean</a></div><div class="ttdeci">cv::Mat get_mean() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:118</div></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_a1820ad4e0b9719884811188f3c932592"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#a1820ad4e0b9719884811188f3c932592">eos::morphablemodel::PcaModel::get_mean_at_point</a></div><div class="ttdeci">cv::Vec4f get_mean_at_point(int vertex_index) const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:130</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_a1820ad4e0b9719884811188f3c932592"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#a1820ad4e0b9719884811188f3c932592">eos::morphablemodel::PcaModel::get_mean_at_point</a></div><div class="ttdeci">cv::Vec4f get_mean_at_point(int vertex_index) const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:129</div></div>
</div><!-- fragment --></div><!-- contents --> </div><!-- fragment --></div><!-- contents -->
<!-- start footer part --> <!-- start footer part -->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/fitting/affine_camera_estimation.hpp Source File</title> <title>eos: include/eos/fitting/affine_camera_estimation.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div id="nav-path" class="navpath"> <div id="nav-path" class="navpath">
<ul> <ul>
<li class="navelem"><a class="el" href="dir_ce53d3124a8ddb93985ce6ec479297f4.html">include</a></li><li class="navelem"><a class="el" href="dir_c7ebde285fcef06dba0b090642612638.html">eos</a></li><li class="navelem"><a class="el" href="dir_349d8dd52ed72e674b9a830f9a7a4dcc.html">fitting</a></li> </ul> <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_5c0181df23c28f36a953fd4c7a01cbc0.html">fitting</a></li> </ul>
</div> </div>
</div><!-- top --> </div><!-- top -->
<div class="header"> <div class="header">
...@@ -95,169 +95,16 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -95,169 +95,16 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="title">affine_camera_estimation.hpp</div> </div> <div class="title">affine_camera_estimation.hpp</div> </div>
</div><!--header--> </div><!--header-->
<div class="contents"> <div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div> <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/fitting/affine_camera_estimation.hpp</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2014, 2015 Patrik Huber</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef AFFINECAMERAESTIMATION_HPP_</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define AFFINECAMERAESTIMATION_HPP_</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;eos/render/utils.hpp&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core_c.h&quot;</span> <span class="comment">// for CV_REDUCE_AVG</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &lt;cassert&gt;</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; <span class="keyword">namespace </span>fitting {</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#afce5f7297094056a04ad26785c94bbd8"> 53</a></span>&#160;cv::Mat <a class="code" href="namespaceeos_1_1fitting.html#afce5f7297094056a04ad26785c94bbd8">estimate_affine_camera</a>(std::vector&lt;cv::Vec2f&gt; image_points, std::vector&lt;cv::Vec4f&gt; model_points)</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;{</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="keyword">using</span> cv::Mat;</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; assert(image_points.size() == model_points.size());</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; assert(image_points.size() &gt;= 4); <span class="comment">// Number of correspondence points given needs to be equal to or larger than 4</span></div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; <span class="keyword">const</span> <span class="keywordtype">int</span> num_correspondences = <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(image_points.size());</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; Mat matImagePoints; <span class="comment">// will be numCorrespondences x 2, CV_32FC1</span></div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; Mat matModelPoints; <span class="comment">// will be numCorrespondences x 3, CV_32FC1</span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; image_points.size(); ++i) {</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; Mat imgPoint(1, 2, CV_32FC1);</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; imgPoint.at&lt;<span class="keywordtype">float</span>&gt;(0, 0) = image_points[i][0];</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; imgPoint.at&lt;<span class="keywordtype">float</span>&gt;(0, 1) = image_points[i][1];</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; matImagePoints.push_back(imgPoint);</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; Mat mdlPoint(1, 3, CV_32FC1);</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; mdlPoint.at&lt;<span class="keywordtype">float</span>&gt;(0, 0) = model_points[i][0];</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; mdlPoint.at&lt;<span class="keywordtype">float</span>&gt;(0, 1) = model_points[i][1];</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; mdlPoint.at&lt;<span class="keywordtype">float</span>&gt;(0, 2) = model_points[i][2];</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; matModelPoints.push_back(mdlPoint);</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; }</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="comment">// translate the centroid of the image points to the origin:</span></div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; Mat imagePointsMean; <span class="comment">// use non-homogeneous coords for the next few steps? (less submatrices etc overhead)</span></div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; cv::reduce(matImagePoints, imagePointsMean, 0, CV_REDUCE_AVG);</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; imagePointsMean = cv::repeat(imagePointsMean, matImagePoints.rows, 1); <span class="comment">// get T_13 and T_23 from imagePointsMean</span></div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; matImagePoints = matImagePoints - imagePointsMean;</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="comment">// scale the image points such that the RMS distance from the origin is sqrt(2):</span></div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="comment">// 1) calculate the average norm (root mean squared distance) of all vectors</span></div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keywordtype">float</span> average_norm = 0.0f;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> row = 0; row &lt; matImagePoints.rows; ++row) {</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; average_norm += <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(cv::norm(matImagePoints.row(row), cv::NORM_L2));</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; }</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; average_norm /= matImagePoints.rows;</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="comment">// 2) multiply every vectors coordinate by sqrt(2)/average_norm</span></div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="keywordtype">float</span> scaleFactor = <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(std::sqrt(2)) / average_norm;</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; matImagePoints *= scaleFactor; <span class="comment">// add unit homogeneous component here</span></div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="comment">// The points in matImagePoints now have a RMS distance from the origin of sqrt(2).</span></div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="comment">// The normalisation matrix so that the 2D points are mean-free and their norm is as described above.</span></div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; Mat T = Mat::zeros(3, 3, CV_32FC1);</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; T.at&lt;<span class="keywordtype">float</span>&gt;(0, 0) = scaleFactor; <span class="comment">// s_x</span></div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; T.at&lt;<span class="keywordtype">float</span>&gt;(1, 1) = scaleFactor; <span class="comment">// s_y</span></div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; T.at&lt;<span class="keywordtype">float</span>&gt;(0, 2) = -imagePointsMean.at&lt;<span class="keywordtype">float</span>&gt;(0, 0) * scaleFactor; <span class="comment">// t_x</span></div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; T.at&lt;<span class="keywordtype">float</span>&gt;(1, 2) = -imagePointsMean.at&lt;<span class="keywordtype">float</span>&gt;(0, 1) * scaleFactor; <span class="comment">// t_y</span></div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; T.at&lt;<span class="keywordtype">float</span>&gt;(2, 2) = 1;</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <span class="comment">// center the model points to the origin:</span></div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; Mat tmpOrigMdlPoints = matModelPoints.clone(); <span class="comment">// Temp for testing: Save the original coordinates.</span></div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <span class="comment">// translate the centroid of the model points to the origin:</span></div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; Mat modelPointsMean; <span class="comment">// use non-homogeneous coords for the next few steps? (less submatrices etc overhead)</span></div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; cv::reduce(matModelPoints, modelPointsMean, 0, CV_REDUCE_AVG);</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; modelPointsMean = cv::repeat(modelPointsMean, matModelPoints.rows, 1);</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; matModelPoints = matModelPoints - modelPointsMean;</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="comment">// scale the model points such that the RMS distance from the origin is sqrt(3):</span></div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="comment">// 1) calculate the average norm (root mean squared distance) of all vectors</span></div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; average_norm = 0.0f;</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> row = 0; row &lt; matModelPoints.rows; ++row) {</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; average_norm += <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(cv::norm(matModelPoints.row(row), cv::NORM_L2));</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; }</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; average_norm /= matModelPoints.rows;</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="comment">// 2) multiply every vectors coordinate by sqrt(3)/avgnorm</span></div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; scaleFactor = <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(std::sqrt(3)) / average_norm;</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; matModelPoints *= scaleFactor; <span class="comment">// add unit homogeneous component here</span></div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="comment">// The points in matModelPoints now have a RMS distance from the origin of sqrt(3).</span></div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="comment">// The normalisation matrix so that the 3D points are mean-free and their norm is as described above.</span></div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; Mat U = Mat::zeros(4, 4, CV_32FC1);</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; U.at&lt;<span class="keywordtype">float</span>&gt;(0, 0) = scaleFactor; <span class="comment">// s_x</span></div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; U.at&lt;<span class="keywordtype">float</span>&gt;(1, 1) = scaleFactor; <span class="comment">// s_y</span></div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; U.at&lt;<span class="keywordtype">float</span>&gt;(2, 2) = scaleFactor; <span class="comment">// s_z</span></div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; U.at&lt;<span class="keywordtype">float</span>&gt;(0, 3) = -modelPointsMean.at&lt;<span class="keywordtype">float</span>&gt;(0, 0) * scaleFactor; <span class="comment">// t_x</span></div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; U.at&lt;<span class="keywordtype">float</span>&gt;(1, 3) = -modelPointsMean.at&lt;<span class="keywordtype">float</span>&gt;(0, 1) * scaleFactor; <span class="comment">// t_y</span></div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; U.at&lt;<span class="keywordtype">float</span>&gt;(2, 3) = -modelPointsMean.at&lt;<span class="keywordtype">float</span>&gt;(0, 2) * scaleFactor; <span class="comment">// t_z</span></div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; U.at&lt;<span class="keywordtype">float</span>&gt;(3, 3) = 1;</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <span class="comment">// Estimate the normalised camera matrix (C tilde).</span></div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="comment">// We are solving the system $A_8 * p_8 = b$</span></div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="comment">// The solution is obtained by the pseudo-inverse of A_8:</span></div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="comment">// $p_8 = A_8^+ * b$</span></div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; Mat A_8 = Mat::zeros(num_correspondences * 2, 8, CV_32FC1);</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <span class="comment">//Mat p_8(); // p_8 is 8 x 1. We are solving for it.</span></div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; Mat b(num_correspondences * 2, 1, CV_32FC1);</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; num_correspondences; ++i) {</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; A_8.at&lt;<span class="keywordtype">float</span>&gt;(2 * i, 0) = matModelPoints.at&lt;<span class="keywordtype">float</span>&gt;(i, 0); <span class="comment">// could maybe made faster by assigning the whole row/col-range if possible?</span></div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; A_8.at&lt;<span class="keywordtype">float</span>&gt;(2 * i, 1) = matModelPoints.at&lt;<span class="keywordtype">float</span>&gt;(i, 1);</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; A_8.at&lt;<span class="keywordtype">float</span>&gt;(2 * i, 2) = matModelPoints.at&lt;<span class="keywordtype">float</span>&gt;(i, 2);</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; A_8.at&lt;<span class="keywordtype">float</span>&gt;(2 * i, 3) = 1;</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; A_8.at&lt;<span class="keywordtype">float</span>&gt;((2 * i) + 1, 4) = matModelPoints.at&lt;<span class="keywordtype">float</span>&gt;(i, 0);</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; A_8.at&lt;<span class="keywordtype">float</span>&gt;((2 * i) + 1, 5) = matModelPoints.at&lt;<span class="keywordtype">float</span>&gt;(i, 1);</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; A_8.at&lt;<span class="keywordtype">float</span>&gt;((2 * i) + 1, 6) = matModelPoints.at&lt;<span class="keywordtype">float</span>&gt;(i, 2);</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; A_8.at&lt;<span class="keywordtype">float</span>&gt;((2 * i) + 1, 7) = 1;</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; b.at&lt;<span class="keywordtype">float</span>&gt;(2 * i, 0) = matImagePoints.at&lt;<span class="keywordtype">float</span>&gt;(i, 0);</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; b.at&lt;<span class="keywordtype">float</span>&gt;((2 * i) + 1, 0) = matImagePoints.at&lt;<span class="keywordtype">float</span>&gt;(i, 1);</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; }</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; Mat p_8 = A_8.inv(cv::DECOMP_SVD) * b;</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; Mat C_tilde = Mat::zeros(3, 4, CV_32FC1);</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; C_tilde.row(0) = p_8.rowRange(0, 4).t(); <span class="comment">// The first row of C_tilde consists of the first 4 entries of the col-vector p_8</span></div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; C_tilde.row(1) = p_8.rowRange(4, 8).t(); <span class="comment">// Second row = last 4 entries</span></div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; C_tilde.at&lt;<span class="keywordtype">float</span>&gt;(2, 3) = 1; <span class="comment">// the last row is [0 0 0 1]</span></div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160;</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; Mat P_Affine = T.inv() * C_tilde * U;</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; <span class="keywordflow">return</span> P_Affine;</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160;};</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;</div><div class="line"><a name="l00177"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#a3e99a34e412f0bb5b2c6568dd37ae413"> 177</a></span>&#160;<span class="keyword">inline</span> cv::Vec2f <a class="code" href="namespaceeos_1_1fitting.html#a3e99a34e412f0bb5b2c6568dd37ae413">project_affine</a>(cv::Vec4f vertex, cv::Mat affine_camera_matrix, <span class="keywordtype">int</span> screen_width, <span class="keywordtype">int</span> screen_height)</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160;{</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="comment">// Transform to clip space:</span></div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; cv::Mat clip_coords = affine_camera_matrix * cv::Mat(vertex);</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="comment">// Take the x and y coordinates in clip space and apply the window transform:</span></div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; cv::Vec2f screen_coords = <a class="code" href="namespaceeos_1_1render.html#a04bb2f816e97ecb7f33cf8a50328e0db">render::clip_to_screen_space</a>(cv::Vec2f(clip_coords.rowRange(0, 2)), screen_width, screen_height);</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="keywordflow">return</span> screen_coords;</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;};</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160;</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; } <span class="comment">/* namespace fitting */</span></div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160;} <span class="comment">/* namespace eos */</span></div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160;</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* AFFINECAMERAESTIMATION_HPP_ */</span><span class="preprocessor"></span></div><div class="ttc" id="namespaceeos_1_1fitting_html_afce5f7297094056a04ad26785c94bbd8"><div class="ttname"><a href="namespaceeos_1_1fitting.html#afce5f7297094056a04ad26785c94bbd8">eos::fitting::estimate_affine_camera</a></div><div class="ttdeci">cv::Mat estimate_affine_camera(std::vector&lt; cv::Vec2f &gt; image_points, std::vector&lt; cv::Vec4f &gt; model_points)</div><div class="ttdef"><b>Definition:</b> affine_camera_estimation.hpp:53</div></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/fitting/affine_camera_estimation.hpp</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2014, 2015 Patrik Huber</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef AFFINECAMERAESTIMATION_HPP_</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define AFFINECAMERAESTIMATION_HPP_</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;eos/render/utils.hpp&quot;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core_c.h&quot;</span> <span class="comment">// for CV_REDUCE_AVG</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &lt;cassert&gt;</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; <span class="keyword">namespace </span>fitting {</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;</div>
<div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#afce5f7297094056a04ad26785c94bbd8"> 53</a></span>&#160;cv::Mat <a class="code" href="namespaceeos_1_1fitting.html#afce5f7297094056a04ad26785c94bbd8">estimate_affine_camera</a>(std::vector&lt;cv::Vec2f&gt; image_points, std::vector&lt;cv::Vec4f&gt; model_points)</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;{</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="keyword">using</span> cv::Mat;</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; assert(image_points.size() == model_points.size());</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; assert(image_points.size() &gt;= 4); <span class="comment">// Number of correspondence points given needs to be equal to or larger than 4</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; <span class="keyword">const</span> <span class="keywordtype">int</span> num_correspondences = <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(image_points.size());</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; Mat matImagePoints; <span class="comment">// will be numCorrespondences x 2, CV_32FC1</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; Mat matModelPoints; <span class="comment">// will be numCorrespondences x 3, CV_32FC1</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; image_points.size(); ++i) {</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; Mat imgPoint(1, 2, CV_32FC1);</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; imgPoint.at&lt;<span class="keywordtype">float</span>&gt;(0, 0) = image_points[i][0];</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; imgPoint.at&lt;<span class="keywordtype">float</span>&gt;(0, 1) = image_points[i][1];</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; matImagePoints.push_back(imgPoint);</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; Mat mdlPoint(1, 3, CV_32FC1);</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; mdlPoint.at&lt;<span class="keywordtype">float</span>&gt;(0, 0) = model_points[i][0];</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; mdlPoint.at&lt;<span class="keywordtype">float</span>&gt;(0, 1) = model_points[i][1];</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; mdlPoint.at&lt;<span class="keywordtype">float</span>&gt;(0, 2) = model_points[i][2];</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; matModelPoints.push_back(mdlPoint);</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; }</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="comment">// translate the centroid of the image points to the origin:</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; Mat imagePointsMean; <span class="comment">// use non-homogeneous coords for the next few steps? (less submatrices etc overhead)</span></div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; cv::reduce(matImagePoints, imagePointsMean, 0, CV_REDUCE_AVG);</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; imagePointsMean = cv::repeat(imagePointsMean, matImagePoints.rows, 1); <span class="comment">// get T_13 and T_23 from imagePointsMean</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; matImagePoints = matImagePoints - imagePointsMean;</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="comment">// scale the image points such that the RMS distance from the origin is sqrt(2):</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="comment">// 1) calculate the average norm (root mean squared distance) of all vectors</span></div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keywordtype">float</span> average_norm = 0.0f;</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> row = 0; row &lt; matImagePoints.rows; ++row) {</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; average_norm += <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(cv::norm(matImagePoints.row(row), cv::NORM_L2));</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; }</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; average_norm /= matImagePoints.rows;</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="comment">// 2) multiply every vectors coordinate by sqrt(2)/average_norm</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="keywordtype">float</span> scaleFactor = <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(std::sqrt(2)) / average_norm;</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; matImagePoints *= scaleFactor; <span class="comment">// add unit homogeneous component here</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="comment">// The points in matImagePoints now have a RMS distance from the origin of sqrt(2).</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="comment">// The normalisation matrix so that the 2D points are mean-free and their norm is as described above.</span></div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; Mat T = Mat::zeros(3, 3, CV_32FC1);</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; T.at&lt;<span class="keywordtype">float</span>&gt;(0, 0) = scaleFactor; <span class="comment">// s_x</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; T.at&lt;<span class="keywordtype">float</span>&gt;(1, 1) = scaleFactor; <span class="comment">// s_y</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; T.at&lt;<span class="keywordtype">float</span>&gt;(0, 2) = -imagePointsMean.at&lt;<span class="keywordtype">float</span>&gt;(0, 0) * scaleFactor; <span class="comment">// t_x</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; T.at&lt;<span class="keywordtype">float</span>&gt;(1, 2) = -imagePointsMean.at&lt;<span class="keywordtype">float</span>&gt;(0, 1) * scaleFactor; <span class="comment">// t_y</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; T.at&lt;<span class="keywordtype">float</span>&gt;(2, 2) = 1;</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <span class="comment">// center the model points to the origin:</span></div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; Mat tmpOrigMdlPoints = matModelPoints.clone(); <span class="comment">// Temp for testing: Save the original coordinates.</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <span class="comment">// translate the centroid of the model points to the origin:</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; Mat modelPointsMean; <span class="comment">// use non-homogeneous coords for the next few steps? (less submatrices etc overhead)</span></div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; cv::reduce(matModelPoints, modelPointsMean, 0, CV_REDUCE_AVG);</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; modelPointsMean = cv::repeat(modelPointsMean, matModelPoints.rows, 1);</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; matModelPoints = matModelPoints - modelPointsMean;</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="comment">// scale the model points such that the RMS distance from the origin is sqrt(3):</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="comment">// 1) calculate the average norm (root mean squared distance) of all vectors</span></div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; average_norm = 0.0f;</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> row = 0; row &lt; matModelPoints.rows; ++row) {</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; average_norm += <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(cv::norm(matModelPoints.row(row), cv::NORM_L2));</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; }</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; average_norm /= matModelPoints.rows;</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="comment">// 2) multiply every vectors coordinate by sqrt(3)/avgnorm</span></div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; scaleFactor = <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(std::sqrt(3)) / average_norm;</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; matModelPoints *= scaleFactor; <span class="comment">// add unit homogeneous component here</span></div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="comment">// The points in matModelPoints now have a RMS distance from the origin of sqrt(3).</span></div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="comment">// The normalisation matrix so that the 3D points are mean-free and their norm is as described above.</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; Mat U = Mat::zeros(4, 4, CV_32FC1);</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; U.at&lt;<span class="keywordtype">float</span>&gt;(0, 0) = scaleFactor; <span class="comment">// s_x</span></div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; U.at&lt;<span class="keywordtype">float</span>&gt;(1, 1) = scaleFactor; <span class="comment">// s_y</span></div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; U.at&lt;<span class="keywordtype">float</span>&gt;(2, 2) = scaleFactor; <span class="comment">// s_z</span></div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; U.at&lt;<span class="keywordtype">float</span>&gt;(0, 3) = -modelPointsMean.at&lt;<span class="keywordtype">float</span>&gt;(0, 0) * scaleFactor; <span class="comment">// t_x</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; U.at&lt;<span class="keywordtype">float</span>&gt;(1, 3) = -modelPointsMean.at&lt;<span class="keywordtype">float</span>&gt;(0, 1) * scaleFactor; <span class="comment">// t_y</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; U.at&lt;<span class="keywordtype">float</span>&gt;(2, 3) = -modelPointsMean.at&lt;<span class="keywordtype">float</span>&gt;(0, 2) * scaleFactor; <span class="comment">// t_z</span></div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; U.at&lt;<span class="keywordtype">float</span>&gt;(3, 3) = 1;</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <span class="comment">// Estimate the normalised camera matrix (C tilde).</span></div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="comment">// We are solving the system $A_8 * p_8 = b$</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="comment">// The solution is obtained by the pseudo-inverse of A_8:</span></div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="comment">// $p_8 = A_8^+ * b$</span></div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; Mat A_8 = Mat::zeros(num_correspondences * 2, 8, CV_32FC1);</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <span class="comment">//Mat p_8(); // p_8 is 8 x 1. We are solving for it.</span></div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; Mat b(num_correspondences * 2, 1, CV_32FC1);</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; num_correspondences; ++i) {</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; A_8.at&lt;<span class="keywordtype">float</span>&gt;(2 * i, 0) = matModelPoints.at&lt;<span class="keywordtype">float</span>&gt;(i, 0); <span class="comment">// could maybe made faster by assigning the whole row/col-range if possible?</span></div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; A_8.at&lt;<span class="keywordtype">float</span>&gt;(2 * i, 1) = matModelPoints.at&lt;<span class="keywordtype">float</span>&gt;(i, 1);</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; A_8.at&lt;<span class="keywordtype">float</span>&gt;(2 * i, 2) = matModelPoints.at&lt;<span class="keywordtype">float</span>&gt;(i, 2);</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; A_8.at&lt;<span class="keywordtype">float</span>&gt;(2 * i, 3) = 1;</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; A_8.at&lt;<span class="keywordtype">float</span>&gt;((2 * i) + 1, 4) = matModelPoints.at&lt;<span class="keywordtype">float</span>&gt;(i, 0);</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; A_8.at&lt;<span class="keywordtype">float</span>&gt;((2 * i) + 1, 5) = matModelPoints.at&lt;<span class="keywordtype">float</span>&gt;(i, 1);</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; A_8.at&lt;<span class="keywordtype">float</span>&gt;((2 * i) + 1, 6) = matModelPoints.at&lt;<span class="keywordtype">float</span>&gt;(i, 2);</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; A_8.at&lt;<span class="keywordtype">float</span>&gt;((2 * i) + 1, 7) = 1;</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; b.at&lt;<span class="keywordtype">float</span>&gt;(2 * i, 0) = matImagePoints.at&lt;<span class="keywordtype">float</span>&gt;(i, 0);</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; b.at&lt;<span class="keywordtype">float</span>&gt;((2 * i) + 1, 0) = matImagePoints.at&lt;<span class="keywordtype">float</span>&gt;(i, 1);</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; }</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; Mat p_8 = A_8.inv(cv::DECOMP_SVD) * b;</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; Mat C_tilde = Mat::zeros(3, 4, CV_32FC1);</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; C_tilde.row(0) = p_8.rowRange(0, 4).t(); <span class="comment">// The first row of C_tilde consists of the first 4 entries of the col-vector p_8</span></div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; C_tilde.row(1) = p_8.rowRange(4, 8).t(); <span class="comment">// Second row = last 4 entries</span></div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; C_tilde.at&lt;<span class="keywordtype">float</span>&gt;(2, 3) = 1; <span class="comment">// the last row is [0 0 0 1]</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160;</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; Mat P_Affine = T.inv() * C_tilde * U;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; <span class="keywordflow">return</span> P_Affine;</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160;};</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;</div>
<div class="line"><a name="l00177"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#a3e99a34e412f0bb5b2c6568dd37ae413"> 177</a></span>&#160;<span class="keyword">inline</span> cv::Vec2f <a class="code" href="namespaceeos_1_1fitting.html#a3e99a34e412f0bb5b2c6568dd37ae413">project_affine</a>(cv::Vec4f vertex, cv::Mat affine_camera_matrix, <span class="keywordtype">int</span> screen_width, <span class="keywordtype">int</span> screen_height)</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160;{</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="comment">// Transform to clip space:</span></div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; cv::Mat clip_coords = affine_camera_matrix * cv::Mat(vertex);</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="comment">// Take the x and y coordinates in clip space and apply the window transform:</span></div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; cv::Vec2f screen_coords = <a class="code" href="namespaceeos_1_1render.html#a04bb2f816e97ecb7f33cf8a50328e0db">render::clip_to_screen_space</a>(cv::Vec2f(clip_coords.rowRange(0, 2)), screen_width, screen_height);</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="keywordflow">return</span> screen_coords;</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;};</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160;</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; } <span class="comment">/* namespace fitting */</span></div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160;} <span class="comment">/* namespace eos */</span></div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160;</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* AFFINECAMERAESTIMATION_HPP_ */</span><span class="preprocessor"></span></div>
<div class="ttc" id="namespaceeos_1_1fitting_html_afce5f7297094056a04ad26785c94bbd8"><div class="ttname"><a href="namespaceeos_1_1fitting.html#afce5f7297094056a04ad26785c94bbd8">eos::fitting::estimate_affine_camera</a></div><div class="ttdeci">cv::Mat estimate_affine_camera(std::vector&lt; cv::Vec2f &gt; image_points, std::vector&lt; cv::Vec4f &gt; model_points)</div><div class="ttdef"><b>Definition:</b> affine_camera_estimation.hpp:53</div></div>
<div class="ttc" id="namespaceeos_1_1fitting_html_a3e99a34e412f0bb5b2c6568dd37ae413"><div class="ttname"><a href="namespaceeos_1_1fitting.html#a3e99a34e412f0bb5b2c6568dd37ae413">eos::fitting::project_affine</a></div><div class="ttdeci">cv::Vec2f project_affine(cv::Vec4f vertex, cv::Mat affine_camera_matrix, int screen_width, int screen_height)</div><div class="ttdef"><b>Definition:</b> affine_camera_estimation.hpp:177</div></div> <div class="ttc" id="namespaceeos_1_1fitting_html_a3e99a34e412f0bb5b2c6568dd37ae413"><div class="ttname"><a href="namespaceeos_1_1fitting.html#a3e99a34e412f0bb5b2c6568dd37ae413">eos::fitting::project_affine</a></div><div class="ttdeci">cv::Vec2f project_affine(cv::Vec4f vertex, cv::Mat affine_camera_matrix, int screen_width, int screen_height)</div><div class="ttdef"><b>Definition:</b> affine_camera_estimation.hpp:177</div></div>
<div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&#39;s 3D model fitting functionality. </div></div> <div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&amp;#39;s 3D model fitting functionality. </div></div>
<div class="ttc" id="namespaceeos_1_1render_html_a04bb2f816e97ecb7f33cf8a50328e0db"><div class="ttname"><a href="namespaceeos_1_1render.html#a04bb2f816e97ecb7f33cf8a50328e0db">eos::render::clip_to_screen_space</a></div><div class="ttdeci">cv::Vec2f clip_to_screen_space(const cv::Vec2f &amp;clip_coordinates, int screen_width, int screen_height)</div><div class="ttdef"><b>Definition:</b> utils.hpp:50</div></div> <div class="ttc" id="namespaceeos_1_1render_html_a04bb2f816e97ecb7f33cf8a50328e0db"><div class="ttname"><a href="namespaceeos_1_1render.html#a04bb2f816e97ecb7f33cf8a50328e0db">eos::render::clip_to_screen_space</a></div><div class="ttdeci">cv::Vec2f clip_to_screen_space(const cv::Vec2f &amp;clip_coordinates, int screen_width, int screen_height)</div><div class="ttdef"><b>Definition:</b> utils.hpp:50</div></div>
</div><!-- fragment --></div><!-- contents --> </div><!-- fragment --></div><!-- contents -->
<!-- start footer part --> <!-- start footer part -->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: Class List</title> <title>eos: Class List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -100,14 +100,17 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -100,14 +100,17 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<tr id="row_0_0_0_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structeos_1_1core_1_1_landmark.html" target="_self">Landmark</a></td><td class="desc">Representation of a landmark, consisting of a landmark name and coordinates of the given type. Usually, the type would be <code>cv::Vec2f</code> </td></tr> <tr id="row_0_0_0_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structeos_1_1core_1_1_landmark.html" target="_self">Landmark</a></td><td class="desc">Representation of a landmark, consisting of a landmark name and coordinates of the given type. Usually, the type would be <code>cv::Vec2f</code> </td></tr>
<tr id="row_0_0_1_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classeos_1_1core_1_1_landmark_mapper.html" target="_self">LandmarkMapper</a></td><td class="desc">Represents a mapping from one kind of landmarks to a different format (e.g. model vertices) </td></tr> <tr id="row_0_0_1_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classeos_1_1core_1_1_landmark_mapper.html" target="_self">LandmarkMapper</a></td><td class="desc">Represents a mapping from one kind of landmarks to a different format (e.g. model vertices) </td></tr>
<tr id="row_0_1_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_1_" class="arrow" onclick="toggleFolder('0_1_')">&#9660;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespaceeos_1_1fitting.html" target="_self">fitting</a></td><td class="desc">Pose and shape fitting of a 3D Morphable Model </td></tr> <tr id="row_0_1_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_1_" class="arrow" onclick="toggleFolder('0_1_')">&#9660;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespaceeos_1_1fitting.html" target="_self">fitting</a></td><td class="desc">Pose and shape fitting of a 3D Morphable Model </td></tr>
<tr id="row_0_1_0_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structeos_1_1fitting_1_1_frustum.html" target="_self">Frustum</a></td><td class="desc">A class representing a camera viewing frustum. At the moment used as orthographic camera only </td></tr> <tr id="row_0_1_0_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structeos_1_1fitting_1_1_contour_landmarks.html" target="_self">ContourLandmarks</a></td><td class="desc">Defines which 2D landmarks comprise the right and left face contour </td></tr>
<tr id="row_0_1_1_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html" target="_self">OrthographicRenderingParameters</a></td><td class="desc">Represents a set of estimated model parameters (rotation, translation) and camera parameters (viewing frustum) </td></tr> <tr id="row_0_1_1_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structeos_1_1fitting_1_1_frustum.html" target="_self">Frustum</a></td><td class="desc">A class representing a camera viewing frustum. At the moment used as orthographic camera only </td></tr>
<tr id="row_0_1_2_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structeos_1_1fitting_1_1_model_contour.html" target="_self">ModelContour</a></td><td class="desc">Definition of the vertex indices that define the right and left model contour </td></tr>
<tr id="row_0_1_3_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html" target="_self">RenderingParameters</a></td><td class="desc">Represents a set of estimated model parameters (rotation, translation) and camera parameters (viewing frustum) </td></tr>
<tr id="row_0_2_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_2_" class="arrow" onclick="toggleFolder('0_2_')">&#9660;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespaceeos_1_1morphablemodel.html" target="_self">morphablemodel</a></td><td class="desc">Functionality to represent a Morphable Model, containing it's PCA models and loading functions </td></tr> <tr id="row_0_2_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_2_" class="arrow" onclick="toggleFolder('0_2_')">&#9660;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespaceeos_1_1morphablemodel.html" target="_self">morphablemodel</a></td><td class="desc">Functionality to represent a Morphable Model, containing it's PCA models and loading functions </td></tr>
<tr id="row_0_2_0_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html" target="_self">MorphableModel</a></td><td class="desc">A class representing a 3D Morphable Model, consisting of a shape- and colour (albedo) PCA model </td></tr> <tr id="row_0_2_0_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html" target="_self">Blendshape</a></td><td class="desc">A class representing a 3D blendshape </td></tr>
<tr id="row_0_2_1_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html" target="_self">PcaModel</a></td><td class="desc">This class represents a PCA-model that consists of: </td></tr> <tr id="row_0_2_1_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html" target="_self">MorphableModel</a></td><td class="desc">A class representing a 3D Morphable Model, consisting of a shape- and colour (albedo) PCA model </td></tr>
<tr id="row_0_3_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_3_" class="arrow" onclick="toggleFolder('0_3_')">&#9660;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespaceeos_1_1render.html" target="_self">render</a></td><td class="desc">3D mesh and texture extraction functionality </td></tr> <tr id="row_0_2_2_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html" target="_self">PcaModel</a></td><td class="desc">This class represents a PCA-model that consists of: </td></tr>
<tr id="row_0_3_0_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structeos_1_1render_1_1_mesh.html" target="_self">Mesh</a></td><td class="desc">This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordinates </td></tr> <tr id="row_0_3_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_3_" class="arrow" onclick="toggleFolder('0_3_')">&#9660;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespaceeos_1_1render.html" target="_self">render</a></td><td class="desc">3D mesh and texture extraction functionality </td></tr>
<tr id="row_0_3_1_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classeos_1_1render_1_1_texture.html" target="_self">Texture</a></td><td class="desc"></td></tr> <tr id="row_0_3_0_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structeos_1_1render_1_1_mesh.html" target="_self">Mesh</a></td><td class="desc">This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordinates </td></tr>
<tr id="row_0_3_1_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classeos_1_1render_1_1_texture.html" target="_self">Texture</a></td><td class="desc">Represents a texture for rendering </td></tr>
</table> </table>
</div><!-- directory --> </div><!-- directory -->
</div><!-- contents --> </div><!-- contents -->
...@@ -115,7 +118,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -115,7 +118,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/fitting/blendshape_fitting.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos
&#160;<span id="projectnumber">0.7.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_5c0181df23c28f36a953fd4c7a01cbc0.html">fitting</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">blendshape_fitting.hpp</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/fitting/blendshape_fitting.hpp</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2015 Patrik Huber</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef BLENDSHAPEFITTING_HPP_</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define BLENDSHAPEFITTING_HPP_</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;eos/morphablemodel/Blendshape.hpp&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &lt;cassert&gt;</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; <span class="keyword">namespace </span>fitting {</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;</div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#ac429313cbc0ed61744f1b0fa4dba672b"> 50</a></span>&#160;<span class="keyword">inline</span> std::vector&lt;float&gt; <a class="code" href="namespaceeos_1_1fitting.html#ac429313cbc0ed61744f1b0fa4dba672b">fit_blendshapes_to_landmarks_linear</a>(std::vector&lt;eos::morphablemodel::Blendshape&gt; blendshapes, cv::Mat face_instance, cv::Mat affine_camera_matrix, std::vector&lt;cv::Vec2f&gt; landmarks, std::vector&lt;int&gt; vertex_ids, <span class="keywordtype">float</span> lambda=500.0f)</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;{</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="keyword">using</span> cv::Mat;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; assert(landmarks.size() == vertex_ids.size());</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="keywordtype">int</span> num_coeffs_to_fit = blendshapes.size();</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; <span class="keywordtype">int</span> num_landmarks = <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(landmarks.size());</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <span class="comment">// Copy all blendshapes into a &quot;basis&quot; matrix with each blendshape being a column:</span></div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; cv::Mat blendshapes_as_basis(blendshapes[0].deformation.rows, blendshapes.size(), CV_32FC1); <span class="comment">// assert blendshapes.size() &gt; 0 and all of them have same number of rows, and 1 col</span></div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; blendshapes.size(); ++i)</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; {</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; blendshapes[i].deformation.copyTo(blendshapes_as_basis.col(i));</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; }</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="comment">// $\hat{V} \in R^{3N\times m-1}$, subselect the rows of the eigenvector matrix $V$ associated with the $N$ feature points</span></div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="comment">// And we insert a row of zeros after every third row, resulting in matrix $\hat{V}_h \in R^{4N\times m-1}$:</span></div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; Mat V_hat_h = Mat::zeros(4 * num_landmarks, num_coeffs_to_fit, CV_32FC1);</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="keywordtype">int</span> row_index = 0;</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; num_landmarks; ++i) {</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="comment">//Mat basis_rows = morphable_model.get_shape_model().get_normalised_pca_basis(vertex_ids[i]); // In the paper, the not-normalised basis might be used? I&#39;m not sure, check it. It&#39;s even a mess in the paper. PH 26.5.2014: I think the normalised basis is fine/better.</span></div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; Mat basis_rows = blendshapes_as_basis.rowRange(vertex_ids[i] * 3, (vertex_ids[i] * 3) + 3);</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="comment">//basisRows.copyTo(V_hat_h.rowRange(rowIndex, rowIndex + 3));</span></div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; basis_rows.colRange(0, num_coeffs_to_fit).copyTo(V_hat_h.rowRange(row_index, row_index + 3));</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; row_index += 4; <span class="comment">// replace 3 rows and skip the 4th one, it has all zeros</span></div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; }</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="comment">// Form a block diagonal matrix $P \in R^{3N\times 4N}$ in which the camera matrix C (P_Affine, affine_camera_matrix) is placed on the diagonal:</span></div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; Mat P = Mat::zeros(3 * num_landmarks, 4 * num_landmarks, CV_32FC1);</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; num_landmarks; ++i) {</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; Mat submatrix_to_replace = P.colRange(4 * i, (4 * i) + 4).rowRange(3 * i, (3 * i) + 3);</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; affine_camera_matrix.copyTo(submatrix_to_replace);</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; }</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="comment">// The landmarks in matrix notation (in homogeneous coordinates), $3N\times 1$</span></div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; Mat y = Mat::ones(3 * num_landmarks, 1, CV_32FC1);</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; num_landmarks; ++i) {</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; y.at&lt;<span class="keywordtype">float</span>&gt;(3 * i, 0) = landmarks[i][0];</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; y.at&lt;<span class="keywordtype">float</span>&gt;((3 * i) + 1, 0) = landmarks[i][1];</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="comment">//y.at&lt;float&gt;((3 * i) + 2, 0) = 1; // already 1, stays (homogeneous coordinate)</span></div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; }</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="comment">// The mean, with an added homogeneous coordinate (x_1, y_1, z_1, 1, x_2, ...)^t</span></div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; Mat v_bar = Mat::ones(4 * num_landmarks, 1, CV_32FC1);</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; num_landmarks; ++i) {</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="comment">//cv::Vec4f model_mean = morphable_model.get_shape_model().get_mean_at_point(vertex_ids[i]);</span></div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; cv::Vec4f model_mean(face_instance.at&lt;<span class="keywordtype">float</span>&gt;(vertex_ids[i]*3), face_instance.at&lt;<span class="keywordtype">float</span>&gt;(vertex_ids[i]*3 + 1), face_instance.at&lt;<span class="keywordtype">float</span>&gt;(vertex_ids[i]*3 + 2), 1.0f);</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; v_bar.at&lt;<span class="keywordtype">float</span>&gt;(4 * i, 0) = model_mean[0];</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; v_bar.at&lt;<span class="keywordtype">float</span>&gt;((4 * i) + 1, 0) = model_mean[1];</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; v_bar.at&lt;<span class="keywordtype">float</span>&gt;((4 * i) + 2, 0) = model_mean[2];</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="comment">//v_bar.at&lt;float&gt;((4 * i) + 3, 0) = 1; // already 1, stays (homogeneous coordinate)</span></div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="comment">// note: now that a Vec4f is returned, we could use copyTo?</span></div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; }</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <span class="comment">// Bring into standard regularised quadratic form:</span></div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; Mat A = P * V_hat_h; <span class="comment">// camera matrix times the basis</span></div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; Mat b = P * v_bar - y; <span class="comment">// camera matrix times the mean, minus the landmarks.</span></div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; </div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; Mat AtAReg = A.t() * A + lambda * Mat::eye(num_coeffs_to_fit, num_coeffs_to_fit, CV_32FC1);</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <span class="comment">// Solve using OpenCV:</span></div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; Mat c_s;</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="keywordtype">bool</span> non_singular = cv::solve(AtAReg, -A.t() * b, c_s, cv::DECOMP_SVD); <span class="comment">// DECOMP_SVD calculates the pseudo-inverse if the matrix is not invertible.</span></div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="comment">// Because we&#39;re using SVD, non_singular will always be true. If we were to use e.g. Cholesky, we could return an expected&lt;T&gt;.</span></div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; </div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="keywordflow">return</span> std::vector&lt;float&gt;(c_s);</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;};</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; } <span class="comment">/* namespace fitting */</span></div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;} <span class="comment">/* namespace eos */</span></div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* BLENDSHAPEFITTING_HPP_ */</span><span class="preprocessor"></span></div><div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&amp;#39;s 3D model fitting functionality. </div></div>
<div class="ttc" id="namespaceeos_1_1fitting_html_ac429313cbc0ed61744f1b0fa4dba672b"><div class="ttname"><a href="namespaceeos_1_1fitting.html#ac429313cbc0ed61744f1b0fa4dba672b">eos::fitting::fit_blendshapes_to_landmarks_linear</a></div><div class="ttdeci">std::vector&lt; float &gt; fit_blendshapes_to_landmarks_linear(std::vector&lt; eos::morphablemodel::Blendshape &gt; blendshapes, cv::Mat face_instance, cv::Mat affine_camera_matrix, std::vector&lt; cv::Vec2f &gt; landmarks, std::vector&lt; int &gt; vertex_ids, float lambda=500.0f)</div><div class="ttdef"><b>Definition:</b> blendshape_fitting.hpp:50</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: Member List</title> <title>eos: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -109,7 +109,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -109,7 +109,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: eos::core::LandmarkMapper Class Reference</title> <title>eos: eos::core::LandmarkMapper Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -243,7 +243,7 @@ Public Member Functions</h2></td></tr> ...@@ -243,7 +243,7 @@ Public Member Functions</h2></td></tr>
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: Member List</title> <title>eos: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -102,7 +102,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -102,7 +102,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<table class="directory"> <table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>cereal::access</b> (defined in <a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a>)</td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a></td><td class="entry"><span class="mlabel">friend</span></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>cereal::access</b> (defined in <a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a>)</td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a></td><td class="entry"><span class="mlabel">friend</span></td></tr>
<tr><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a5fd1b15edc89e89808339859570a4c09">draw_sample</a>(float shape_sigma=1.0f, float color_sigma=1.0f)</td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a5fd1b15edc89e89808339859570a4c09">draw_sample</a>(float shape_sigma=1.0f, float color_sigma=1.0f)</td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a14787e8e29f390277b10f2d0e19aa587">draw_sample</a>(std::vector&lt; float &gt; shape_coefficients, std::vector&lt; float &gt; color_coefficients)</td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a92ab3e9941de492954a1c603cf3e11c9">draw_sample</a>(std::vector&lt; float &gt; shape_coefficients, std::vector&lt; float &gt; color_coefficients) const </td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a1fff16d5d749831fa90049199101298c">get_color_model</a>() const </td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a1fff16d5d749831fa90049199101298c">get_color_model</a>() const </td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a43dcaaff84e217ea9643e37705136f31">get_mean</a>() const </td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a43dcaaff84e217ea9643e37705136f31">get_mean</a>() const </td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11">get_shape_model</a>() const </td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11">get_shape_model</a>() const </td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
...@@ -115,7 +115,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -115,7 +115,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: eos::morphablemodel::MorphableModel Class Reference</title> <title>eos: eos::morphablemodel::MorphableModel Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -119,8 +119,8 @@ Public Member Functions</h2></td></tr> ...@@ -119,8 +119,8 @@ Public Member Functions</h2></td></tr>
<tr class="separator:a43dcaaff84e217ea9643e37705136f31"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a43dcaaff84e217ea9643e37705136f31"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5fd1b15edc89e89808339859570a4c09"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structeos_1_1render_1_1_mesh.html">render::Mesh</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a5fd1b15edc89e89808339859570a4c09">draw_sample</a> (float shape_sigma=1.0f, float color_sigma=1.0f)</td></tr> <tr class="memitem:a5fd1b15edc89e89808339859570a4c09"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structeos_1_1render_1_1_mesh.html">render::Mesh</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a5fd1b15edc89e89808339859570a4c09">draw_sample</a> (float shape_sigma=1.0f, float color_sigma=1.0f)</td></tr>
<tr class="separator:a5fd1b15edc89e89808339859570a4c09"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a5fd1b15edc89e89808339859570a4c09"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a14787e8e29f390277b10f2d0e19aa587"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structeos_1_1render_1_1_mesh.html">render::Mesh</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a14787e8e29f390277b10f2d0e19aa587">draw_sample</a> (std::vector&lt; float &gt; shape_coefficients, std::vector&lt; float &gt; color_coefficients)</td></tr> <tr class="memitem:a92ab3e9941de492954a1c603cf3e11c9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structeos_1_1render_1_1_mesh.html">render::Mesh</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a92ab3e9941de492954a1c603cf3e11c9">draw_sample</a> (std::vector&lt; float &gt; shape_coefficients, std::vector&lt; float &gt; color_coefficients) const </td></tr>
<tr class="separator:a14787e8e29f390277b10f2d0e19aa587"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a92ab3e9941de492954a1c603cf3e11c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a253ca65b7f6c6cb48d4abd7b9a7f9a83"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a253ca65b7f6c6cb48d4abd7b9a7f9a83">has_color_model</a> () const </td></tr> <tr class="memitem:a253ca65b7f6c6cb48d4abd7b9a7f9a83"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a253ca65b7f6c6cb48d4abd7b9a7f9a83">has_color_model</a> () const </td></tr>
<tr class="separator:a253ca65b7f6c6cb48d4abd7b9a7f9a83"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a253ca65b7f6c6cb48d4abd7b9a7f9a83"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeffacfcafaf7dff6e21b047a2a6d22ae"><td class="memItemLeft" align="right" valign="top">std::vector&lt; cv::Vec2f &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#aeffacfcafaf7dff6e21b047a2a6d22ae">get_texture_coordinates</a> () const </td></tr> <tr class="memitem:aeffacfcafaf7dff6e21b047a2a6d22ae"><td class="memItemLeft" align="right" valign="top">std::vector&lt; cv::Vec2f &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#aeffacfcafaf7dff6e21b047a2a6d22ae">get_texture_coordinates</a> () const </td></tr>
...@@ -229,7 +229,7 @@ class&#160;</td><td class="memItemRight" valign="bottom"><b>cereal::access</b></ ...@@ -229,7 +229,7 @@ class&#160;</td><td class="memItemRight" valign="bottom"><b>cereal::access</b></
</div> </div>
</div> </div>
<a class="anchor" id="a14787e8e29f390277b10f2d0e19aa587"></a> <a class="anchor" id="a92ab3e9941de492954a1c603cf3e11c9"></a>
<div class="memitem"> <div class="memitem">
<div class="memproto"> <div class="memproto">
<table class="mlabels"> <table class="mlabels">
...@@ -251,7 +251,7 @@ class&#160;</td><td class="memItemRight" valign="bottom"><b>cereal::access</b></ ...@@ -251,7 +251,7 @@ class&#160;</td><td class="memItemRight" valign="bottom"><b>cereal::access</b></
<tr> <tr>
<td></td> <td></td>
<td>)</td> <td>)</td>
<td></td><td></td> <td></td><td> const</td>
</tr> </tr>
</table> </table>
</td> </td>
...@@ -261,7 +261,7 @@ class&#160;</td><td class="memItemRight" valign="bottom"><b>cereal::access</b></ ...@@ -261,7 +261,7 @@ class&#160;</td><td class="memItemRight" valign="bottom"><b>cereal::access</b></
</table> </table>
</div><div class="memdoc"> </div><div class="memdoc">
<p>Returns a sample from the model with the given shape- and colour PCA coefficients.</p> <p>Returns a sample from the model with the given shape- and colour PCA coefficients.</p>
<p>If one of the given vectors is empty, the mean is used. The coefficient vectors should contain normalised, i.e. standard normal distributed coefficients. If the Morphable Model is a shape-only model (without colour model), make sure to leave <code>color_coefficients</code> empty.</p> <p>If one of the given vectors is empty, the mean is used. The coefficient vectors should contain normalised, i.e. standard normal distributed coefficients. If the Morphable Model is a shape-only model (without colour model), make sure to leave <code>color_coefficients</code> empty. If a partial coefficient vector is given, it is filled with zeros up to the end.</p>
<dl class="params"><dt>Parameters</dt><dd> <dl class="params"><dt>Parameters</dt><dd>
<table class="params"> <table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">shape_coefficients</td><td>The PCA coefficients used to generate the shape sample. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">shape_coefficients</td><td>The PCA coefficients used to generate the shape sample. </td></tr>
...@@ -406,7 +406,7 @@ class&#160;</td><td class="memItemRight" valign="bottom"><b>cereal::access</b></ ...@@ -406,7 +406,7 @@ class&#160;</td><td class="memItemRight" valign="bottom"><b>cereal::access</b></
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: Member List</title> <title>eos: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -102,7 +102,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -102,7 +102,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<table class="directory"> <table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>cereal::access</b> (defined in <a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html">eos::morphablemodel::PcaModel</a>)</td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html">eos::morphablemodel::PcaModel</a></td><td class="entry"><span class="mlabel">friend</span></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>cereal::access</b> (defined in <a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html">eos::morphablemodel::PcaModel</a>)</td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html">eos::morphablemodel::PcaModel</a></td><td class="entry"><span class="mlabel">friend</span></td></tr>
<tr><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">draw_sample</a>(float sigma=1.0f)</td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html">eos::morphablemodel::PcaModel</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">draw_sample</a>(float sigma=1.0f)</td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html">eos::morphablemodel::PcaModel</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#abb5f0c6f86ab0cf9b35016441d877745">draw_sample</a>(std::vector&lt; float &gt; coefficients)</td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html">eos::morphablemodel::PcaModel</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#a1ec80573ada0d7ff6ce4e937944edeb2">draw_sample</a>(std::vector&lt; float &gt; coefficients) const </td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html">eos::morphablemodel::PcaModel</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">get_data_dimension</a>() const </td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html">eos::morphablemodel::PcaModel</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">get_data_dimension</a>() const </td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html">eos::morphablemodel::PcaModel</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8315679e0893b1bcde4f9a9aa08a137d">get_eigenvalue</a>(int index) const </td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html">eos::morphablemodel::PcaModel</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8315679e0893b1bcde4f9a9aa08a137d">get_eigenvalue</a>(int index) const </td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html">eos::morphablemodel::PcaModel</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495">get_mean</a>() const </td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html">eos::morphablemodel::PcaModel</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495">get_mean</a>() const </td><td class="entry"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html">eos::morphablemodel::PcaModel</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
...@@ -120,7 +120,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -120,7 +120,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: eos::morphablemodel::PcaModel Class Reference</title> <title>eos: eos::morphablemodel::PcaModel Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -123,8 +123,8 @@ Public Member Functions</h2></td></tr> ...@@ -123,8 +123,8 @@ Public Member Functions</h2></td></tr>
<tr class="separator:a1820ad4e0b9719884811188f3c932592"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a1820ad4e0b9719884811188f3c932592"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8dfc5fa04f9853f2e06b971b90415538"><td class="memItemLeft" align="right" valign="top">cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">draw_sample</a> (float sigma=1.0f)</td></tr> <tr class="memitem:a8dfc5fa04f9853f2e06b971b90415538"><td class="memItemLeft" align="right" valign="top">cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">draw_sample</a> (float sigma=1.0f)</td></tr>
<tr class="separator:a8dfc5fa04f9853f2e06b971b90415538"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a8dfc5fa04f9853f2e06b971b90415538"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abb5f0c6f86ab0cf9b35016441d877745"><td class="memItemLeft" align="right" valign="top">cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#abb5f0c6f86ab0cf9b35016441d877745">draw_sample</a> (std::vector&lt; float &gt; coefficients)</td></tr> <tr class="memitem:a1ec80573ada0d7ff6ce4e937944edeb2"><td class="memItemLeft" align="right" valign="top">cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#a1ec80573ada0d7ff6ce4e937944edeb2">draw_sample</a> (std::vector&lt; float &gt; coefficients) const </td></tr>
<tr class="separator:abb5f0c6f86ab0cf9b35016441d877745"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a1ec80573ada0d7ff6ce4e937944edeb2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af0597eb2cf01c98e397773740f3a8258"><td class="memItemLeft" align="right" valign="top">cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#af0597eb2cf01c98e397773740f3a8258">get_normalised_pca_basis</a> () const </td></tr> <tr class="memitem:af0597eb2cf01c98e397773740f3a8258"><td class="memItemLeft" align="right" valign="top">cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#af0597eb2cf01c98e397773740f3a8258">get_normalised_pca_basis</a> () const </td></tr>
<tr class="separator:af0597eb2cf01c98e397773740f3a8258"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:af0597eb2cf01c98e397773740f3a8258"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a66e4ef89182a98845a8a6804047f2b77"><td class="memItemLeft" align="right" valign="top">cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#a66e4ef89182a98845a8a6804047f2b77">get_normalised_pca_basis</a> (int vertex_id) const </td></tr> <tr class="memitem:a66e4ef89182a98845a8a6804047f2b77"><td class="memItemLeft" align="right" valign="top">cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#a66e4ef89182a98845a8a6804047f2b77">get_normalised_pca_basis</a> (int vertex_id) const </td></tr>
...@@ -241,7 +241,7 @@ class&#160;</td><td class="memItemRight" valign="bottom"><b>cereal::access</b></ ...@@ -241,7 +241,7 @@ class&#160;</td><td class="memItemRight" valign="bottom"><b>cereal::access</b></
</div> </div>
</div> </div>
<a class="anchor" id="abb5f0c6f86ab0cf9b35016441d877745"></a> <a class="anchor" id="a1ec80573ada0d7ff6ce4e937944edeb2"></a>
<div class="memitem"> <div class="memitem">
<div class="memproto"> <div class="memproto">
<table class="mlabels"> <table class="mlabels">
...@@ -253,7 +253,7 @@ class&#160;</td><td class="memItemRight" valign="bottom"><b>cereal::access</b></ ...@@ -253,7 +253,7 @@ class&#160;</td><td class="memItemRight" valign="bottom"><b>cereal::access</b></
<td>(</td> <td>(</td>
<td class="paramtype">std::vector&lt; float &gt;&#160;</td> <td class="paramtype">std::vector&lt; float &gt;&#160;</td>
<td class="paramname"><em>coefficients</em></td><td>)</td> <td class="paramname"><em>coefficients</em></td><td>)</td>
<td></td> <td> const</td>
</tr> </tr>
</table> </table>
</td> </td>
...@@ -377,14 +377,14 @@ class&#160;</td><td class="memItemRight" valign="bottom"><b>cereal::access</b></ ...@@ -377,14 +377,14 @@ class&#160;</td><td class="memItemRight" valign="bottom"><b>cereal::access</b></
</tr> </tr>
</table> </table>
</div><div class="memdoc"> </div><div class="memdoc">
<p>Return the value of the mean at a given vertex id.</p> <p>Return the value of the mean at a given vertex index.</p>
<dl class="params"><dt>Parameters</dt><dd> <dl class="params"><dt>Parameters</dt><dd>
<table class="params"> <table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">vertex_index</td><td>A vertex id. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">vertex_index</td><td>A vertex index. </td></tr>
</table> </table>
</dd> </dd>
</dl> </dl>
<dl class="section return"><dt>Returns</dt><dd>A homogeneous vector containing the values at the given vertex id. </dd></dl> <dl class="section return"><dt>Returns</dt><dd>A homogeneous vector containing the values at the given vertex index. </dd></dl>
</div> </div>
</div> </div>
...@@ -562,7 +562,7 @@ class&#160;</td><td class="memItemRight" valign="bottom"><b>cereal::access</b></ ...@@ -562,7 +562,7 @@ class&#160;</td><td class="memItemRight" valign="bottom"><b>cereal::access</b></
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: Member List</title> <title>eos: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -109,7 +109,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -109,7 +109,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: eos::render::Texture Class Reference</title> <title>eos: eos::render::Texture Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -100,6 +100,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -100,6 +100,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="title">eos::render::Texture Class Reference</div> </div> <div class="title">eos::render::Texture Class Reference</div> </div>
</div><!--header--> </div><!--header-->
<div class="contents"> <div class="contents">
<p>Represents a texture for rendering.
<a href="classeos_1_1render_1_1_texture.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="utils_8hpp_source.html">utils.hpp</a>&gt;</code></p>
<table class="memberdecls"> <table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr> Public Attributes</h2></td></tr>
...@@ -116,7 +121,10 @@ unsigned char&#160;</td><td class="memItemRight" valign="bottom"><b>heightLog</b ...@@ -116,7 +121,10 @@ unsigned char&#160;</td><td class="memItemRight" valign="bottom"><b>heightLog</b
unsigned int&#160;</td><td class="memItemRight" valign="bottom"><b>mipmaps_num</b></td></tr> unsigned int&#160;</td><td class="memItemRight" valign="bottom"><b>mipmaps_num</b></td></tr>
<tr class="separator:a267f0430363a6d26ec581d8b1f16ef05"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a267f0430363a6d26ec581d8b1f16ef05"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table> </table>
<hr/>The documentation for this class was generated from the following file:<ul> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Represents a texture for rendering. </p>
<p>Represents a texture and mipmap levels for use in the renderer. Todo: This whole class needs a major overhaul and documentation. </p>
</div><hr/>The documentation for this class was generated from the following file:<ul>
<li>include/eos/render/<a class="el" href="utils_8hpp_source.html">utils.hpp</a></li> <li>include/eos/render/<a class="el" href="utils_8hpp_source.html">utils.hpp</a></li>
</ul> </ul>
</div><!-- contents --> </div><!-- contents -->
...@@ -124,7 +132,7 @@ unsigned int&#160;</td><td class="memItemRight" valign="bottom"><b>mipmaps_num</ ...@@ -124,7 +132,7 @@ unsigned int&#160;</td><td class="memItemRight" valign="bottom"><b>mipmaps_num</
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: Class Index</title> <title>eos: Class Index</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -93,29 +93,31 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -93,29 +93,31 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="title">Class Index</div> </div> <div class="title">Class Index</div> </div>
</div><!--header--> </div><!--header-->
<div class="contents"> <div class="contents">
<div class="qindex"><a class="qindex" href="#letter_F">F</a>&#160;|&#160;<a class="qindex" href="#letter_L">L</a>&#160;|&#160;<a class="qindex" href="#letter_M">M</a>&#160;|&#160;<a class="qindex" href="#letter_O">O</a>&#160;|&#160;<a class="qindex" href="#letter_P">P</a>&#160;|&#160;<a class="qindex" href="#letter_T">T</a></div> <div class="qindex"><a class="qindex" href="#letter_B">B</a>&#160;|&#160;<a class="qindex" href="#letter_C">C</a>&#160;|&#160;<a class="qindex" href="#letter_F">F</a>&#160;|&#160;<a class="qindex" href="#letter_L">L</a>&#160;|&#160;<a class="qindex" href="#letter_M">M</a>&#160;|&#160;<a class="qindex" href="#letter_P">P</a>&#160;|&#160;<a class="qindex" href="#letter_R">R</a>&#160;|&#160;<a class="qindex" href="#letter_T">T</a></div>
<table style="margin: 10px; white-space: nowrap;" align="center" width="95%" border="0" cellspacing="0" cellpadding="0"> <table class="classindex">
<tr><td rowspan="2" valign="bottom"><a name="letter_F"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;F&#160;&#160;</div></td></tr></table> <tr><td rowspan="2" valign="bottom"><a name="letter_B"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;B&#160;&#160;</div></td></tr></table>
</td><td valign="top"><a class="el" href="classeos_1_1core_1_1_landmark_mapper.html">LandmarkMapper</a> (<a class="el" href="namespaceeos_1_1core.html">eos::core</a>)&#160;&#160;&#160;</td><td valign="top"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">MorphableModel</a> (<a class="el" href="namespaceeos_1_1morphablemodel.html">eos::morphablemodel</a>)&#160;&#160;&#160;</td><td rowspan="2" valign="bottom"><a name="letter_P"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;P&#160;&#160;</div></td></tr></table> </td><td rowspan="2" valign="bottom"><a name="letter_F"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;F&#160;&#160;</div></td></tr></table>
</td><td></td></tr> </td><td valign="top"><a class="el" href="classeos_1_1core_1_1_landmark_mapper.html">LandmarkMapper</a> (<a class="el" href="namespaceeos_1_1core.html">eos::core</a>)&#160;&#160;&#160;</td><td rowspan="2" valign="bottom"><a name="letter_P"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;P&#160;&#160;</div></td></tr></table>
</td><td rowspan="2" valign="bottom"><a name="letter_T"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;T&#160;&#160;</div></td></tr></table>
</td></tr>
<tr><td rowspan="2" valign="bottom"><a name="letter_M"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;M&#160;&#160;</div></td></tr></table> <tr><td rowspan="2" valign="bottom"><a name="letter_M"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;M&#160;&#160;</div></td></tr></table>
</td><td rowspan="2" valign="bottom"><a name="letter_O"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;O&#160;&#160;</div></td></tr></table> </td></tr>
</td><td></td></tr> <tr><td valign="top"><a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html">Blendshape</a> (<a class="el" href="namespaceeos_1_1morphablemodel.html">eos::morphablemodel</a>)&#160;&#160;&#160;</td><td valign="top"><a class="el" href="structeos_1_1fitting_1_1_frustum.html">Frustum</a> (<a class="el" href="namespaceeos_1_1fitting.html">eos::fitting</a>)&#160;&#160;&#160;</td><td valign="top"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html">PcaModel</a> (<a class="el" href="namespaceeos_1_1morphablemodel.html">eos::morphablemodel</a>)&#160;&#160;&#160;</td><td valign="top"><a class="el" href="classeos_1_1render_1_1_texture.html">Texture</a> (<a class="el" href="namespaceeos_1_1render.html">eos::render</a>)&#160;&#160;&#160;</td></tr>
<tr><td valign="top"><a class="el" href="structeos_1_1fitting_1_1_frustum.html">Frustum</a> (<a class="el" href="namespaceeos_1_1fitting.html">eos::fitting</a>)&#160;&#160;&#160;</td><td valign="top"><a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html">PcaModel</a> (<a class="el" href="namespaceeos_1_1morphablemodel.html">eos::morphablemodel</a>)&#160;&#160;&#160;</td><td></td></tr> <tr><td rowspan="2" valign="bottom"><a name="letter_C"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;C&#160;&#160;</div></td></tr></table>
<tr><td rowspan="2" valign="bottom"><a name="letter_L"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;L&#160;&#160;</div></td></tr></table> </td><td rowspan="2" valign="bottom"><a name="letter_L"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;L&#160;&#160;</div></td></tr></table>
</td><td valign="top"><a class="el" href="structeos_1_1render_1_1_mesh.html">Mesh</a> (<a class="el" href="namespaceeos_1_1render.html">eos::render</a>)&#160;&#160;&#160;</td><td valign="top"><a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">OrthographicRenderingParameters</a> (<a class="el" href="namespaceeos_1_1fitting.html">eos::fitting</a>)&#160;&#160;&#160;</td><td rowspan="2" valign="bottom"><a name="letter_T"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;T&#160;&#160;</div></td></tr></table> </td><td valign="top"><a class="el" href="structeos_1_1render_1_1_mesh.html">Mesh</a> (<a class="el" href="namespaceeos_1_1render.html">eos::render</a>)&#160;&#160;&#160;</td><td rowspan="2" valign="bottom"><a name="letter_R"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;R&#160;&#160;</div></td></tr></table>
</td><td></td></tr> </td><td></td></tr>
<tr><td></td><td></td><td></td></tr> <tr><td valign="top"><a class="el" href="structeos_1_1fitting_1_1_model_contour.html">ModelContour</a> (<a class="el" href="namespaceeos_1_1fitting.html">eos::fitting</a>)&#160;&#160;&#160;</td><td></td></tr>
<tr><td valign="top"><a class="el" href="structeos_1_1core_1_1_landmark.html">Landmark</a> (<a class="el" href="namespaceeos_1_1core.html">eos::core</a>)&#160;&#160;&#160;</td><td></td><td></td><td valign="top"><a class="el" href="classeos_1_1render_1_1_texture.html">Texture</a> (<a class="el" href="namespaceeos_1_1render.html">eos::render</a>)&#160;&#160;&#160;</td><td></td></tr> <tr><td valign="top"><a class="el" href="structeos_1_1fitting_1_1_contour_landmarks.html">ContourLandmarks</a> (<a class="el" href="namespaceeos_1_1fitting.html">eos::fitting</a>)&#160;&#160;&#160;</td><td valign="top"><a class="el" href="structeos_1_1core_1_1_landmark.html">Landmark</a> (<a class="el" href="namespaceeos_1_1core.html">eos::core</a>)&#160;&#160;&#160;</td><td valign="top"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">MorphableModel</a> (<a class="el" href="namespaceeos_1_1morphablemodel.html">eos::morphablemodel</a>)&#160;&#160;&#160;</td><td valign="top"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">RenderingParameters</a> (<a class="el" href="namespaceeos_1_1fitting.html">eos::fitting</a>)&#160;&#160;&#160;</td><td></td></tr>
<tr><td></td><td></td><td></td><td></td><td></td></tr> <tr><td></td><td></td><td></td><td></td><td></td></tr>
</table> </table>
<div class="qindex"><a class="qindex" href="#letter_F">F</a>&#160;|&#160;<a class="qindex" href="#letter_L">L</a>&#160;|&#160;<a class="qindex" href="#letter_M">M</a>&#160;|&#160;<a class="qindex" href="#letter_O">O</a>&#160;|&#160;<a class="qindex" href="#letter_P">P</a>&#160;|&#160;<a class="qindex" href="#letter_T">T</a></div> <div class="qindex"><a class="qindex" href="#letter_B">B</a>&#160;|&#160;<a class="qindex" href="#letter_C">C</a>&#160;|&#160;<a class="qindex" href="#letter_F">F</a>&#160;|&#160;<a class="qindex" href="#letter_L">L</a>&#160;|&#160;<a class="qindex" href="#letter_M">M</a>&#160;|&#160;<a class="qindex" href="#letter_P">P</a>&#160;|&#160;<a class="qindex" href="#letter_R">R</a>&#160;|&#160;<a class="qindex" href="#letter_T">T</a></div>
</div><!-- contents --> </div><!-- contents -->
<!-- start footer part --> <!-- start footer part -->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/morphablemodel/coefficients.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos
&#160;<span id="projectnumber">0.7.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_8c2f38a39d6204ca353f500c7575d762.html">morphablemodel</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">coefficients.hpp</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/morphablemodel/coefficients.hpp</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2016 Patrik Huber</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef COEFFICIENTS_HPP_</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define COEFFICIENTS_HPP_</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;cereal/cereal.hpp&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &quot;cereal/archives/json.hpp&quot;</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; <span class="keyword">namespace </span>morphablemodel {</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;</div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="namespaceeos_1_1morphablemodel.html#a2578fc03dbaa1809873578f17991e278"> 41</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespaceeos_1_1morphablemodel.html#a2578fc03dbaa1809873578f17991e278">save_coefficients</a>(std::vector&lt;float&gt; coefficients, std::string filename)</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;{</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; std::ofstream file(filename);</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; <span class="keywordflow">if</span> (file.fail()) {</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">&quot;Error opening file for writing: &quot;</span> + filename);</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; }</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; cereal::JSONOutputArchive output_archive(file);</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; output_archive(cereal::make_nvp(<span class="stringliteral">&quot;shape_coefficients&quot;</span>, coefficients));</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;};</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; } <span class="comment">/* namespace morphablemodel */</span></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;} <span class="comment">/* namespace eos */</span></div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* COEFFICIENTS_HPP_ */</span><span class="preprocessor"></span></div><div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&amp;#39;s 3D model fitting functionality. </div></div>
<div class="ttc" id="namespaceeos_1_1morphablemodel_html_a2578fc03dbaa1809873578f17991e278"><div class="ttname"><a href="namespaceeos_1_1morphablemodel.html#a2578fc03dbaa1809873578f17991e278">eos::morphablemodel::save_coefficients</a></div><div class="ttdeci">void save_coefficients(std::vector&lt; float &gt; coefficients, std::string filename)</div><div class="ttdef"><b>Definition:</b> coefficients.hpp:41</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/fitting/contour_correspondence.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos
&#160;<span id="projectnumber">0.7.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_5c0181df23c28f36a953fd4c7a01cbc0.html">fitting</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">contour_correspondence.hpp</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/fitting/contour_correspondence.hpp</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2015, 2016 Patrik Huber</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef CONTOURCORRESPONDENCE_HPP_</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define CONTOURCORRESPONDENCE_HPP_</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;eos/core/Landmark.hpp&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &quot;eos/morphablemodel/MorphableModel.hpp&quot;</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &quot;cereal/archives/json.hpp&quot;</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &quot;glm/gtc/matrix_transform.hpp&quot;</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor">#include &quot;boost/property_tree/ptree.hpp&quot;</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="preprocessor">#include &quot;boost/property_tree/info_parser.hpp&quot;</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="preprocessor">#include &lt;algorithm&gt;</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="preprocessor">#include &lt;fstream&gt;</span></div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <span class="keyword">namespace </span>fitting {</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;<span class="comment">// Forward declarations of later used functions and types:</span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;<span class="keyword">struct </span>ModelContour;</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;<span class="keyword">struct </span>ContourLandmarks;</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;std::pair&lt;std::vector&lt;std::string&gt;, std::vector&lt;int&gt;&gt; <a class="code" href="namespaceeos_1_1fitting.html#a6a307eaa4a1a9f2c5e2c33a95a6e261d">select_contour</a>(<span class="keywordtype">float</span> yaw_angle, <span class="keyword">const</span> ContourLandmarks&amp; contour_landmarks, <span class="keyword">const</span> ModelContour&amp; model_contour);</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;std::tuple&lt;std::vector&lt;cv::Vec2f&gt;, std::vector&lt;cv::Vec4f&gt;, std::vector&lt;int&gt;&gt; <a class="code" href="namespaceeos_1_1fitting.html#ade368ea637ac45c9e344dde326ffe174">get_nearest_contour_correspondences</a>(<span class="keyword">const</span> <a class="code" href="namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b">eos::core::LandmarkCollection&lt;cv::Vec2f&gt;</a>&amp; landmarks, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; landmark_contour_identifiers, <span class="keyword">const</span> std::vector&lt;int&gt;&amp; model_contour_indices, <span class="keyword">const</span> morphablemodel::MorphableModel&amp; morphable_model, <span class="keyword">const</span> glm::mat4x4&amp; view_model, <span class="keyword">const</span> glm::mat4x4&amp; ortho_projection, <span class="keyword">const</span> glm::vec4&amp; viewport);</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="structeos_1_1fitting_1_1_model_contour.html"> 64</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structeos_1_1fitting_1_1_model_contour.html">ModelContour</a></div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;{</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="comment">// starting from right side, eyebrow-height: (I think the order matters here)</span></div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; std::vector&lt;int&gt; right_contour;</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="comment">/* 23 = middle, below chin - not included in the contour here */</span></div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="comment">// starting from left side, eyebrow-height:</span></div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; std::vector&lt;int&gt; left_contour;</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="comment">// We store r/l separately because we currently only fit to the contour facing the camera.</span></div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="comment">// Also if we were to fit to the whole contour: Be careful not to just fit to the closest. The </span></div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="comment">// &quot;invisible&quot; ones behind might be closer on an e.g 90 angle. Store CNT for left/right side separately?</span></div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; </div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="structeos_1_1fitting_1_1_model_contour.html#a7a53f075afaeabef19a33b2e914406ce"> 86</a></span>&#160; <span class="keyword">static</span> <a class="code" href="structeos_1_1fitting_1_1_model_contour.html">ModelContour</a> <a class="code" href="structeos_1_1fitting_1_1_model_contour.html#a7a53f075afaeabef19a33b2e914406ce">load</a>(std::string filename)</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; {</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <a class="code" href="structeos_1_1fitting_1_1_model_contour.html">ModelContour</a> contour;</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; std::ifstream file(filename);</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keywordflow">if</span> (file.fail()) {</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">&quot;Error opening given file: &quot;</span> + filename);</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; }</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; cereal::JSONInputArchive input_archive(file);</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; input_archive(contour);</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keywordflow">return</span> contour;</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; };</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span>cereal::access;</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">class</span> Archive&gt;</div><div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="structeos_1_1fitting_1_1_model_contour.html#a079c6e6969f79c123ceb8efc4116d9ea"> 107</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="structeos_1_1fitting_1_1_model_contour.html#a079c6e6969f79c123ceb8efc4116d9ea">serialize</a>(Archive&amp; archive)</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; {</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; archive(cereal::make_nvp(<span class="stringliteral">&quot;right_contour&quot;</span>, right_contour), cereal::make_nvp(<span class="stringliteral">&quot;left_contour&quot;</span>, left_contour));</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; };</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;};</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;</div><div class="line"><a name="l00124"></a><span class="lineno"><a class="line" href="structeos_1_1fitting_1_1_contour_landmarks.html"> 124</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structeos_1_1fitting_1_1_contour_landmarks.html">ContourLandmarks</a></div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;{</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <span class="comment">// starting from right side, eyebrow-height.</span></div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; std::vector&lt;std::string&gt; right_contour;</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="comment">// Chin point is not included in the contour here.</span></div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <span class="comment">// starting from left side, eyebrow-height. Order doesn&#39;t matter here.</span></div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; std::vector&lt;std::string&gt; left_contour;</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="comment">// Note: We store r/l separately because we currently only fit to the contour facing the camera.</span></div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; </div><div class="line"><a name="l00142"></a><span class="lineno"><a class="line" href="structeos_1_1fitting_1_1_contour_landmarks.html#a15bb18f801e64ceaf5e07f73a1374cdb"> 142</a></span>&#160; <span class="keyword">static</span> <a class="code" href="structeos_1_1fitting_1_1_contour_landmarks.html">ContourLandmarks</a> <a class="code" href="structeos_1_1fitting_1_1_contour_landmarks.html#a15bb18f801e64ceaf5e07f73a1374cdb">load</a>(std::string filename)</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; {</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <a class="code" href="structeos_1_1fitting_1_1_contour_landmarks.html">ContourLandmarks</a> contour;</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160;</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <span class="keyword">using</span> std::string;</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="keyword">using</span> boost::property_tree::ptree;</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; ptree configtree;</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; <span class="keywordflow">try</span> {</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; boost::property_tree::info_parser::read_info(filename, configtree);</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; }</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; <span class="keywordflow">catch</span> (<span class="keyword">const</span> boost::property_tree::ptree_error&amp; error) {</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(<span class="keywordtype">string</span>(<span class="stringliteral">&quot;ContourLandmarks: Error reading landmark-mappings file: &quot;</span>) + error.what());</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; }</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160;</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <span class="keywordflow">try</span> {</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <span class="comment">// Todo: I think we should improve error handling here. When there&#39;s no contour_landmarks in the file, it</span></div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <span class="comment">// should still work, the returned vectors should just be empty.</span></div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; ptree right_contour = configtree.get_child(<span class="stringliteral">&quot;contour_landmarks.right&quot;</span>);</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp;&amp; landmark : right_contour) {</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; contour.right_contour.emplace_back(landmark.first);</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; }</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; ptree left_contour = configtree.get_child(<span class="stringliteral">&quot;contour_landmarks.left&quot;</span>);</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp;&amp; landmark : left_contour) {</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; contour.left_contour.emplace_back(landmark.first);</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; }</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; }</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; <span class="keywordflow">catch</span> (<span class="keyword">const</span> boost::property_tree::ptree_error&amp; error) {</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(<span class="keywordtype">string</span>(<span class="stringliteral">&quot;ContourLandmarks: Error while parsing the mappings file: &quot;</span>) + error.what());</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; }</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <span class="keywordflow">catch</span> (<span class="keyword">const</span> std::runtime_error&amp; error) {</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(<span class="keywordtype">string</span>(<span class="stringliteral">&quot;ContourLandmarks: Error while parsing the mappings file: &quot;</span>) + error.what());</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; }</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160;</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="keywordflow">return</span> contour;</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; };</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160;};</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160;</div><div class="line"><a name="l00202"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#af8ce6f464c22e42b5f98e96ef7f06ab0"> 202</a></span>&#160;std::tuple&lt;std::vector&lt;cv::Vec2f&gt;, std::vector&lt;cv::Vec4f&gt;, std::vector&lt;int&gt;&gt; <a class="code" href="namespaceeos_1_1fitting.html#af8ce6f464c22e42b5f98e96ef7f06ab0">get_contour_correspondences</a>(<span class="keyword">const</span> <a class="code" href="namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b">eos::core::LandmarkCollection&lt;cv::Vec2f&gt;</a>&amp; landmarks, <span class="keyword">const</span> <a class="code" href="structeos_1_1fitting_1_1_contour_landmarks.html">ContourLandmarks</a>&amp; contour_landmarks, <span class="keyword">const</span> <a class="code" href="structeos_1_1fitting_1_1_model_contour.html">ModelContour</a>&amp; model_contour, <span class="keywordtype">float</span> yaw_angle, <span class="keyword">const</span> <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html">morphablemodel::MorphableModel</a>&amp; morphable_model, <span class="keyword">const</span> glm::mat4x4&amp; view_model, <span class="keyword">const</span> glm::mat4x4&amp; ortho_projection, <span class="keyword">const</span> glm::vec4&amp; viewport)</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160;{</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; <span class="comment">// Select which side of the contour we&#39;ll use:</span></div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; std::vector&lt;int&gt; model_contour_indices;</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; std::vector&lt;std::string&gt; landmark_contour_identifiers;</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; std::tie(landmark_contour_identifiers, model_contour_indices) = <a class="code" href="namespaceeos_1_1fitting.html#a6a307eaa4a1a9f2c5e2c33a95a6e261d">select_contour</a>(glm::degrees(yaw_angle), contour_landmarks, model_contour);</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160;</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; <span class="comment">// These are the additional contour-correspondences we&#39;re going to find and then use:</span></div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; std::vector&lt;cv::Vec4f&gt; model_points_contour; <span class="comment">// the points in the 3D shape model</span></div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; std::vector&lt;int&gt; vertex_indices_contour; <span class="comment">// their vertex indices</span></div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; std::vector&lt;cv::Vec2f&gt; image_points_contour; <span class="comment">// the corresponding 2D landmark points</span></div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; </div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; <span class="comment">// For each 2D contour landmark, get the corresponding 3D vertex point and vertex id:</span></div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; <span class="comment">// Note/Todo: Loop here instead of calling this function where we have no idea what it&#39;s doing? What does its documentation say?</span></div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; <span class="keywordflow">return</span> <a class="code" href="namespaceeos_1_1fitting.html#ade368ea637ac45c9e344dde326ffe174">get_nearest_contour_correspondences</a>(landmarks, landmark_contour_identifiers, model_contour_indices, morphable_model, view_model, ortho_projection, viewport);</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160;};</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160;</div><div class="line"><a name="l00234"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#a6a307eaa4a1a9f2c5e2c33a95a6e261d"> 234</a></span>&#160;std::pair&lt;std::vector&lt;std::string&gt;, std::vector&lt;int&gt;&gt; <a class="code" href="namespaceeos_1_1fitting.html#a6a307eaa4a1a9f2c5e2c33a95a6e261d">select_contour</a>(<span class="keywordtype">float</span> yaw_angle, <span class="keyword">const</span> <a class="code" href="structeos_1_1fitting_1_1_contour_landmarks.html">ContourLandmarks</a>&amp; contour_landmarks, <span class="keyword">const</span> <a class="code" href="structeos_1_1fitting_1_1_model_contour.html">ModelContour</a>&amp; model_contour)</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160;{</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; std::vector&lt;int&gt; model_contour_indices;</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; std::vector&lt;std::string&gt; contour_landmark_identifiers;</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; <span class="keywordflow">if</span> (yaw_angle &gt;= 0.0f) { <span class="comment">// positive yaw = subject looking to the left</span></div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; model_contour_indices = model_contour.right_contour; <span class="comment">// ==&gt; we use the right cnt-lms</span></div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; contour_landmark_identifiers = contour_landmarks.right_contour;</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; }</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; <span class="keywordflow">else</span> {</div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; model_contour_indices = model_contour.left_contour;</div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; contour_landmark_identifiers = contour_landmarks.left_contour;</div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; }</div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; <span class="keywordflow">return</span> std::make_pair(contour_landmark_identifiers, model_contour_indices);</div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160;};</div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160;</div><div class="line"><a name="l00273"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#ade368ea637ac45c9e344dde326ffe174"> 273</a></span>&#160;std::tuple&lt;std::vector&lt;cv::Vec2f&gt;, std::vector&lt;cv::Vec4f&gt;, std::vector&lt;int&gt;&gt; <a class="code" href="namespaceeos_1_1fitting.html#ade368ea637ac45c9e344dde326ffe174">get_nearest_contour_correspondences</a>(<span class="keyword">const</span> <a class="code" href="namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b">eos::core::LandmarkCollection&lt;cv::Vec2f&gt;</a>&amp; landmarks, <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; landmark_contour_identifiers, <span class="keyword">const</span> std::vector&lt;int&gt;&amp; model_contour_indices, <span class="keyword">const</span> <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html">morphablemodel::MorphableModel</a>&amp; morphable_model, <span class="keyword">const</span> glm::mat4x4&amp; view_model, <span class="keyword">const</span> glm::mat4x4&amp; ortho_projection, <span class="keyword">const</span> glm::vec4&amp; viewport)</div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160;{</div><div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160; <span class="comment">// These are the additional contour-correspondences we&#39;re going to find and then use!</span></div><div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; std::vector&lt;cv::Vec4f&gt; model_points_cnt; <span class="comment">// the points in the 3D shape model</span></div><div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160; std::vector&lt;int&gt; vertex_indices_cnt; <span class="comment">// their vertex indices</span></div><div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; std::vector&lt;cv::Vec2f&gt; image_points_cnt; <span class="comment">// the corresponding 2D landmark points</span></div><div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160;</div><div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; <span class="comment">// For each 2D-CNT-LM, find the closest 3DMM-CNT-LM and add to correspondences:</span></div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; <span class="comment">// Note: If we were to do this for all 3DMM vertices, then ray-casting (i.e. glm::unproject) would be quicker to find the closest vertex)</span></div><div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp;&amp; ibug_idx : landmark_contour_identifiers)</div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; {</div><div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; <span class="comment">// Check if the contour landmark is amongst the landmarks given to us (from detector or ground truth):</span></div><div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160; <span class="comment">// (Note: Alternatively, we could filter landmarks beforehand and then just loop over landmarks =&gt; means one less function param here. Separate filtering from actual algorithm.)</span></div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; <span class="keyword">auto</span> result = std::find_if(begin(landmarks), end(landmarks), [&amp;ibug_idx](<span class="keyword">auto</span>&amp;&amp; e) { <span class="keywordflow">return</span> e.name == ibug_idx; }); <span class="comment">// =&gt; this can go outside the loop</span></div><div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160; <span class="comment">// TODO Check for ::end!!! if it&#39;s not found!</span></div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; cv::Vec2f screen_point_2d_contour_landmark = result-&gt;coordinates;</div><div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160;</div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160; std::vector&lt;float&gt; distances_2d;</div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp;&amp; model_contour_vertex_idx : model_contour_indices) <span class="comment">// we could actually pre-project them, i.e. only project them once, not for each landmark newly...</span></div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; {</div><div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; <span class="keyword">auto</span> vertex = morphable_model.<a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11">get_shape_model</a>().<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a1820ad4e0b9719884811188f3c932592">get_mean_at_point</a>(model_contour_vertex_idx);</div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160; glm::vec3 proj = glm::project(glm::vec3{ vertex[0], vertex[1], vertex[2] }, view_model, ortho_projection, viewport);</div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; cv::Vec2f screen_point_model_contour(proj.x, proj.y);</div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160;</div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160; <span class="keywordtype">double</span> dist = cv::norm(screen_point_model_contour, screen_point_2d_contour_landmark, cv::NORM_L2);</div><div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; distances_2d.emplace_back(dist);</div><div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160; }</div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160; <span class="keyword">auto</span> min_ele = std::min_element(begin(distances_2d), end(distances_2d));</div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160; <span class="comment">// Todo: Cover the case when cnt_indices_to_use.size() is 0.</span></div><div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160; <span class="keyword">auto</span> min_ele_idx = std::distance(begin(distances_2d), min_ele);</div><div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160; <span class="keyword">auto</span> the_3dmm_vertex_id_that_is_closest = model_contour_indices[min_ele_idx];</div><div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160;</div><div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160; cv::Vec4f vertex = morphable_model.<a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11">get_shape_model</a>().<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a1820ad4e0b9719884811188f3c932592">get_mean_at_point</a>(the_3dmm_vertex_id_that_is_closest);</div><div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160; model_points_cnt.emplace_back(vertex);</div><div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160; vertex_indices_cnt.emplace_back(the_3dmm_vertex_id_that_is_closest);</div><div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160; image_points_cnt.emplace_back(screen_point_2d_contour_landmark);</div><div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160; }</div><div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160;</div><div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160; <span class="keywordflow">return</span> std::make_tuple(image_points_cnt, model_points_cnt, vertex_indices_cnt);</div><div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160;};</div><div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160;</div><div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160; } <span class="comment">/* namespace fitting */</span></div><div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160;} <span class="comment">/* namespace eos */</span></div><div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160;</div><div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* CONTOURCORRESPONDENCE_HPP_ */</span><span class="preprocessor"></span></div><div class="ttc" id="structeos_1_1fitting_1_1_contour_landmarks_html_a15bb18f801e64ceaf5e07f73a1374cdb"><div class="ttname"><a href="structeos_1_1fitting_1_1_contour_landmarks.html#a15bb18f801e64ceaf5e07f73a1374cdb">eos::fitting::ContourLandmarks::load</a></div><div class="ttdeci">static ContourLandmarks load(std::string filename)</div><div class="ttdef"><b>Definition:</b> contour_correspondence.hpp:142</div></div>
<div class="ttc" id="namespaceeos_1_1fitting_html_af8ce6f464c22e42b5f98e96ef7f06ab0"><div class="ttname"><a href="namespaceeos_1_1fitting.html#af8ce6f464c22e42b5f98e96ef7f06ab0">eos::fitting::get_contour_correspondences</a></div><div class="ttdeci">std::tuple&lt; std::vector&lt; cv::Vec2f &gt;, std::vector&lt; cv::Vec4f &gt;, std::vector&lt; int &gt; &gt; get_contour_correspondences(const eos::core::LandmarkCollection&lt; cv::Vec2f &gt; &amp;landmarks, const ContourLandmarks &amp;contour_landmarks, const ModelContour &amp;model_contour, float yaw_angle, const morphablemodel::MorphableModel &amp;morphable_model, const glm::mat4x4 &amp;view_model, const glm::mat4x4 &amp;ortho_projection, const glm::vec4 &amp;viewport)</div><div class="ttdef"><b>Definition:</b> contour_correspondence.hpp:202</div></div>
<div class="ttc" id="namespaceeos_1_1fitting_html_a6a307eaa4a1a9f2c5e2c33a95a6e261d"><div class="ttname"><a href="namespaceeos_1_1fitting.html#a6a307eaa4a1a9f2c5e2c33a95a6e261d">eos::fitting::select_contour</a></div><div class="ttdeci">std::pair&lt; std::vector&lt; std::string &gt;, std::vector&lt; int &gt; &gt; select_contour(float yaw_angle, const ContourLandmarks &amp;contour_landmarks, const ModelContour &amp;model_contour)</div><div class="ttdef"><b>Definition:</b> contour_correspondence.hpp:234</div></div>
<div class="ttc" id="namespaceeos_1_1core_html_a6d6a8533690b5860236f55afafa14d2b"><div class="ttname"><a href="namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b">eos::core::LandmarkCollection</a></div><div class="ttdeci">std::vector&lt; Landmark&lt; LandmarkType &gt;&gt; LandmarkCollection</div><div class="ttdoc">A trivial collection of landmarks that belong together. </div><div class="ttdef"><b>Definition:</b> Landmark.hpp:46</div></div>
<div class="ttc" id="structeos_1_1fitting_1_1_model_contour_html"><div class="ttname"><a href="structeos_1_1fitting_1_1_model_contour.html">eos::fitting::ModelContour</a></div><div class="ttdoc">Definition of the vertex indices that define the right and left model contour. </div><div class="ttdef"><b>Definition:</b> contour_correspondence.hpp:64</div></div>
<div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&amp;#39;s 3D model fitting functionality. </div></div>
<div class="ttc" id="structeos_1_1fitting_1_1_contour_landmarks_html"><div class="ttname"><a href="structeos_1_1fitting_1_1_contour_landmarks.html">eos::fitting::ContourLandmarks</a></div><div class="ttdoc">Defines which 2D landmarks comprise the right and left face contour. </div><div class="ttdef"><b>Definition:</b> contour_correspondence.hpp:124</div></div>
<div class="ttc" id="structeos_1_1fitting_1_1_model_contour_html_a079c6e6969f79c123ceb8efc4116d9ea"><div class="ttname"><a href="structeos_1_1fitting_1_1_model_contour.html#a079c6e6969f79c123ceb8efc4116d9ea">eos::fitting::ModelContour::serialize</a></div><div class="ttdeci">void serialize(Archive &amp;archive)</div><div class="ttdef"><b>Definition:</b> contour_correspondence.hpp:107</div></div>
<div class="ttc" id="structeos_1_1fitting_1_1_model_contour_html_a7a53f075afaeabef19a33b2e914406ce"><div class="ttname"><a href="structeos_1_1fitting_1_1_model_contour.html#a7a53f075afaeabef19a33b2e914406ce">eos::fitting::ModelContour::load</a></div><div class="ttdeci">static ModelContour load(std::string filename)</div><div class="ttdef"><b>Definition:</b> contour_correspondence.hpp:86</div></div>
<div class="ttc" id="namespaceeos_1_1fitting_html_ade368ea637ac45c9e344dde326ffe174"><div class="ttname"><a href="namespaceeos_1_1fitting.html#ade368ea637ac45c9e344dde326ffe174">eos::fitting::get_nearest_contour_correspondences</a></div><div class="ttdeci">std::tuple&lt; std::vector&lt; cv::Vec2f &gt;, std::vector&lt; cv::Vec4f &gt;, std::vector&lt; int &gt; &gt; get_nearest_contour_correspondences(const eos::core::LandmarkCollection&lt; cv::Vec2f &gt; &amp;landmarks, const std::vector&lt; std::string &gt; &amp;landmark_contour_identifiers, const std::vector&lt; int &gt; &amp;model_contour_indices, const morphablemodel::MorphableModel &amp;morphable_model, const glm::mat4x4 &amp;view_model, const glm::mat4x4 &amp;ortho_projection, const glm::vec4 &amp;viewport)</div><div class="ttdef"><b>Definition:</b> contour_correspondence.hpp:273</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html_a990bf9c518307c811691facb8c1daa11"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11">eos::morphablemodel::MorphableModel::get_shape_model</a></div><div class="ttdeci">PcaModel get_shape_model() const </div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:77</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_a1820ad4e0b9719884811188f3c932592"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#a1820ad4e0b9719884811188f3c932592">eos::morphablemodel::PcaModel::get_mean_at_point</a></div><div class="ttdeci">cv::Vec4f get_mean_at_point(int vertex_index) const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:130</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a></div><div class="ttdoc">A class representing a 3D Morphable Model, consisting of a shape- and colour (albedo) PCA model...</div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:54</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/morphablemodel/io/cvssp.hpp Source File</title> <title>eos: include/eos/morphablemodel/io/cvssp.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div id="nav-path" class="navpath"> <div id="nav-path" class="navpath">
<ul> <ul>
<li class="navelem"><a class="el" href="dir_ce53d3124a8ddb93985ce6ec479297f4.html">include</a></li><li class="navelem"><a class="el" href="dir_c7ebde285fcef06dba0b090642612638.html">eos</a></li><li class="navelem"><a class="el" href="dir_a487f496b1daaab0ce4d44d536b7440b.html">morphablemodel</a></li><li class="navelem"><a class="el" href="dir_98df3b346fc34412198a19044150842b.html">io</a></li> </ul> <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_8c2f38a39d6204ca353f500c7575d762.html">morphablemodel</a></li><li class="navelem"><a class="el" href="dir_987dbb4ef52a44c98ac43896696e0fee.html">io</a></li> </ul>
</div> </div>
</div><!-- top --> </div><!-- top -->
<div class="header"> <div class="header">
...@@ -95,265 +95,19 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -95,265 +95,19 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="title">cvssp.hpp</div> </div> <div class="title">cvssp.hpp</div> </div>
</div><!--header--> </div><!--header-->
<div class="contents"> <div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div> <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/morphablemodel/io/cvssp.hpp</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2014, 2015 Patrik Huber</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef IO_CVSSP_HPP_</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define IO_CVSSP_HPP_</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;eos/morphablemodel/MorphableModel.hpp&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &quot;boost/filesystem/path.hpp&quot;</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; <span class="keyword">namespace </span>morphablemodel {</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="comment">// Forward declaration</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;std::vector&lt;cv::Vec2f&gt; <a class="code" href="namespaceeos_1_1morphablemodel.html#afa73fdf5b394458b7e21639ae50d074c">load_isomap</a>(boost::filesystem::path isomap_file);</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;</div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="namespaceeos_1_1morphablemodel.html#a0d607b8838d70cd8ec41cb4bfe116f58"> 59</a></span>&#160;<a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html">MorphableModel</a> <a class="code" href="namespaceeos_1_1morphablemodel.html#a0d607b8838d70cd8ec41cb4bfe116f58">load_scm_model</a>(boost::filesystem::path model_filename, boost::filesystem::path isomap_file = boost::filesystem::path())</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;{</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; <span class="keyword">using</span> cv::Mat;</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="keywordflow">if</span> (<span class="keyword">sizeof</span>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>) != 4) { <span class="comment">// note/todo: maybe use uint32 or similar instead? Yep, but still we could encounter endianness-trouble.</span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; std::cout &lt;&lt; <span class="stringliteral">&quot;Warning: We&#39;re reading 4 Bytes from the file but sizeof(unsigned int) != 4. Check the code/behaviour.&quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; }</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="keywordflow">if</span> (<span class="keyword">sizeof</span>(<span class="keywordtype">double</span>) != 8) {</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; std::cout &lt;&lt; <span class="stringliteral">&quot;Warning: We&#39;re reading 8 Bytes from the file but sizeof(double) != 8. Check the code/behaviour.&quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; }</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; std::ifstream modelFile(model_filename.string(), std::ios::binary);</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="keywordflow">if</span> (!modelFile.is_open()) {</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; std::string msg(<span class="stringliteral">&quot;Unable to open model file: &quot;</span> + model_filename.string());</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; std::cout &lt;&lt; msg &lt;&lt; std::endl;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(msg);</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; }</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="comment">// Reading the shape model</span></div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="comment">// Read (reference?) num triangles and vertices</span></div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numVertices = 0;</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numTriangles = 0;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;numVertices), 4); <span class="comment">// 1 char = 1 byte. uint32=4bytes. float64=8bytes.</span></div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;numTriangles), 4);</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="comment">// Read triangles</span></div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; std::vector&lt;std::array&lt;int, 3&gt;&gt; triangleList;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; triangleList.resize(numTriangles);</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> v0, v1, v2;</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; numTriangles; ++i) {</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; v0 = v1 = v2 = 0;</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;v0), 4); <span class="comment">// would be nice to pass a &amp;vector and do it in one</span></div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;v1), 4); <span class="comment">// go, but didn&#39;t work. Maybe a cv::Mat would work?</span></div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;v2), 4);</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; triangleList[i][0] = v0;</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; triangleList[i][1] = v1;</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; triangleList[i][2] = v2;</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; }</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="comment">// Read number of rows and columns of the shape projection matrix (pcaBasis)</span></div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numShapePcaCoeffs = 0;</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numShapeDims = 0; <span class="comment">// dimension of the shape vector (3*numVertices)</span></div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;numShapePcaCoeffs), 4);</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;numShapeDims), 4);</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <span class="keywordflow">if</span> (3 * numVertices != numShapeDims) {</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; std::cout &lt;&lt; <span class="stringliteral">&quot;Warning: Number of shape dimensions is not equal to three times the number of vertices. Something will probably go wrong during the loading.&quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; }</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="comment">// Read shape projection matrix</span></div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; Mat unnormalisedPcaBasisShape(numShapeDims, numShapePcaCoeffs, CV_32FC1); <span class="comment">// m x n (rows x cols) = numShapeDims x numShapePcaCoeffs</span></div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; std::cout &lt;&lt; <span class="stringliteral">&quot;Loading shape PCA basis matrix with &quot;</span> &lt;&lt; unnormalisedPcaBasisShape.rows &lt;&lt; <span class="stringliteral">&quot; rows and &quot;</span> &lt;&lt; unnormalisedPcaBasisShape.cols &lt;&lt; <span class="stringliteral">&quot; cols.&quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> col = 0; col &lt; numShapePcaCoeffs; ++col) {</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> row = 0; row &lt; numShapeDims; ++row) {</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="keywordtype">double</span> var = 0.0;</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;var), 8);</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; unnormalisedPcaBasisShape.at&lt;<span class="keywordtype">float</span>&gt;(row, col) = static_cast&lt;float&gt;(var);</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; }</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; }</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="comment">// Read mean shape vector</span></div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numMean = 0; <span class="comment">// dimension of the mean (3*numVertices)</span></div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;numMean), 4);</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="keywordflow">if</span> (numMean != numShapeDims) {</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; std::cout &lt;&lt; <span class="stringliteral">&quot;Warning: Number of shape dimensions is not equal to the number of dimensions of the mean. Something will probably go wrong during the loading.&quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; }</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; Mat meanShape(numMean, 1, CV_32FC1);</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> counter = 0;</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <span class="keywordtype">double</span> vd0, vd1, vd2;</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; numMean / 3; ++i) {</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; vd0 = vd1 = vd2 = 0.0;</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;vd0), 8);</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;vd1), 8);</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;vd2), 8);</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; meanShape.at&lt;<span class="keywordtype">float</span>&gt;(counter, 0) = static_cast&lt;float&gt;(vd0);</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; ++counter;</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; meanShape.at&lt;<span class="keywordtype">float</span>&gt;(counter, 0) = static_cast&lt;float&gt;(vd1);</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; ++counter;</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; meanShape.at&lt;<span class="keywordtype">float</span>&gt;(counter, 0) = static_cast&lt;float&gt;(vd2);</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; ++counter;</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; }</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <span class="comment">// Read shape eigenvalues</span></div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numEigenValsShape = 0;</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;numEigenValsShape), 4);</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <span class="keywordflow">if</span> (numEigenValsShape != numShapePcaCoeffs) {</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; std::cout &lt;&lt; <span class="stringliteral">&quot;Warning: Number of coefficients in the PCA basis matrix is not equal to the number of eigenvalues. Something will probably go wrong during the loading.&quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; }</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; Mat eigenvaluesShape(numEigenValsShape, 1, CV_32FC1);</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; numEigenValsShape; ++i) {</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; <span class="keywordtype">double</span> var = 0.0;</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;var), 8);</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; eigenvaluesShape.at&lt;<span class="keywordtype">float</span>&gt;(i, 0) = static_cast&lt;float&gt;(var);</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; }</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160;</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <span class="comment">// We read the unnormalised basis from the file. Now let&#39;s normalise it and store the normalised basis separately.</span></div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; Mat normalisedPcaBasisShape = <a class="code" href="namespaceeos_1_1morphablemodel.html#a31a2b98e73170ae558f6c50e76524817">normalise_pca_basis</a>(unnormalisedPcaBasisShape, eigenvaluesShape);</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html">PcaModel</a> shapeModel(meanShape, normalisedPcaBasisShape, eigenvaluesShape, triangleList);</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <span class="comment">// Reading the color model</span></div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; <span class="comment">// Read number of rows and columns of projection matrix</span></div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numTexturePcaCoeffs = 0;</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numTextureDims = 0;</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;numTexturePcaCoeffs), 4);</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;numTextureDims), 4);</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <span class="comment">// Read color projection matrix</span></div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; Mat unnormalisedPcaBasisColor(numTextureDims, numTexturePcaCoeffs, CV_32FC1);</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; std::cout &lt;&lt; <span class="stringliteral">&quot;Loading color PCA basis matrix with &quot;</span> &lt;&lt; unnormalisedPcaBasisColor.rows &lt;&lt; <span class="stringliteral">&quot; rows and &quot;</span> &lt;&lt; unnormalisedPcaBasisColor.cols &lt;&lt; <span class="stringliteral">&quot; cols.&quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> col = 0; col &lt; numTexturePcaCoeffs; ++col) {</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> row = 0; row &lt; numTextureDims; ++row) {</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <span class="keywordtype">double</span> var = 0.0;</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;var), 8);</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; unnormalisedPcaBasisColor.at&lt;<span class="keywordtype">float</span>&gt;(row, col) = static_cast&lt;float&gt;(var);</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; }</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; }</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160;</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="comment">// Read mean color vector</span></div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numMeanColor = 0; <span class="comment">// dimension of the mean (3*numVertices)</span></div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;numMeanColor), 4);</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; Mat meanColor(numMeanColor, 1, CV_32FC1);</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; counter = 0;</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; numMeanColor / 3; ++i) {</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; vd0 = vd1 = vd2 = 0.0;</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;vd0), 8); <span class="comment">// order in hdf5: RGB. Order in OCV: BGR. But order in vertex.color: RGB</span></div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;vd1), 8);</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;vd2), 8);</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; meanColor.at&lt;<span class="keywordtype">float</span>&gt;(counter, 0) = static_cast&lt;float&gt;(vd0);</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; ++counter;</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; meanColor.at&lt;<span class="keywordtype">float</span>&gt;(counter, 0) = static_cast&lt;float&gt;(vd1);</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; ++counter;</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; meanColor.at&lt;<span class="keywordtype">float</span>&gt;(counter, 0) = static_cast&lt;float&gt;(vd2);</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; ++counter;</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; }</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160;</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; <span class="comment">// Read color eigenvalues</span></div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numEigenValsColor = 0;</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;numEigenValsColor), 4);</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; Mat eigenvaluesColor(numEigenValsColor, 1, CV_32FC1);</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; numEigenValsColor; ++i) {</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; <span class="keywordtype">double</span> var = 0.0;</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;var), 8);</div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; eigenvaluesColor.at&lt;<span class="keywordtype">float</span>&gt;(i, 0) = static_cast&lt;float&gt;(var);</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; }</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160;</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; <span class="comment">// We read the unnormalised basis from the file. Now let&#39;s normalise it and store the normalised basis separately.</span></div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; Mat normalisedPcaBasisColor = <a class="code" href="namespaceeos_1_1morphablemodel.html#a31a2b98e73170ae558f6c50e76524817">normalise_pca_basis</a>(unnormalisedPcaBasisColor, eigenvaluesColor);</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html">PcaModel</a> colorModel(meanColor, normalisedPcaBasisColor, eigenvaluesColor, triangleList);</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160;</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; modelFile.close();</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160;</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; <span class="comment">// Load the isomap with texture coordinates if a filename has been given:</span></div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; std::vector&lt;cv::Vec2f&gt; texCoords;</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; <span class="keywordflow">if</span> (!isomap_file.empty()) {</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; texCoords = <a class="code" href="namespaceeos_1_1morphablemodel.html#afa73fdf5b394458b7e21639ae50d074c">load_isomap</a>(isomap_file);</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; <span class="keywordflow">if</span> (shapeModel.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">get_data_dimension</a>() / 3.0f != texCoords.size()) {</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; std::string errorMessage(<span class="stringliteral">&quot;Error, wrong number of texture coordinates. Don&#39;t have the same number of texcoords than the shape model has vertices.&quot;</span>);</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; std::cout &lt;&lt; errorMessage &lt;&lt; std::endl;</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(errorMessage);</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; }</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; }</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160;</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html">MorphableModel</a>(shapeModel, colorModel, texCoords);</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160;};</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160;</div><div class="line"><a name="l00231"></a><span class="lineno"><a class="line" href="namespaceeos_1_1morphablemodel.html#afa73fdf5b394458b7e21639ae50d074c"> 231</a></span>&#160;std::vector&lt;cv::Vec2f&gt; <a class="code" href="namespaceeos_1_1morphablemodel.html#afa73fdf5b394458b7e21639ae50d074c">load_isomap</a>(boost::filesystem::path isomapFile)</div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160;{</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; <span class="keyword">using</span> std::string;</div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; std::vector&lt;float&gt; xCoords, yCoords;</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; <span class="keywordtype">string</span> line;</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; std::ifstream myfile(isomapFile.string());</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; <span class="keywordflow">if</span> (!myfile.is_open()) {</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; <span class="keywordtype">string</span> logMessage(<span class="stringliteral">&quot;The isomap file could not be opened. Did you specify a correct filename? &quot;</span> + isomapFile.string());</div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(logMessage);</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; }</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; <span class="keywordflow">else</span> {</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; <span class="keywordflow">while</span> (getline(myfile, line))</div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; {</div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; std::istringstream iss(line);</div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; <span class="keywordtype">string</span> x, y;</div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; iss &gt;&gt; x &gt;&gt; y;</div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; xCoords.push_back(std::stof(x));</div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; yCoords.push_back(std::stof(y));</div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; }</div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; myfile.close();</div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; }</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; <span class="comment">// Process the coordinates: Find the min/max and rescale to [0, 1] x [0, 1]</span></div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; <span class="keyword">auto</span> minMaxX = std::minmax_element(begin(xCoords), end(xCoords)); <span class="comment">// minMaxX is a pair, first=min, second=max</span></div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; <span class="keyword">auto</span> minMaxY = std::minmax_element(begin(yCoords), end(yCoords));</div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160;</div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; std::vector&lt;cv::Vec2f&gt; texCoords;</div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; <span class="keywordtype">float</span> divisorX = *minMaxX.second - *minMaxX.first;</div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; <span class="keywordtype">float</span> divisorY = *minMaxY.second - *minMaxY.first;</div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; xCoords.size(); ++i) {</div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; texCoords.push_back(cv::Vec2f((xCoords[i] - *minMaxX.first) / divisorX, 1.0f - (yCoords[i] - *minMaxY.first) / divisorY)); <span class="comment">// We rescale to [0, 1] and at the same time flip the y-coords (because in the isomap, the coordinates are stored upside-down).</span></div><div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; }</div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160;</div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; <span class="keywordflow">return</span> texCoords;</div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160;};</div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160;</div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160; } <span class="comment">/* namespace morphablemodel */</span></div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160;} <span class="comment">/* namespace eos */</span></div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160;</div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* IO_CVSSP_HPP_ */</span><span class="preprocessor"></span></div><div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html">eos::morphablemodel::PcaModel</a></div><div class="ttdoc">This class represents a PCA-model that consists of: </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:55</div></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_acdf68d929079eab57ab4990c468a9e0d"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">eos::morphablemodel::PcaModel::get_data_dimension</a></div><div class="ttdeci">int get_data_dimension() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:98</div></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div> <div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&amp;#39;s 3D model fitting functionality. </div></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/morphablemodel/io/cvssp.hpp</span></div> <div class="ttc" id="namespaceeos_1_1morphablemodel_html_a0d607b8838d70cd8ec41cb4bfe116f58"><div class="ttname"><a href="namespaceeos_1_1morphablemodel.html#a0d607b8838d70cd8ec41cb4bfe116f58">eos::morphablemodel::load_scm_model</a></div><div class="ttdeci">MorphableModel load_scm_model(boost::filesystem::path model_filename, boost::filesystem::path isomap_file=boost::filesystem::path())</div><div class="ttdef"><b>Definition:</b> cvssp.hpp:59</div></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div> <div class="ttc" id="namespaceeos_1_1morphablemodel_html_a31a2b98e73170ae558f6c50e76524817"><div class="ttname"><a href="namespaceeos_1_1morphablemodel.html#a31a2b98e73170ae558f6c50e76524817">eos::morphablemodel::normalise_pca_basis</a></div><div class="ttdeci">cv::Mat normalise_pca_basis(cv::Mat unnormalised_basis, cv::Mat eigenvalues)</div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:285</div></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2014, 2015 Patrik Huber</span></div> <div class="ttc" id="namespaceeos_1_1morphablemodel_html_afa73fdf5b394458b7e21639ae50d074c"><div class="ttname"><a href="namespaceeos_1_1morphablemodel.html#afa73fdf5b394458b7e21639ae50d074c">eos::morphablemodel::load_isomap</a></div><div class="ttdeci">std::vector&lt; cv::Vec2f &gt; load_isomap(boost::filesystem::path isomap_file)</div><div class="ttdef"><b>Definition:</b> cvssp.hpp:231</div></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef IO_CVSSP_HPP_</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define IO_CVSSP_HPP_</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;eos/morphablemodel/MorphableModel.hpp&quot;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#ifdef WIN32</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor"> #define BOOST_ALL_DYN_LINK // Link against the dynamic boost lib. Seems to be necessary because we use /MD, i.e. link to the dynamic CRT.</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor"> #define BOOST_ALL_NO_LIB // Don&#39;t use the automatic library linking by boost with VS2010 (#pragma ...). Instead, we specify everything in cmake.</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="preprocessor">#include &quot;boost/filesystem/path.hpp&quot;</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; <span class="keyword">namespace </span>morphablemodel {</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="comment">// Forward declaration</span></div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;std::vector&lt;cv::Vec2f&gt; <a class="code" href="namespaceeos_1_1morphablemodel.html#afa73fdf5b394458b7e21639ae50d074c">load_isomap</a>(boost::filesystem::path isomap_file);</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;</div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="namespaceeos_1_1morphablemodel.html#a0d607b8838d70cd8ec41cb4bfe116f58"> 63</a></span>&#160;<a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html">MorphableModel</a> <a class="code" href="namespaceeos_1_1morphablemodel.html#a0d607b8838d70cd8ec41cb4bfe116f58">load_scm_model</a>(boost::filesystem::path model_filename, boost::filesystem::path isomap_file = boost::filesystem::path())</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;{</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="keyword">using</span> cv::Mat;</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keywordflow">if</span> (<span class="keyword">sizeof</span>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>) != 4) { <span class="comment">// note/todo: maybe use uint32 or similar instead? Yep, but still we could encounter endianness-trouble.</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; std::cout &lt;&lt; <span class="stringliteral">&quot;Warning: We&#39;re reading 4 Bytes from the file but sizeof(unsigned int) != 4. Check the code/behaviour.&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; }</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="keywordflow">if</span> (<span class="keyword">sizeof</span>(<span class="keywordtype">double</span>) != 8) {</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; std::cout &lt;&lt; <span class="stringliteral">&quot;Warning: We&#39;re reading 8 Bytes from the file but sizeof(double) != 8. Check the code/behaviour.&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; }</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; std::ifstream modelFile(model_filename.string(), std::ios::binary);</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="keywordflow">if</span> (!modelFile.is_open()) {</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; std::string msg(<span class="stringliteral">&quot;Unable to open model file: &quot;</span> + model_filename.string());</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; std::cout &lt;&lt; msg &lt;&lt; std::endl;</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(msg);</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; }</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; <span class="comment">// Reading the shape model</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="comment">// Read (reference?) num triangles and vertices</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numVertices = 0;</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numTriangles = 0;</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;numVertices), 4); <span class="comment">// 1 char = 1 byte. uint32=4bytes. float64=8bytes.</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;numTriangles), 4);</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="comment">// Read triangles</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; std::vector&lt;std::array&lt;int, 3&gt;&gt; triangleList;</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; triangleList.resize(numTriangles);</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> v0, v1, v2;</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; numTriangles; ++i) {</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; v0 = v1 = v2 = 0;</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;v0), 4); <span class="comment">// would be nice to pass a &amp;vector and do it in one</span></div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;v1), 4); <span class="comment">// go, but didn&#39;t work. Maybe a cv::Mat would work?</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;v2), 4);</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; triangleList[i][0] = v0;</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; triangleList[i][1] = v1;</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; triangleList[i][2] = v2;</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; }</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <span class="comment">// Read number of rows and columns of the shape projection matrix (pcaBasis)</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numShapePcaCoeffs = 0;</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numShapeDims = 0; <span class="comment">// dimension of the shape vector (3*numVertices)</span></div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;numShapePcaCoeffs), 4);</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;numShapeDims), 4);</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="keywordflow">if</span> (3 * numVertices != numShapeDims) {</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; std::cout &lt;&lt; <span class="stringliteral">&quot;Warning: Number of shape dimensions is not equal to three times the number of vertices. Something will probably go wrong during the loading.&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; }</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="comment">// Read shape projection matrix</span></div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; Mat unnormalisedPcaBasisShape(numShapeDims, numShapePcaCoeffs, CV_32FC1); <span class="comment">// m x n (rows x cols) = numShapeDims x numShapePcaCoeffs</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; std::cout &lt;&lt; <span class="stringliteral">&quot;Loading shape PCA basis matrix with &quot;</span> &lt;&lt; unnormalisedPcaBasisShape.rows &lt;&lt; <span class="stringliteral">&quot; rows and &quot;</span> &lt;&lt; unnormalisedPcaBasisShape.cols &lt;&lt; <span class="stringliteral">&quot; cols.&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> col = 0; col &lt; numShapePcaCoeffs; ++col) {</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> row = 0; row &lt; numShapeDims; ++row) {</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="keywordtype">double</span> var = 0.0;</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;var), 8);</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; unnormalisedPcaBasisShape.at&lt;<span class="keywordtype">float</span>&gt;(row, col) = static_cast&lt;float&gt;(var);</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; }</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; }</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <span class="comment">// Read mean shape vector</span></div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numMean = 0; <span class="comment">// dimension of the mean (3*numVertices)</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;numMean), 4);</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <span class="keywordflow">if</span> (numMean != numShapeDims) {</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; std::cout &lt;&lt; <span class="stringliteral">&quot;Warning: Number of shape dimensions is not equal to the number of dimensions of the mean. Something will probably go wrong during the loading.&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; }</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; Mat meanShape(numMean, 1, CV_32FC1);</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> counter = 0;</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="keywordtype">double</span> vd0, vd1, vd2;</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; numMean / 3; ++i) {</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; vd0 = vd1 = vd2 = 0.0;</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;vd0), 8);</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;vd1), 8);</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;vd2), 8);</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; meanShape.at&lt;<span class="keywordtype">float</span>&gt;(counter, 0) = static_cast&lt;float&gt;(vd0);</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; ++counter;</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; meanShape.at&lt;<span class="keywordtype">float</span>&gt;(counter, 0) = static_cast&lt;float&gt;(vd1);</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; ++counter;</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; meanShape.at&lt;<span class="keywordtype">float</span>&gt;(counter, 0) = static_cast&lt;float&gt;(vd2);</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; ++counter;</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; }</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <span class="comment">// Read shape eigenvalues</span></div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numEigenValsShape = 0;</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;numEigenValsShape), 4);</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <span class="keywordflow">if</span> (numEigenValsShape != numShapePcaCoeffs) {</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; std::cout &lt;&lt; <span class="stringliteral">&quot;Warning: Number of coefficients in the PCA basis matrix is not equal to the number of eigenvalues. Something will probably go wrong during the loading.&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; }</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; Mat eigenvaluesShape(numEigenValsShape, 1, CV_32FC1);</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; numEigenValsShape; ++i) {</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="keywordtype">double</span> var = 0.0;</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;var), 8);</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; eigenvaluesShape.at&lt;<span class="keywordtype">float</span>&gt;(i, 0) = static_cast&lt;float&gt;(var);</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; }</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <span class="comment">// We read the unnormalised basis from the file. Now let&#39;s normalise it and store the normalised basis separately.</span></div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; Mat normalisedPcaBasisShape = <a class="code" href="namespaceeos_1_1morphablemodel.html#a73d9baeb67f25d4604fc291a23e5e2d8">normalise_pca_basis</a>(unnormalisedPcaBasisShape, eigenvaluesShape);</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html">PcaModel</a> shapeModel(meanShape, normalisedPcaBasisShape, eigenvaluesShape, triangleList);</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; <span class="comment">// Reading the color model</span></div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <span class="comment">// Read number of rows and columns of projection matrix</span></div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numTexturePcaCoeffs = 0;</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numTextureDims = 0;</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;numTexturePcaCoeffs), 4);</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;numTextureDims), 4);</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; <span class="comment">// Read color projection matrix</span></div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; Mat unnormalisedPcaBasisColor(numTextureDims, numTexturePcaCoeffs, CV_32FC1);</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; std::cout &lt;&lt; <span class="stringliteral">&quot;Loading color PCA basis matrix with &quot;</span> &lt;&lt; unnormalisedPcaBasisColor.rows &lt;&lt; <span class="stringliteral">&quot; rows and &quot;</span> &lt;&lt; unnormalisedPcaBasisColor.cols &lt;&lt; <span class="stringliteral">&quot; cols.&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> col = 0; col &lt; numTexturePcaCoeffs; ++col) {</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> row = 0; row &lt; numTextureDims; ++row) {</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <span class="keywordtype">double</span> var = 0.0;</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;var), 8);</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; unnormalisedPcaBasisColor.at&lt;<span class="keywordtype">float</span>&gt;(row, col) = static_cast&lt;float&gt;(var);</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; }</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; }</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160;</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="comment">// Read mean color vector</span></div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numMeanColor = 0; <span class="comment">// dimension of the mean (3*numVertices)</span></div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;numMeanColor), 4);</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; Mat meanColor(numMeanColor, 1, CV_32FC1);</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; counter = 0;</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; numMeanColor / 3; ++i) {</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; vd0 = vd1 = vd2 = 0.0;</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;vd0), 8); <span class="comment">// order in hdf5: RGB. Order in OCV: BGR. But order in vertex.color: RGB</span></div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;vd1), 8);</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;vd2), 8);</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; meanColor.at&lt;<span class="keywordtype">float</span>&gt;(counter, 0) = static_cast&lt;float&gt;(vd0);</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; ++counter;</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; meanColor.at&lt;<span class="keywordtype">float</span>&gt;(counter, 0) = static_cast&lt;float&gt;(vd1);</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; ++counter;</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; meanColor.at&lt;<span class="keywordtype">float</span>&gt;(counter, 0) = static_cast&lt;float&gt;(vd2);</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; ++counter;</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; }</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160;</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; <span class="comment">// Read color eigenvalues</span></div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numEigenValsColor = 0;</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;numEigenValsColor), 4);</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; Mat eigenvaluesColor(numEigenValsColor, 1, CV_32FC1);</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; numEigenValsColor; ++i) {</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <span class="keywordtype">double</span> var = 0.0;</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; modelFile.read(reinterpret_cast&lt;char*&gt;(&amp;var), 8);</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; eigenvaluesColor.at&lt;<span class="keywordtype">float</span>&gt;(i, 0) = static_cast&lt;float&gt;(var);</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; }</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160;</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; <span class="comment">// We read the unnormalised basis from the file. Now let&#39;s normalise it and store the normalised basis separately.</span></div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; Mat normalisedPcaBasisColor = <a class="code" href="namespaceeos_1_1morphablemodel.html#a73d9baeb67f25d4604fc291a23e5e2d8">normalise_pca_basis</a>(unnormalisedPcaBasisColor, eigenvaluesColor);</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; <a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html">PcaModel</a> colorModel(meanColor, normalisedPcaBasisColor, eigenvaluesColor, triangleList);</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160;</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; modelFile.close();</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160;</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; <span class="comment">// Load the isomap with texture coordinates if a filename has been given:</span></div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; std::vector&lt;cv::Vec2f&gt; texCoords;</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; <span class="keywordflow">if</span> (!isomap_file.empty()) {</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; texCoords = <a class="code" href="namespaceeos_1_1morphablemodel.html#afa73fdf5b394458b7e21639ae50d074c">load_isomap</a>(isomap_file);</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; <span class="keywordflow">if</span> (shapeModel.<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">get_data_dimension</a>() / 3.0f != texCoords.size()) {</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; std::string errorMessage(<span class="stringliteral">&quot;Error, wrong number of texture coordinates. Don&#39;t have the same number of texcoords than the shape model has vertices.&quot;</span>);</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; std::cout &lt;&lt; errorMessage &lt;&lt; std::endl;</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(errorMessage);</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; }</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; }</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160;</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html">MorphableModel</a>(shapeModel, colorModel, texCoords);</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160;};</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160;</div>
<div class="line"><a name="l00235"></a><span class="lineno"><a class="line" href="namespaceeos_1_1morphablemodel.html#afa73fdf5b394458b7e21639ae50d074c"> 235</a></span>&#160;std::vector&lt;cv::Vec2f&gt; <a class="code" href="namespaceeos_1_1morphablemodel.html#afa73fdf5b394458b7e21639ae50d074c">load_isomap</a>(boost::filesystem::path isomapFile)</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160;{</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; <span class="keyword">using</span> std::string;</div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; std::vector&lt;float&gt; xCoords, yCoords;</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; <span class="keywordtype">string</span> line;</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; std::ifstream myfile(isomapFile.string());</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; <span class="keywordflow">if</span> (!myfile.is_open()) {</div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; <span class="keywordtype">string</span> logMessage(<span class="stringliteral">&quot;The isomap file could not be opened. Did you specify a correct filename? &quot;</span> + isomapFile.string());</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(logMessage);</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; }</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; <span class="keywordflow">while</span> (getline(myfile, line))</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; {</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; std::istringstream iss(line);</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; <span class="keywordtype">string</span> x, y;</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; iss &gt;&gt; x &gt;&gt; y;</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; xCoords.push_back(std::stof(x));</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; yCoords.push_back(std::stof(y));</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; }</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; myfile.close();</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; }</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; <span class="comment">// Process the coordinates: Find the min/max and rescale to [0, 1] x [0, 1]</span></div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; <span class="keyword">auto</span> minMaxX = std::minmax_element(begin(xCoords), end(xCoords)); <span class="comment">// minMaxX is a pair, first=min, second=max</span></div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; <span class="keyword">auto</span> minMaxY = std::minmax_element(begin(yCoords), end(yCoords));</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160;</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; std::vector&lt;cv::Vec2f&gt; texCoords;</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; <span class="keywordtype">float</span> divisorX = *minMaxX.second - *minMaxX.first;</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; <span class="keywordtype">float</span> divisorY = *minMaxY.second - *minMaxY.first;</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; xCoords.size(); ++i) {</div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160; texCoords.push_back(cv::Vec2f((xCoords[i] - *minMaxX.first) / divisorX, 1.0f - (yCoords[i] - *minMaxY.first) / divisorY)); <span class="comment">// We rescale to [0, 1] and at the same time flip the y-coords (because in the isomap, the coordinates are stored upside-down).</span></div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; }</div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160;</div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160; <span class="keywordflow">return</span> texCoords;</div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160;};</div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160;</div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; } <span class="comment">/* namespace morphablemodel */</span></div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160;} <span class="comment">/* namespace eos */</span></div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160;</div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* IO_CVSSP_HPP_ */</span><span class="preprocessor"></span></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html">eos::morphablemodel::PcaModel</a></div><div class="ttdoc">This class represents a PCA-model that consists of: </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:54</div></div>
<div class="ttc" id="namespaceeos_1_1morphablemodel_html_a73d9baeb67f25d4604fc291a23e5e2d8"><div class="ttname"><a href="namespaceeos_1_1morphablemodel.html#a73d9baeb67f25d4604fc291a23e5e2d8">eos::morphablemodel::normalise_pca_basis</a></div><div class="ttdeci">cv::Mat normalise_pca_basis(cv::Mat unnormalisedBasis, cv::Mat eigenvalues)</div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:284</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_acdf68d929079eab57ab4990c468a9e0d"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d">eos::morphablemodel::PcaModel::get_data_dimension</a></div><div class="ttdeci">int get_data_dimension() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:97</div></div>
<div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&#39;s 3D model fitting functionality. </div></div>
<div class="ttc" id="namespaceeos_1_1morphablemodel_html_a0d607b8838d70cd8ec41cb4bfe116f58"><div class="ttname"><a href="namespaceeos_1_1morphablemodel.html#a0d607b8838d70cd8ec41cb4bfe116f58">eos::morphablemodel::load_scm_model</a></div><div class="ttdeci">MorphableModel load_scm_model(boost::filesystem::path model_filename, boost::filesystem::path isomap_file=boost::filesystem::path())</div><div class="ttdef"><b>Definition:</b> cvssp.hpp:63</div></div>
<div class="ttc" id="namespaceeos_1_1morphablemodel_html_afa73fdf5b394458b7e21639ae50d074c"><div class="ttname"><a href="namespaceeos_1_1morphablemodel.html#afa73fdf5b394458b7e21639ae50d074c">eos::morphablemodel::load_isomap</a></div><div class="ttdeci">std::vector&lt; cv::Vec2f &gt; load_isomap(boost::filesystem::path isomap_file)</div><div class="ttdef"><b>Definition:</b> cvssp.hpp:235</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a></div><div class="ttdoc">A class representing a 3D Morphable Model, consisting of a shape- and colour (albedo) PCA model...</div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:54</div></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a></div><div class="ttdoc">A class representing a 3D Morphable Model, consisting of a shape- and colour (albedo) PCA model...</div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:54</div></div>
</div><!-- fragment --></div><!-- contents --> </div><!-- fragment --></div><!-- contents -->
<!-- start footer part --> <!-- start footer part -->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/core Directory Reference</title> <title>eos: include/eos/core Directory Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -47,7 +47,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -47,7 +47,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li>
<li> <li>
<div id="MSearchBox" class="MSearchBoxInactive"> <div id="MSearchBox" class="MSearchBoxInactive">
<span class="left"> <span class="left">
...@@ -66,6 +66,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -66,6 +66,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</li> </li>
</ul> </ul>
</div> </div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li class="current"><a href="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<!-- window showing the filter options --> <!-- window showing the filter options -->
<div id="MSearchSelectWindow" <div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()" onmouseover="return searchBox.OnSearchSelectShow()"
...@@ -82,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -82,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div id="nav-path" class="navpath"> <div id="nav-path" class="navpath">
<ul> <ul>
<li class="navelem"><a class="el" href="dir_ce53d3124a8ddb93985ce6ec479297f4.html">include</a></li><li class="navelem"><a class="el" href="dir_c7ebde285fcef06dba0b090642612638.html">eos</a></li><li class="navelem"><a class="el" href="dir_bfe318604057f18fe4ea65f858b9b42f.html">core</a></li> </ul> <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_1d6e0dec1b83a3cd88e652cf81228044.html">core</a></li> </ul>
</div> </div>
</div><!-- top --> </div><!-- top -->
<div class="header"> <div class="header">
...@@ -93,17 +98,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -93,17 +98,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<table class="memberdecls"> <table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a>
Files</h2></td></tr> Files</h2></td></tr>
<tr class="memitem:_landmark_8hpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>Landmark.hpp</b> <a href="_landmark_8hpp_source.html">[code]</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:_landmark_mapper_8hpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>LandmarkMapper.hpp</b> <a href="_landmark_mapper_8hpp_source.html">[code]</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table> </table>
</div><!-- contents --> </div><!-- contents -->
<!-- start footer part --> <!-- start footer part -->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/fitting Directory Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos
&#160;<span id="projectnumber">0.7.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li class="current"><a href="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_5c0181df23c28f36a953fd4c7a01cbc0.html">fitting</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">fitting Directory Reference</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a>
Files</h2></td></tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/morphablemodel Directory Reference</title> <title>eos: include/eos/morphablemodel Directory Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -47,7 +47,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -47,7 +47,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li>
<li> <li>
<div id="MSearchBox" class="MSearchBoxInactive"> <div id="MSearchBox" class="MSearchBoxInactive">
<span class="left"> <span class="left">
...@@ -66,6 +66,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -66,6 +66,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</li> </li>
</ul> </ul>
</div> </div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li class="current"><a href="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<!-- window showing the filter options --> <!-- window showing the filter options -->
<div id="MSearchSelectWindow" <div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()" onmouseover="return searchBox.OnSearchSelectShow()"
...@@ -82,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -82,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div id="nav-path" class="navpath"> <div id="nav-path" class="navpath">
<ul> <ul>
<li class="navelem"><a class="el" href="dir_ce53d3124a8ddb93985ce6ec479297f4.html">include</a></li><li class="navelem"><a class="el" href="dir_c7ebde285fcef06dba0b090642612638.html">eos</a></li><li class="navelem"><a class="el" href="dir_a487f496b1daaab0ce4d44d536b7440b.html">morphablemodel</a></li> </ul> <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_8c2f38a39d6204ca353f500c7575d762.html">morphablemodel</a></li> </ul>
</div> </div>
</div><!-- top --> </div><!-- top -->
<div class="header"> <div class="header">
...@@ -93,22 +98,16 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -93,22 +98,16 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<table class="memberdecls"> <table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="subdirs"></a> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="subdirs"></a>
Directories</h2></td></tr> Directories</h2></td></tr>
<tr class="memitem:dir_98df3b346fc34412198a19044150842b"><td class="memItemLeft" align="right" valign="top">directory &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dir_98df3b346fc34412198a19044150842b.html">io</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls"> </table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a>
Files</h2></td></tr> Files</h2></td></tr>
<tr class="memitem:_morphable_model_8hpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>MorphableModel.hpp</b> <a href="_morphable_model_8hpp_source.html">[code]</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:_pca_model_8hpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>PcaModel.hpp</b> <a href="_pca_model_8hpp_source.html">[code]</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table> </table>
</div><!-- contents --> </div><!-- contents -->
<!-- start footer part --> <!-- start footer part -->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/render Directory Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos
&#160;<span id="projectnumber">0.7.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li class="current"><a href="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_9294a830dcc230dfe8b5c804d7e8b91a.html">render</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">render Directory Reference</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a>
Files</h2></td></tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/morphablemodel/io Directory Reference</title> <title>eos: include/eos/morphablemodel/io Directory Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -47,7 +47,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -47,7 +47,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li>
<li> <li>
<div id="MSearchBox" class="MSearchBoxInactive"> <div id="MSearchBox" class="MSearchBoxInactive">
<span class="left"> <span class="left">
...@@ -66,6 +66,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -66,6 +66,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</li> </li>
</ul> </ul>
</div> </div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li class="current"><a href="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<!-- window showing the filter options --> <!-- window showing the filter options -->
<div id="MSearchSelectWindow" <div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()" onmouseover="return searchBox.OnSearchSelectShow()"
...@@ -82,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -82,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div id="nav-path" class="navpath"> <div id="nav-path" class="navpath">
<ul> <ul>
<li class="navelem"><a class="el" href="dir_ce53d3124a8ddb93985ce6ec479297f4.html">include</a></li><li class="navelem"><a class="el" href="dir_c7ebde285fcef06dba0b090642612638.html">eos</a></li><li class="navelem"><a class="el" href="dir_a487f496b1daaab0ce4d44d536b7440b.html">morphablemodel</a></li><li class="navelem"><a class="el" href="dir_98df3b346fc34412198a19044150842b.html">io</a></li> </ul> <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_8c2f38a39d6204ca353f500c7575d762.html">morphablemodel</a></li><li class="navelem"><a class="el" href="dir_987dbb4ef52a44c98ac43896696e0fee.html">io</a></li> </ul>
</div> </div>
</div><!-- top --> </div><!-- top -->
<div class="header"> <div class="header">
...@@ -93,17 +98,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -93,17 +98,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<table class="memberdecls"> <table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a>
Files</h2></td></tr> Files</h2></td></tr>
<tr class="memitem:cvssp_8hpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>cvssp.hpp</b> <a href="cvssp_8hpp_source.html">[code]</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:mat__cerealisation_8hpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>mat_cerealisation.hpp</b> <a href="mat__cerealisation_8hpp_source.html">[code]</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table> </table>
</div><!-- contents --> </div><!-- contents -->
<!-- start footer part --> <!-- start footer part -->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>eos: include/eos Directory Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_ce53d3124a8ddb93985ce6ec479297f4.html">include</a></li><li class="navelem"><a class="el" href="dir_c7ebde285fcef06dba0b090642612638.html">eos</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">eos Directory Reference</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="subdirs"></a>
Directories</h2></td></tr>
<tr class="memitem:dir_bfe318604057f18fe4ea65f858b9b42f"><td class="memItemLeft" align="right" valign="top">directory &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dir_bfe318604057f18fe4ea65f858b9b42f.html">core</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:dir_349d8dd52ed72e674b9a830f9a7a4dcc"><td class="memItemLeft" align="right" valign="top">directory &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dir_349d8dd52ed72e674b9a830f9a7a4dcc.html">fitting</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:dir_a487f496b1daaab0ce4d44d536b7440b"><td class="memItemLeft" align="right" valign="top">directory &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dir_a487f496b1daaab0ce4d44d536b7440b.html">morphablemodel</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:dir_fab380b22e1724065a4c65606be96940"><td class="memItemLeft" align="right" valign="top">directory &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dir_fab380b22e1724065a4c65606be96940.html">render</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10
</small></address>
</body>
</html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include Directory Reference</title> <title>eos: include Directory Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -47,7 +47,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -47,7 +47,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li>
<li> <li>
<div id="MSearchBox" class="MSearchBoxInactive"> <div id="MSearchBox" class="MSearchBoxInactive">
<span class="left"> <span class="left">
...@@ -66,6 +66,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -66,6 +66,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</li> </li>
</ul> </ul>
</div> </div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li class="current"><a href="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<!-- window showing the filter options --> <!-- window showing the filter options -->
<div id="MSearchSelectWindow" <div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()" onmouseover="return searchBox.OnSearchSelectShow()"
...@@ -82,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -82,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div id="nav-path" class="navpath"> <div id="nav-path" class="navpath">
<ul> <ul>
<li class="navelem"><a class="el" href="dir_ce53d3124a8ddb93985ce6ec479297f4.html">include</a></li> </ul> <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li> </ul>
</div> </div>
</div><!-- top --> </div><!-- top -->
<div class="header"> <div class="header">
...@@ -93,15 +98,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -93,15 +98,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<table class="memberdecls"> <table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="subdirs"></a> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="subdirs"></a>
Directories</h2></td></tr> Directories</h2></td></tr>
<tr class="memitem:dir_c7ebde285fcef06dba0b090642612638"><td class="memItemLeft" align="right" valign="top">directory &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dir_c7ebde285fcef06dba0b090642612638.html">eos</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table> </table>
</div><!-- contents --> </div><!-- contents -->
<!-- start footer part --> <!-- start footer part -->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: doc Directory Reference</title> <title>eos: doc Directory Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -47,7 +47,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -47,7 +47,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li>
<li> <li>
<div id="MSearchBox" class="MSearchBoxInactive"> <div id="MSearchBox" class="MSearchBoxInactive">
<span class="left"> <span class="left">
...@@ -66,6 +66,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -66,6 +66,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</li> </li>
</ul> </ul>
</div> </div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li class="current"><a href="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<!-- window showing the filter options --> <!-- window showing the filter options -->
<div id="MSearchSelectWindow" <div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()" onmouseover="return searchBox.OnSearchSelectShow()"
...@@ -82,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -82,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div id="nav-path" class="navpath"> <div id="nav-path" class="navpath">
<ul> <ul>
<li class="navelem"><a class="el" href="dir_39d1678c1121d0e39c71c772c6b99e50.html">doc</a></li> </ul> <li class="navelem"><a class="el" href="dir_e68e8157741866f444e17edd764ebbae.html">doc</a></li> </ul>
</div> </div>
</div><!-- top --> </div><!-- top -->
<div class="header"> <div class="header">
...@@ -93,15 +98,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -93,15 +98,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<table class="memberdecls"> <table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a>
Files</h2></td></tr> Files</h2></td></tr>
<tr class="memitem:namespaces_8doxygen"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>namespaces.doxygen</b></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table> </table>
</div><!-- contents --> </div><!-- contents -->
<!-- start footer part --> <!-- start footer part -->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos Directory Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos
&#160;<span id="projectnumber">0.7.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li class="current"><a href="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">eos Directory Reference</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="subdirs"></a>
Directories</h2></td></tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>eos: include/eos/render Directory Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_ce53d3124a8ddb93985ce6ec479297f4.html">include</a></li><li class="navelem"><a class="el" href="dir_c7ebde285fcef06dba0b090642612638.html">eos</a></li><li class="navelem"><a class="el" href="dir_fab380b22e1724065a4c65606be96940.html">render</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">render Directory Reference</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a>
Files</h2></td></tr>
<tr class="memitem:_mesh_8hpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>Mesh.hpp</b> <a href="_mesh_8hpp_source.html">[code]</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:render_8hpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>render.hpp</b> <a href="render_8hpp_source.html">[code]</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:render__affine_8hpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>render_affine.hpp</b> <a href="render__affine_8hpp_source.html">[code]</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:texture__extraction_8hpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>texture_extraction.hpp</b> <a href="texture__extraction_8hpp_source.html">[code]</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:utils_8hpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>utils.hpp</b> <a href="utils_8hpp_source.html">[code]</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10
</small></address>
</body>
</html>
/* The standard CSS for doxygen 1.8.10 */ /* The standard CSS for doxygen 1.8.11 */
body, table, div, p, dl { body, table, div, p, dl {
font: 400 14px/22px Roboto,sans-serif; font: 400 14px/22px Roboto,sans-serif;
...@@ -206,6 +206,11 @@ div.line { ...@@ -206,6 +206,11 @@ div.line {
transition-duration: 0.5s; transition-duration: 0.5s;
} }
div.line:after {
content:"\000A";
white-space: pre;
}
div.line.glow { div.line.glow {
background-color: cyan; background-color: cyan;
box-shadow: 0 0 10px cyan; box-shadow: 0 0 10px cyan;
...@@ -242,7 +247,7 @@ div.ah, span.ah { ...@@ -242,7 +247,7 @@ div.ah, span.ah {
-webkit-box-shadow: 2px 2px 3px #999; -webkit-box-shadow: 2px 2px 3px #999;
-moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444));
background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000 110%);
} }
div.classindex ul { div.classindex ul {
...@@ -832,6 +837,10 @@ address { ...@@ -832,6 +837,10 @@ address {
color: #2A3D61; color: #2A3D61;
} }
table.doxtable caption {
caption-side: top;
}
table.doxtable { table.doxtable {
border-collapse:collapse; border-collapse:collapse;
margin-top: 4px; margin-top: 4px;
...@@ -997,6 +1006,18 @@ div.summary a ...@@ -997,6 +1006,18 @@ div.summary a
white-space: nowrap; white-space: nowrap;
} }
table.classindex
{
margin: 10px;
white-space: nowrap;
margin-left: 3%;
margin-right: 3%;
width: 94%;
border: 0;
border-spacing: 0;
padding: 0;
}
div.ingroups div.ingroups
{ {
font-size: 8pt; font-size: 8pt;
...@@ -1196,7 +1217,7 @@ div.toc { ...@@ -1196,7 +1217,7 @@ div.toc {
border-radius: 7px 7px 7px 7px; border-radius: 7px 7px 7px 7px;
float: right; float: right;
height: auto; height: auto;
margin: 0 20px 10px 10px; margin: 0 8px 10px 10px;
width: 200px; width: 200px;
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: File List</title> <title>eos: File List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -93,27 +93,32 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -93,27 +93,32 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="contents"> <div class="contents">
<div class="textblock">Here is a list of all documented files with brief descriptions:</div><div class="directory"> <div class="textblock">Here is a list of all documented files with brief descriptions:</div><div class="directory">
<div class="levels">[detail level <span onclick="javascript:toggleLevel(1);">1</span><span onclick="javascript:toggleLevel(2);">2</span><span onclick="javascript:toggleLevel(3);">3</span><span onclick="javascript:toggleLevel(4);">4</span><span onclick="javascript:toggleLevel(5);">5</span>]</div><table class="directory"> <div class="levels">[detail level <span onclick="javascript:toggleLevel(1);">1</span><span onclick="javascript:toggleLevel(2);">2</span><span onclick="javascript:toggleLevel(3);">3</span><span onclick="javascript:toggleLevel(4);">4</span><span onclick="javascript:toggleLevel(5);">5</span>]</div><table class="directory">
<tr id="row_0_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_0_" class="arrow" onclick="toggleFolder('0_')">&#9660;</span><span id="img_0_" class="iconfopen" onclick="toggleFolder('0_')">&#160;</span><a class="el" href="dir_ce53d3124a8ddb93985ce6ec479297f4.html" target="_self">include</a></td><td class="desc"></td></tr> <tr id="row_0_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_0_" class="arrow" onclick="toggleFolder('0_')">&#9660;</span><span id="img_0_" class="iconfopen" onclick="toggleFolder('0_')">&#160;</span><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html" target="_self">include</a></td><td class="desc"></td></tr>
<tr id="row_0_0_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_0_" class="arrow" onclick="toggleFolder('0_0_')">&#9660;</span><span id="img_0_0_" class="iconfopen" onclick="toggleFolder('0_0_')">&#160;</span><a class="el" href="dir_c7ebde285fcef06dba0b090642612638.html" target="_self">eos</a></td><td class="desc"></td></tr> <tr id="row_0_0_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_0_" class="arrow" onclick="toggleFolder('0_0_')">&#9660;</span><span id="img_0_0_" class="iconfopen" onclick="toggleFolder('0_0_')">&#160;</span><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html" target="_self">eos</a></td><td class="desc"></td></tr>
<tr id="row_0_0_0_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_0_0_0_" class="arrow" onclick="toggleFolder('0_0_0_')">&#9660;</span><span id="img_0_0_0_" class="iconfopen" onclick="toggleFolder('0_0_0_')">&#160;</span><a class="el" href="dir_bfe318604057f18fe4ea65f858b9b42f.html" target="_self">core</a></td><td class="desc"></td></tr> <tr id="row_0_0_0_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_0_0_0_" class="arrow" onclick="toggleFolder('0_0_0_')">&#9660;</span><span id="img_0_0_0_" class="iconfopen" onclick="toggleFolder('0_0_0_')">&#160;</span><a class="el" href="dir_1d6e0dec1b83a3cd88e652cf81228044.html" target="_self">core</a></td><td class="desc"></td></tr>
<tr id="row_0_0_0_0_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="_landmark_8hpp_source.html"><span class="icondoc"></span></a><b>Landmark.hpp</b></td><td class="desc"></td></tr> <tr id="row_0_0_0_0_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="_landmark_8hpp_source.html"><span class="icondoc"></span></a><b>Landmark.hpp</b></td><td class="desc"></td></tr>
<tr id="row_0_0_0_1_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="_landmark_mapper_8hpp_source.html"><span class="icondoc"></span></a><b>LandmarkMapper.hpp</b></td><td class="desc"></td></tr> <tr id="row_0_0_0_1_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="_landmark_mapper_8hpp_source.html"><span class="icondoc"></span></a><b>LandmarkMapper.hpp</b></td><td class="desc"></td></tr>
<tr id="row_0_0_1_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_0_0_1_" class="arrow" onclick="toggleFolder('0_0_1_')">&#9660;</span><span id="img_0_0_1_" class="iconfopen" onclick="toggleFolder('0_0_1_')">&#160;</span><a class="el" href="dir_349d8dd52ed72e674b9a830f9a7a4dcc.html" target="_self">fitting</a></td><td class="desc"></td></tr> <tr id="row_0_0_1_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_0_0_1_" class="arrow" onclick="toggleFolder('0_0_1_')">&#9660;</span><span id="img_0_0_1_" class="iconfopen" onclick="toggleFolder('0_0_1_')">&#160;</span><a class="el" href="dir_5c0181df23c28f36a953fd4c7a01cbc0.html" target="_self">fitting</a></td><td class="desc"></td></tr>
<tr id="row_0_0_1_0_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="affine__camera__estimation_8hpp_source.html"><span class="icondoc"></span></a><b>affine_camera_estimation.hpp</b></td><td class="desc"></td></tr> <tr id="row_0_0_1_0_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="affine__camera__estimation_8hpp_source.html"><span class="icondoc"></span></a><b>affine_camera_estimation.hpp</b></td><td class="desc"></td></tr>
<tr id="row_0_0_1_1_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="linear__shape__fitting_8hpp_source.html"><span class="icondoc"></span></a><b>linear_shape_fitting.hpp</b></td><td class="desc"></td></tr> <tr id="row_0_0_1_1_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="blendshape__fitting_8hpp_source.html"><span class="icondoc"></span></a><b>blendshape_fitting.hpp</b></td><td class="desc"></td></tr>
<tr id="row_0_0_1_2_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="nonlinear__camera__estimation_8hpp_source.html"><span class="icondoc"></span></a><b>nonlinear_camera_estimation.hpp</b></td><td class="desc"></td></tr> <tr id="row_0_0_1_2_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="contour__correspondence_8hpp_source.html"><span class="icondoc"></span></a><b>contour_correspondence.hpp</b></td><td class="desc"></td></tr>
<tr id="row_0_0_2_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_0_0_2_" class="arrow" onclick="toggleFolder('0_0_2_')">&#9660;</span><span id="img_0_0_2_" class="iconfopen" onclick="toggleFolder('0_0_2_')">&#160;</span><a class="el" href="dir_a487f496b1daaab0ce4d44d536b7440b.html" target="_self">morphablemodel</a></td><td class="desc"></td></tr> <tr id="row_0_0_1_3_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="fitting_8hpp_source.html"><span class="icondoc"></span></a><b>fitting.hpp</b></td><td class="desc"></td></tr>
<tr id="row_0_0_2_0_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span id="arr_0_0_2_0_" class="arrow" onclick="toggleFolder('0_0_2_0_')">&#9660;</span><span id="img_0_0_2_0_" class="iconfopen" onclick="toggleFolder('0_0_2_0_')">&#160;</span><a class="el" href="dir_98df3b346fc34412198a19044150842b.html" target="_self">io</a></td><td class="desc"></td></tr> <tr id="row_0_0_1_4_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="linear__shape__fitting_8hpp_source.html"><span class="icondoc"></span></a><b>linear_shape_fitting.hpp</b></td><td class="desc"></td></tr>
<tr id="row_0_0_2_0_0_"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><a href="cvssp_8hpp_source.html"><span class="icondoc"></span></a><b>cvssp.hpp</b></td><td class="desc"></td></tr> <tr id="row_0_0_1_5_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="nonlinear__camera__estimation_8hpp_source.html"><span class="icondoc"></span></a><b>nonlinear_camera_estimation.hpp</b></td><td class="desc"></td></tr>
<tr id="row_0_0_2_0_1_" class="even"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><a href="mat__cerealisation_8hpp_source.html"><span class="icondoc"></span></a><b>mat_cerealisation.hpp</b></td><td class="desc"></td></tr> <tr id="row_0_0_2_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_0_0_2_" class="arrow" onclick="toggleFolder('0_0_2_')">&#9660;</span><span id="img_0_0_2_" class="iconfopen" onclick="toggleFolder('0_0_2_')">&#160;</span><a class="el" href="dir_8c2f38a39d6204ca353f500c7575d762.html" target="_self">morphablemodel</a></td><td class="desc"></td></tr>
<tr id="row_0_0_2_1_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="_morphable_model_8hpp_source.html"><span class="icondoc"></span></a><b>MorphableModel.hpp</b></td><td class="desc"></td></tr> <tr id="row_0_0_2_0_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span id="arr_0_0_2_0_" class="arrow" onclick="toggleFolder('0_0_2_0_')">&#9660;</span><span id="img_0_0_2_0_" class="iconfopen" onclick="toggleFolder('0_0_2_0_')">&#160;</span><a class="el" href="dir_987dbb4ef52a44c98ac43896696e0fee.html" target="_self">io</a></td><td class="desc"></td></tr>
<tr id="row_0_0_2_2_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="_pca_model_8hpp_source.html"><span class="icondoc"></span></a><b>PcaModel.hpp</b></td><td class="desc"></td></tr> <tr id="row_0_0_2_0_0_" class="even"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><a href="cvssp_8hpp_source.html"><span class="icondoc"></span></a><b>cvssp.hpp</b></td><td class="desc"></td></tr>
<tr id="row_0_0_3_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_0_0_3_" class="arrow" onclick="toggleFolder('0_0_3_')">&#9660;</span><span id="img_0_0_3_" class="iconfopen" onclick="toggleFolder('0_0_3_')">&#160;</span><a class="el" href="dir_fab380b22e1724065a4c65606be96940.html" target="_self">render</a></td><td class="desc"></td></tr> <tr id="row_0_0_2_0_1_"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><a href="mat__cerealisation_8hpp_source.html"><span class="icondoc"></span></a><b>mat_cerealisation.hpp</b></td><td class="desc"></td></tr>
<tr id="row_0_0_3_0_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="_mesh_8hpp_source.html"><span class="icondoc"></span></a><b>Mesh.hpp</b></td><td class="desc"></td></tr> <tr id="row_0_0_2_1_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="_blendshape_8hpp_source.html"><span class="icondoc"></span></a><b>Blendshape.hpp</b></td><td class="desc"></td></tr>
<tr id="row_0_0_3_1_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="render_8hpp_source.html"><span class="icondoc"></span></a><b>render.hpp</b></td><td class="desc"></td></tr> <tr id="row_0_0_2_2_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="coefficients_8hpp_source.html"><span class="icondoc"></span></a><b>coefficients.hpp</b></td><td class="desc"></td></tr>
<tr id="row_0_0_3_2_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="render__affine_8hpp_source.html"><span class="icondoc"></span></a><b>render_affine.hpp</b></td><td class="desc"></td></tr> <tr id="row_0_0_2_3_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="_morphable_model_8hpp_source.html"><span class="icondoc"></span></a><b>MorphableModel.hpp</b></td><td class="desc"></td></tr>
<tr id="row_0_0_3_3_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="texture__extraction_8hpp_source.html"><span class="icondoc"></span></a><b>texture_extraction.hpp</b></td><td class="desc"></td></tr> <tr id="row_0_0_2_4_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="_pca_model_8hpp_source.html"><span class="icondoc"></span></a><b>PcaModel.hpp</b></td><td class="desc"></td></tr>
<tr id="row_0_0_3_4_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="utils_8hpp_source.html"><span class="icondoc"></span></a><b>utils.hpp</b></td><td class="desc"></td></tr> <tr id="row_0_0_3_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_0_0_3_" class="arrow" onclick="toggleFolder('0_0_3_')">&#9660;</span><span id="img_0_0_3_" class="iconfopen" onclick="toggleFolder('0_0_3_')">&#160;</span><a class="el" href="dir_9294a830dcc230dfe8b5c804d7e8b91a.html" target="_self">render</a></td><td class="desc"></td></tr>
<tr id="row_0_0_3_0_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="_mesh_8hpp_source.html"><span class="icondoc"></span></a><b>Mesh.hpp</b></td><td class="desc"></td></tr>
<tr id="row_0_0_3_1_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="render_8hpp_source.html"><span class="icondoc"></span></a><b>render.hpp</b></td><td class="desc"></td></tr>
<tr id="row_0_0_3_2_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="render__affine_8hpp_source.html"><span class="icondoc"></span></a><b>render_affine.hpp</b></td><td class="desc"></td></tr>
<tr id="row_0_0_3_3_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="texture__extraction_8hpp_source.html"><span class="icondoc"></span></a><b>texture_extraction.hpp</b></td><td class="desc"></td></tr>
<tr id="row_0_0_3_4_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a href="utils_8hpp_source.html"><span class="icondoc"></span></a><b>utils.hpp</b></td><td class="desc"></td></tr>
</table> </table>
</div><!-- directory --> </div><!-- directory -->
</div><!-- contents --> </div><!-- contents -->
...@@ -121,7 +126,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -121,7 +126,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/fitting/fitting.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos
&#160;<span id="projectnumber">0.7.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_5c0181df23c28f36a953fd4c7a01cbc0.html">fitting</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">fitting.hpp</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/fitting/fitting.hpp</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2015 Patrik Huber</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef FITTING_HPP_</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define FITTING_HPP_</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;eos/morphablemodel/MorphableModel.hpp&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &quot;eos/morphablemodel/Blendshape.hpp&quot;</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;eos/fitting/linear_shape_fitting.hpp&quot;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &quot;eos/fitting/blendshape_fitting.hpp&quot;</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; <span class="keyword">namespace </span>fitting {</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#a5ddb4f44f4576ad148a9edd85d78c1f7"> 58</a></span>&#160;cv::Mat <a class="code" href="namespaceeos_1_1fitting.html#a5ddb4f44f4576ad148a9edd85d78c1f7">fit_shape</a>(cv::Mat affine_camera_matrix, <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a> morphable_model, std::vector&lt;eos::morphablemodel::Blendshape&gt; blendshapes, std::vector&lt;cv::Vec2f&gt; image_points, std::vector&lt;int&gt; vertex_indices, <span class="keywordtype">float</span> lambda, boost::optional&lt;int&gt; num_coefficients_to_fit, std::vector&lt;float&gt;&amp; pca_shape_coefficients, std::vector&lt;float&gt;&amp; blendshape_coefficients)</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;{</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="keyword">using</span> cv::Mat;</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; </div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; Mat blendshapes_as_basis(blendshapes[0].deformation.rows, blendshapes.size(), CV_32FC1); <span class="comment">// assert blendshapes.size() &gt; 0 and all of them have same number of rows, and 1 col</span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; blendshapes.size(); ++i)</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; {</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; blendshapes[i].deformation.copyTo(blendshapes_as_basis.col(i));</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; }</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; std::vector&lt;float&gt; last_blendshape_coeffs, current_blendshape_coeffs; </div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; std::vector&lt;float&gt; last_pca_coeffs, current_pca_coeffs;</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; current_blendshape_coeffs.resize(blendshapes.size()); <span class="comment">// starting values t_0, all zeros</span></div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="comment">// no starting values for current_pca_coeffs required, since we start with the shape fitting, and cv::norm of an empty vector is 0.</span></div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; Mat combined_shape;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="keywordflow">do</span> <span class="comment">// run at least once:</span></div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; {</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; last_blendshape_coeffs = current_blendshape_coeffs;</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; last_pca_coeffs = current_pca_coeffs;</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="comment">// Estimate the PCA shape coefficients with the current blendshape coefficients (0 in the first iteration):</span></div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; Mat mean_plus_blendshapes = morphable_model.<a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11">get_shape_model</a>().<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495">get_mean</a>() + blendshapes_as_basis * Mat(last_blendshape_coeffs);</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; current_pca_coeffs = <a class="code" href="namespaceeos_1_1fitting.html#ae558a318d1d0c1da35d64b7abb209fac">fitting::fit_shape_to_landmarks_linear</a>(morphable_model, affine_camera_matrix, image_points, vertex_indices, mean_plus_blendshapes, lambda, num_coefficients_to_fit);</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="comment">// Estimate the blendshape coefficients with the current PCA model estimate:</span></div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; Mat pca_model_shape = morphable_model.<a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11">get_shape_model</a>().<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">draw_sample</a>(current_pca_coeffs);</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; current_blendshape_coeffs = <a class="code" href="namespaceeos_1_1fitting.html#ac429313cbc0ed61744f1b0fa4dba672b">eos::fitting::fit_blendshapes_to_landmarks_linear</a>(blendshapes, pca_model_shape, affine_camera_matrix, image_points, vertex_indices, 0.0f);</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; combined_shape = pca_model_shape + blendshapes_as_basis * Mat(current_blendshape_coeffs);</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; } <span class="keywordflow">while</span> (std::abs(cv::norm(current_pca_coeffs) - cv::norm(last_pca_coeffs)) &gt;= 0.01 || std::abs(cv::norm(current_blendshape_coeffs) - cv::norm(last_blendshape_coeffs)) &gt;= 0.01);</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; </div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; pca_shape_coefficients = current_pca_coeffs;</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; blendshape_coefficients = current_blendshape_coeffs;</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keywordflow">return</span> combined_shape;</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;};</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160;</div><div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#ae3bcf9f955efce788838cc055b5282b6"> 108</a></span>&#160;cv::Mat <a class="code" href="namespaceeos_1_1fitting.html#a5ddb4f44f4576ad148a9edd85d78c1f7">fit_shape</a>(cv::Mat affine_camera_matrix, <a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a> morphable_model, std::vector&lt;eos::morphablemodel::Blendshape&gt; blendshapes, std::vector&lt;cv::Vec2f&gt; image_points, std::vector&lt;int&gt; vertex_indices, <span class="keywordtype">float</span> lambda = 3.0f, boost::optional&lt;int&gt; num_coefficients_to_fit = boost::optional&lt;int&gt;())</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;{</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; std::vector&lt;float&gt; unused;</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keywordflow">return</span> <a class="code" href="namespaceeos_1_1fitting.html#a5ddb4f44f4576ad148a9edd85d78c1f7">fit_shape</a>(affine_camera_matrix, morphable_model, blendshapes, image_points, vertex_indices, lambda, num_coefficients_to_fit, unused, unused);</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;};</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; } <span class="comment">/* namespace fitting */</span></div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;} <span class="comment">/* namespace eos */</span></div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* FITTING_HPP_ */</span><span class="preprocessor"></span></div><div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_a8dfc5fa04f9853f2e06b971b90415538"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">eos::morphablemodel::PcaModel::draw_sample</a></div><div class="ttdeci">cv::Mat draw_sample(float sigma=1.0f)</div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:143</div></div>
<div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&amp;#39;s 3D model fitting functionality. </div></div>
<div class="ttc" id="namespaceeos_1_1fitting_html_ae558a318d1d0c1da35d64b7abb209fac"><div class="ttname"><a href="namespaceeos_1_1fitting.html#ae558a318d1d0c1da35d64b7abb209fac">eos::fitting::fit_shape_to_landmarks_linear</a></div><div class="ttdeci">std::vector&lt; float &gt; fit_shape_to_landmarks_linear(morphablemodel::MorphableModel morphable_model, cv::Mat affine_camera_matrix, std::vector&lt; cv::Vec2f &gt; landmarks, std::vector&lt; int &gt; vertex_ids, cv::Mat base_face=cv::Mat(), float lambda=3.0f, boost::optional&lt; int &gt; num_coefficients_to_fit=boost::optional&lt; int &gt;(), boost::optional&lt; float &gt; detector_standard_deviation=boost::optional&lt; float &gt;(), boost::optional&lt; float &gt; model_standard_deviation=boost::optional&lt; float &gt;())</div><div class="ttdef"><b>Definition:</b> linear_shape_fitting.hpp:60</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_af05c96c2a5d3936503b961a9b4238495"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495">eos::morphablemodel::PcaModel::get_mean</a></div><div class="ttdeci">cv::Mat get_mean() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:119</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html_a990bf9c518307c811691facb8c1daa11"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11">eos::morphablemodel::MorphableModel::get_shape_model</a></div><div class="ttdeci">PcaModel get_shape_model() const </div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:77</div></div>
<div class="ttc" id="namespaceeos_1_1fitting_html_ac429313cbc0ed61744f1b0fa4dba672b"><div class="ttname"><a href="namespaceeos_1_1fitting.html#ac429313cbc0ed61744f1b0fa4dba672b">eos::fitting::fit_blendshapes_to_landmarks_linear</a></div><div class="ttdeci">std::vector&lt; float &gt; fit_blendshapes_to_landmarks_linear(std::vector&lt; eos::morphablemodel::Blendshape &gt; blendshapes, cv::Mat face_instance, cv::Mat affine_camera_matrix, std::vector&lt; cv::Vec2f &gt; landmarks, std::vector&lt; int &gt; vertex_ids, float lambda=500.0f)</div><div class="ttdef"><b>Definition:</b> blendshape_fitting.hpp:50</div></div>
<div class="ttc" id="namespaceeos_1_1fitting_html_a5ddb4f44f4576ad148a9edd85d78c1f7"><div class="ttname"><a href="namespaceeos_1_1fitting.html#a5ddb4f44f4576ad148a9edd85d78c1f7">eos::fitting::fit_shape</a></div><div class="ttdeci">cv::Mat fit_shape(cv::Mat affine_camera_matrix, eos::morphablemodel::MorphableModel morphable_model, std::vector&lt; eos::morphablemodel::Blendshape &gt; blendshapes, std::vector&lt; cv::Vec2f &gt; image_points, std::vector&lt; int &gt; vertex_indices, float lambda, boost::optional&lt; int &gt; num_coefficients_to_fit, std::vector&lt; float &gt; &amp;pca_shape_coefficients, std::vector&lt; float &gt; &amp;blendshape_coefficients)</div><div class="ttdef"><b>Definition:</b> fitting.hpp:58</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a></div><div class="ttdoc">A class representing a 3D Morphable Model, consisting of a shape- and colour (albedo) PCA model...</div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:54</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: Class Members</title> <title>eos: Class Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -127,6 +127,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -127,6 +127,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<h3><a class="anchor" id="index_d"></a>- d -</h3><ul> <h3><a class="anchor" id="index_d"></a>- d -</h3><ul>
<li>deformation
: <a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html#ae5d056f2f0473ddf1c0f000714c0b709">eos::morphablemodel::Blendshape</a>
</li>
<li>draw_sample() <li>draw_sample()
: <a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a5fd1b15edc89e89808339859570a4c09">eos::morphablemodel::MorphableModel</a> : <a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a5fd1b15edc89e89808339859570a4c09">eos::morphablemodel::MorphableModel</a>
, <a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">eos::morphablemodel::PcaModel</a> , <a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">eos::morphablemodel::PcaModel</a>
...@@ -183,6 +186,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -183,6 +186,10 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<li>LandmarkMapper() <li>LandmarkMapper()
: <a class="el" href="classeos_1_1core_1_1_landmark_mapper.html#ab31ea1ec78c463ce54e2372fce103889">eos::core::LandmarkMapper</a> : <a class="el" href="classeos_1_1core_1_1_landmark_mapper.html#ab31ea1ec78c463ce54e2372fce103889">eos::core::LandmarkMapper</a>
</li> </li>
<li>load()
: <a class="el" href="structeos_1_1fitting_1_1_contour_landmarks.html#a15bb18f801e64ceaf5e07f73a1374cdb">eos::fitting::ContourLandmarks</a>
, <a class="el" href="structeos_1_1fitting_1_1_model_contour.html#a7a53f075afaeabef19a33b2e914406ce">eos::fitting::ModelContour</a>
</li>
</ul> </ul>
...@@ -196,6 +203,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -196,6 +203,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<h3><a class="anchor" id="index_n"></a>- n -</h3><ul> <h3><a class="anchor" id="index_n"></a>- n -</h3><ul>
<li>name <li>name
: <a class="el" href="structeos_1_1core_1_1_landmark.html#a85c0f001e311e994314e900dcb284ad3">eos::core::Landmark&lt; LandmarkType &gt;</a> : <a class="el" href="structeos_1_1core_1_1_landmark.html#a85c0f001e311e994314e900dcb284ad3">eos::core::Landmark&lt; LandmarkType &gt;</a>
, <a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html#ab87c9b282061a3dd72a8176fffa99594">eos::morphablemodel::Blendshape</a>
</li> </li>
</ul> </ul>
...@@ -208,6 +216,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -208,6 +216,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<h3><a class="anchor" id="index_s"></a>- s -</h3><ul> <h3><a class="anchor" id="index_s"></a>- s -</h3><ul>
<li>serialize()
: <a class="el" href="structeos_1_1fitting_1_1_frustum.html#ad2927fb97762ef726696cf6296b5b9d4">eos::fitting::Frustum</a>
, <a class="el" href="structeos_1_1fitting_1_1_model_contour.html#a079c6e6969f79c123ceb8efc4116d9ea">eos::fitting::ModelContour</a>
, <a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html#a5d9a13513843bc122a58ebae9801fada">eos::fitting::RenderingParameters</a>
, <a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html#aeccd060e4fa63cf3c417625d118f0602">eos::morphablemodel::Blendshape</a>
</li>
<li>size() <li>size()
: <a class="el" href="classeos_1_1core_1_1_landmark_mapper.html#a7e3a46e6aeb522d96066a3d73f4c92c6">eos::core::LandmarkMapper</a> : <a class="el" href="classeos_1_1core_1_1_landmark_mapper.html#a7e3a46e6aeb522d96066a3d73f4c92c6">eos::core::LandmarkMapper</a>
</li> </li>
...@@ -237,7 +251,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -237,7 +251,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: Class Members - Functions</title> <title>eos: Class Members - Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -80,6 +80,18 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -80,6 +80,18 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<li><a href="functions_vars.html"><span>Variables</span></a></li> <li><a href="functions_vars.html"><span>Variables</span></a></li>
</ul> </ul>
</div> </div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="#index_c"><span>c</span></a></li>
<li><a href="#index_d"><span>d</span></a></li>
<li><a href="#index_g"><span>g</span></a></li>
<li><a href="#index_h"><span>h</span></a></li>
<li><a href="#index_l"><span>l</span></a></li>
<li><a href="#index_m"><span>m</span></a></li>
<li><a href="#index_p"><span>p</span></a></li>
<li class="current"><a href="#index_s"><span>s</span></a></li>
</ul>
</div>
</div><!-- top --> </div><!-- top -->
<!-- window showing the filter options --> <!-- window showing the filter options -->
<div id="MSearchSelectWindow" <div id="MSearchSelectWindow"
...@@ -96,14 +108,24 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -96,14 +108,24 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</div> </div>
<div class="contents"> <div class="contents">
&#160;<ul> &#160;
<h3><a class="anchor" id="index_c"></a>- c -</h3><ul>
<li>convert() <li>convert()
: <a class="el" href="classeos_1_1core_1_1_landmark_mapper.html#aa0d5463e00e3b8f074b1f81dbd9390a7">eos::core::LandmarkMapper</a> : <a class="el" href="classeos_1_1core_1_1_landmark_mapper.html#aa0d5463e00e3b8f074b1f81dbd9390a7">eos::core::LandmarkMapper</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_d"></a>- d -</h3><ul>
<li>draw_sample() <li>draw_sample()
: <a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a5fd1b15edc89e89808339859570a4c09">eos::morphablemodel::MorphableModel</a> : <a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a5fd1b15edc89e89808339859570a4c09">eos::morphablemodel::MorphableModel</a>
, <a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">eos::morphablemodel::PcaModel</a> , <a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538">eos::morphablemodel::PcaModel</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_g"></a>- g -</h3><ul>
<li>get_color_model() <li>get_color_model()
: <a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a1fff16d5d749831fa90049199101298c">eos::morphablemodel::MorphableModel</a> : <a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a1fff16d5d749831fa90049199101298c">eos::morphablemodel::MorphableModel</a>
</li> </li>
...@@ -138,18 +160,48 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -138,18 +160,48 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<li>get_unnormalised_pca_basis() <li>get_unnormalised_pca_basis()
: <a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8d0f31b08aca934b7cf86dd92a1abbe2">eos::morphablemodel::PcaModel</a> : <a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#a8d0f31b08aca934b7cf86dd92a1abbe2">eos::morphablemodel::PcaModel</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_h"></a>- h -</h3><ul>
<li>has_color_model() <li>has_color_model()
: <a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a253ca65b7f6c6cb48d4abd7b9a7f9a83">eos::morphablemodel::MorphableModel</a> : <a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a253ca65b7f6c6cb48d4abd7b9a7f9a83">eos::morphablemodel::MorphableModel</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_l"></a>- l -</h3><ul>
<li>LandmarkMapper() <li>LandmarkMapper()
: <a class="el" href="classeos_1_1core_1_1_landmark_mapper.html#ab31ea1ec78c463ce54e2372fce103889">eos::core::LandmarkMapper</a> : <a class="el" href="classeos_1_1core_1_1_landmark_mapper.html#ab31ea1ec78c463ce54e2372fce103889">eos::core::LandmarkMapper</a>
</li> </li>
<li>load()
: <a class="el" href="structeos_1_1fitting_1_1_contour_landmarks.html#a15bb18f801e64ceaf5e07f73a1374cdb">eos::fitting::ContourLandmarks</a>
, <a class="el" href="structeos_1_1fitting_1_1_model_contour.html#a7a53f075afaeabef19a33b2e914406ce">eos::fitting::ModelContour</a>
</li>
</ul>
<h3><a class="anchor" id="index_m"></a>- m -</h3><ul>
<li>MorphableModel() <li>MorphableModel()
: <a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a438898cd4578c1998e452de7d521f8cc">eos::morphablemodel::MorphableModel</a> : <a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a438898cd4578c1998e452de7d521f8cc">eos::morphablemodel::MorphableModel</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_p"></a>- p -</h3><ul>
<li>PcaModel() <li>PcaModel()
: <a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#ab2e45689de5f00a6109ecf00b0625d2f">eos::morphablemodel::PcaModel</a> : <a class="el" href="classeos_1_1morphablemodel_1_1_pca_model.html#ab2e45689de5f00a6109ecf00b0625d2f">eos::morphablemodel::PcaModel</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_s"></a>- s -</h3><ul>
<li>serialize()
: <a class="el" href="structeos_1_1fitting_1_1_frustum.html#ad2927fb97762ef726696cf6296b5b9d4">eos::fitting::Frustum</a>
, <a class="el" href="structeos_1_1fitting_1_1_model_contour.html#a079c6e6969f79c123ceb8efc4116d9ea">eos::fitting::ModelContour</a>
, <a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html#a5d9a13513843bc122a58ebae9801fada">eos::fitting::RenderingParameters</a>
, <a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html#aeccd060e4fa63cf3c417625d118f0602">eos::morphablemodel::Blendshape</a>
</li>
<li>size() <li>size()
: <a class="el" href="classeos_1_1core_1_1_landmark_mapper.html#a7e3a46e6aeb522d96066a3d73f4c92c6">eos::core::LandmarkMapper</a> : <a class="el" href="classeos_1_1core_1_1_landmark_mapper.html#a7e3a46e6aeb522d96066a3d73f4c92c6">eos::core::LandmarkMapper</a>
</li> </li>
...@@ -159,7 +211,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -159,7 +211,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: Class Members - Variables</title> <title>eos: Class Members - Variables</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -103,8 +103,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -103,8 +103,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<li>coordinates <li>coordinates
: <a class="el" href="structeos_1_1core_1_1_landmark.html#aa3ffa0bd40290634e485e3c5ca99229c">eos::core::Landmark&lt; LandmarkType &gt;</a> : <a class="el" href="structeos_1_1core_1_1_landmark.html#aa3ffa0bd40290634e485e3c5ca99229c">eos::core::Landmark&lt; LandmarkType &gt;</a>
</li> </li>
<li>deformation
: <a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html#ae5d056f2f0473ddf1c0f000714c0b709">eos::morphablemodel::Blendshape</a>
</li>
<li>name <li>name
: <a class="el" href="structeos_1_1core_1_1_landmark.html#a85c0f001e311e994314e900dcb284ad3">eos::core::Landmark&lt; LandmarkType &gt;</a> : <a class="el" href="structeos_1_1core_1_1_landmark.html#a85c0f001e311e994314e900dcb284ad3">eos::core::Landmark&lt; LandmarkType &gt;</a>
, <a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html#ab87c9b282061a3dd72a8176fffa99594">eos::morphablemodel::Blendshape</a>
</li> </li>
<li>tci <li>tci
: <a class="el" href="structeos_1_1render_1_1_mesh.html#a81c47a35a1b0a6a6cb440cfbb67b8c28">eos::render::Mesh</a> : <a class="el" href="structeos_1_1render_1_1_mesh.html#a81c47a35a1b0a6a6cb440cfbb67b8c28">eos::render::Mesh</a>
...@@ -124,7 +128,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -124,7 +128,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: Main Page</title> <title>eos: eos: A lightweight header-only 3D Morphable Face Model fitting library in modern C++11/14.</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="dynsections.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -83,20 +83,22 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -83,20 +83,22 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="header"> <div class="header">
<div class="headertitle"> <div class="headertitle">
<div class="title">eos Documentation</div> </div> <div class="title">eos: A lightweight header-only 3D Morphable Face Model fitting library in modern C++11/14. </div> </div>
</div><!--header--> </div><!--header-->
<div class="contents"> <div class="contents">
<div class="textblock"> <div class="textblock"><p><a href="https://github.com/patrikhuber/eos/releases"></a> <a href="https://github.com/patrikhuber/eos/blob/master/LICENSE"></a></p>
<p>Eos is a tiny 3D Morphable Model fitting library that provides just the bare minimum to load a model and perform camera and shape fitting. It's written in modern C++11/14.</p> <p>eos is a lightweight 3D Morphable Face Model fitting library that provides just the bare minimum to load a model and perform camera and shape fitting. It's written in modern C++11/14.</p>
<p>At the moment, it mainly provides the following functionality:</p> <p>At the moment, it mainly provides the following functionality:</p>
<ul> <ul>
<li>MorphableModel class to represent a 3DMM (using OpenCVs <code>cv::Mat</code>)</li> <li>MorphableModel class to represent a 3DMM (using OpenCVs <code>cv::Mat</code>)</li>
<li>Our low-resolution, shape-only 3D Morphable Face Model (<a href="https://github.com/patrikhuber/eos/blob/master/share/sfm_shape_3448.bin">share/sfm_shape_3448.bin</a>)</li>
<li>Camera pose estimation, implementation of:<ul> <li>Camera pose estimation, implementation of:<ul>
<li>the <em>Gold Standard Algorithm</em> for estimating an affine camera matrix, from Multiple View Geometry, Hartley &amp; Zisserman</li> <li>the <em>Gold Standard Algorithm</em> for estimating an affine camera matrix, from Multiple View Geometry, Hartley &amp; Zisserman</li>
<li>a non-linear algorithm that directly estimates the pose angles and camera translation</li> <li>a non-linear algorithm that directly estimates the pose angles and camera translation</li>
</ul> </ul>
</li> </li>
<li>Shape fitting, implementation of the linear shape-to-landmarks fitting of O. Aldrian &amp; W. Smith, <em>Inverse Rendering of Faces with a 3D Morphable Model</em>, PAMI 2013</li> <li>Shape fitting, implementation of the linear shape-to-landmarks fitting of O. Aldrian &amp; W. Smith, <em>Inverse Rendering of Faces with a 3D Morphable Model</em>, PAMI 2013</li>
<li>Expression fitting, and 6 linear expression blendshapes: anger, disgust, fear, happiness, sadness, surprise.</li>
<li>Isomap texture extraction to obtain a pose-invariant representation of the face texture.</li> <li>Isomap texture extraction to obtain a pose-invariant representation of the face texture.</li>
</ul> </ul>
<h2>Usage</h2> <h2>Usage</h2>
...@@ -115,32 +117,35 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -115,32 +117,35 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<li>Needed dependencies for the example app: CMake (&gt;=2.8.10), Boost system, filesystem, program_options (&gt;=1.50.0), OpenCV core, imgproc, highgui (&gt;=2.4.3).</li> <li>Needed dependencies for the example app: CMake (&gt;=2.8.10), Boost system, filesystem, program_options (&gt;=1.50.0), OpenCV core, imgproc, highgui (&gt;=2.4.3).</li>
</ul> </ul>
<p>To build:</p> <p>To build:</p>
<ul> <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;git clone https://github.com/patrikhuber/eos.git</div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;mkdir build &amp;&amp; cd build # creates a build directory next to the _eos_ folder</div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;cmake -G &quot;&lt;your favourite generator&gt;&quot; ../eos -DCMAKE_INSTALL_PREFIX=../install/</div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;make &amp;&amp; make install # or open the project file and build in an IDE like Visual Studio</div></div><!-- fragment --><p> If some dependencies can't be found, copy <code>initial_cache.cmake.template</code> to <code>initial_cache.cmake</code>, edit the necessary paths and run <code>cmake</code> with <code>-C ../eos/initial_cache.cmake</code>.</p>
<li>copy <code>initial_cache.cmake.template</code> to <code>initial_cache.cmake</code>, edit the necessary paths</li>
<li>create a build directory next to the <code>eos</code> folder: <code>mkdir build; cd build</code></li>
<li><code>cmake -C ../eos/initial_cache.cmake -G "\&lt;your favourite generator\&gt;" ../eos -DCMAKE_INSTALL_PREFIX=../install/</code></li>
<li>build using your favourite tools, e.g. <code>make; make install</code> or open the solution in Visual Studio.</li>
</ul>
<h2>Sample code</h2> <h2>Sample code</h2>
<p>See <a href="https://github.com/patrikhuber/eos/blob/master/examples/fit-model.cpp">examples/fit-model.cpp</a>.</p> <p>The fit-model example app creates a 3D face from a 2D image.</p>
<p>After <code>make install</code> or running the <code>INSTALL</code> target, an example image with landmarks can be found in <code>install/bin/data/</code>. The model and the necessary landmarks mapping file are installed to <code>install/share/</code>.</p> <p>After <code>make install</code> or running the <code>INSTALL</code> target, an example image with landmarks can be found in <code>install/bin/data/</code>. The model and the necessary landmarks mapping file are installed to <code>install/share/</code>.</p>
<p>You can run the example just by running:</p> <p>You can run the example just by running:</p>
<p><code>fit-model</code></p> <p><code>fit-model</code></p>
<p>Or, by manually specifying the face model, landmark vertex mappings, an image and its 2D landmarks:</p> <p>Or, by manually specifying the face model, landmark-to-vertex mappings, an image and its 2D landmarks:</p>
<p><code>fit-model -m ../share/sfm_shape_3448.bin -p ../share/ibug2did.txt -i data/image_0010.png -l data/image_0010.pts</code></p> <p><code>fit-model -m ../share/sfm_shape_3448.bin -p ../share/ibug2did.txt -i data/image_0010.png -l data/image_0010.pts</code></p>
<p>The output is an <code>obj</code> file with the shape and a <code>png</code> with the extracted isomap. The estimated pose angles and shape coefficients are available in the code via the API.</p> <p>The output is an <code>obj</code> file with the shape and a <code>png</code> with the extracted isomap. The estimated pose angles and shape coefficients are available in the code via the API.</p>
<p>See <a href="https://github.com/patrikhuber/eos/blob/master/examples/fit-model.cpp">examples/fit-model.cpp</a> for the full code.</p>
<h2>The Surrey Face Model</h2>
<p>The library includes a low-resolution shape-only version of the Surrey Morphable Face Model. It is a PCA model of shape variation built from 3D face scans. It comes with uv-coordinates to perform texture remapping.</p>
<div class="image">
<img src="https://raw.githubusercontent.com/patrikhuber/eos/gh-pages/images/sfm_shape_3448_mesh.png" width="20%" alt="Face Model Picture"/>
</div>
<p>The full model is available at <a href="http://www.cvssp.org/facemodel">http://www.cvssp.org/facemodel</a>.</p>
<h2>Documentation</h2> <h2>Documentation</h2>
<p>The code is fully documented with Doxygen, and an online version of the documentation can be accessed here (todo - add link). Alternatively, an up-to-date version can be built by setting <code>-DBUILD_DOCUMENTATION=on</code> and then building the <code>doc</code> target.</p> <p>Doxygen: <a href="http://patrikhuber.github.io/eos/doc/">http://patrikhuber.github.io/eos/doc/</a></p>
<p>The <a href="https://github.com/patrikhuber/eos/blob/master/examples/fit-model.cpp">fit-model example</a> and the <a href="http://patrikhuber.github.io/eos/doc/namespaces.html">Namespace List</a> in doxygen are a good place to start.</p>
<h2>License &amp; contributions</h2> <h2>License &amp; contributions</h2>
<p>This code is licensed under the Apache License, Version 2.0</p> <p>This code is licensed under the Apache License, Version 2.0. The 3D morphable face model under <a href="https://github.com/patrikhuber/eos/blob/master/share/sfm_shape_3448.bin">share/sfm_shape_3448.bin</a> is free for use for non-commercial purposes. For commercial purposes and to obtain other model resolutions, see <a href="http://www.cvssp.org/facemodel">http://www.cvssp.org/facemodel</a>.</p>
<p>Contributions are very welcome! (best in the form of pull requests.) Please use Github issues for any bug reports, ideas, and discussions.</p> <p>Contributions are very welcome! (best in the form of pull requests.) Please use GitHub issues for any bug reports, ideas, and discussions.</p>
<p>If you use this code in your own work, please cite the following paper: <em>Fitting 3D Morphable Models using Local Features</em>, P. Huber, Z. Feng, W. Christmas, J. Kittler, M. Rätsch, IEEE International Conference on Image Processing (ICIP) 2015, Québec City, Canada (<a href="http://arxiv.org/abs/1503.02330">http://arxiv.org/abs/1503.02330</a>). </p> <p>If you use this code in your own work, please cite the following paper: <em>A Multiresolution 3D Morphable Face Model and Fitting Framework</em>, P. Huber, G. Hu, R. Tena, P. Mortazavian, W. Koppen, W. Christmas, M. Rätsch, J. Kittler, International Conference on Computer Vision Theory and Applications (VISAPP) 2016, Rome, Italy <a href="http://www.patrikhuber.ch/files/3DMM_Framework_VISAPP_2016.pdf">[PDF]</a>. </p>
</div></div><!-- contents --> </div></div><!-- contents -->
<!-- start footer part --> <!-- start footer part -->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/fitting/linear_shape_fitting.hpp Source File</title> <title>eos: include/eos/fitting/linear_shape_fitting.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div id="nav-path" class="navpath"> <div id="nav-path" class="navpath">
<ul> <ul>
<li class="navelem"><a class="el" href="dir_ce53d3124a8ddb93985ce6ec479297f4.html">include</a></li><li class="navelem"><a class="el" href="dir_c7ebde285fcef06dba0b090642612638.html">eos</a></li><li class="navelem"><a class="el" href="dir_349d8dd52ed72e674b9a830f9a7a4dcc.html">fitting</a></li> </ul> <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_5c0181df23c28f36a953fd4c7a01cbc0.html">fitting</a></li> </ul>
</div> </div>
</div><!-- top --> </div><!-- top -->
<div class="header"> <div class="header">
...@@ -95,143 +95,19 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -95,143 +95,19 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="title">linear_shape_fitting.hpp</div> </div> <div class="title">linear_shape_fitting.hpp</div> </div>
</div><!--header--> </div><!--header-->
<div class="contents"> <div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div> <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/fitting/linear_shape_fitting.hpp</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2014, 2015 Patrik Huber</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef LINEARSHAPEFITTING_HPP_</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define LINEARSHAPEFITTING_HPP_</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;eos/morphablemodel/MorphableModel.hpp&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="comment">//#include &quot;Eigen/LU&quot;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &quot;boost/optional.hpp&quot;</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor">#include &lt;cassert&gt;</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; <span class="keyword">namespace </span>fitting {</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#ae558a318d1d0c1da35d64b7abb209fac"> 60</a></span>&#160;<span class="keyword">inline</span> std::vector&lt;float&gt; <a class="code" href="namespaceeos_1_1fitting.html#ae558a318d1d0c1da35d64b7abb209fac">fit_shape_to_landmarks_linear</a>(<a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html">morphablemodel::MorphableModel</a> morphable_model, cv::Mat affine_camera_matrix, std::vector&lt;cv::Vec2f&gt; landmarks, std::vector&lt;int&gt; vertex_ids, cv::Mat base_face=cv::Mat(), <span class="keywordtype">float</span> lambda=3.0f, boost::optional&lt;int&gt; num_coefficients_to_fit=boost::optional&lt;int&gt;(), boost::optional&lt;float&gt; detector_standard_deviation=boost::optional&lt;float&gt;(), boost::optional&lt;float&gt; model_standard_deviation=boost::optional&lt;float&gt;())</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;{</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="keyword">using</span> cv::Mat;</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; assert(landmarks.size() == vertex_ids.size());</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="keywordtype">int</span> num_coeffs_to_fit = num_coefficients_to_fit.get_value_or(morphable_model.<a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11">get_shape_model</a>().<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a309148e123fc5fecd3cf10513f75b657">get_num_principal_components</a>());</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keywordtype">int</span> num_landmarks = <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(landmarks.size());</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="keywordflow">if</span> (base_face.empty())</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; {</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; base_face = morphable_model.<a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11">get_shape_model</a>().<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495">get_mean</a>();</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; }</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="comment">// $\hat{V} \in R^{3N\times m-1}$, subselect the rows of the eigenvector matrix $V$ associated with the $N$ feature points</span></div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="comment">// And we insert a row of zeros after every third row, resulting in matrix $\hat{V}_h \in R^{4N\times m-1}$:</span></div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; Mat V_hat_h = Mat::zeros(4 * num_landmarks, num_coeffs_to_fit, CV_32FC1);</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="keywordtype">int</span> row_index = 0;</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; num_landmarks; ++i) {</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; Mat basis_rows = morphable_model.<a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11">get_shape_model</a>().<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#af0597eb2cf01c98e397773740f3a8258">get_normalised_pca_basis</a>(vertex_ids[i]); <span class="comment">// In the paper, the not-normalised basis might be used? I&#39;m not sure, check it. It&#39;s even a mess in the paper. PH 26.5.2014: I think the normalised basis is fine/better.</span></div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="comment">//basisRows.copyTo(V_hat_h.rowRange(rowIndex, rowIndex + 3));</span></div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; basis_rows.colRange(0, num_coeffs_to_fit).copyTo(V_hat_h.rowRange(row_index, row_index + 3));</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; row_index += 4; <span class="comment">// replace 3 rows and skip the 4th one, it has all zeros</span></div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; }</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="comment">// Form a block diagonal matrix $P \in R^{3N\times 4N}$ in which the camera matrix C (P_Affine, affine_camera_matrix) is placed on the diagonal:</span></div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; Mat P = Mat::zeros(3 * num_landmarks, 4 * num_landmarks, CV_32FC1);</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; num_landmarks; ++i) {</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; Mat submatrix_to_replace = P.colRange(4 * i, (4 * i) + 4).rowRange(3 * i, (3 * i) + 3);</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; affine_camera_matrix.copyTo(submatrix_to_replace);</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; }</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="comment">// The variances: Add the 2D and 3D standard deviations.</span></div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="comment">// If the user doesn&#39;t provide them, we choose the following:</span></div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="comment">// 2D (detector) standard deviation: In pixel, we follow [1] and choose sqrt(3) as the default value.</span></div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="comment">// 3D (model) variance: 0.0f. It only makes sense to set it to something when we have a different variance for different vertices.</span></div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="comment">// The 3D variance has to be projected to 2D (for details, see paper [1]) so the units do match up.</span></div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="keywordtype">float</span> sigma_squared_2D = std::pow(detector_standard_deviation.get_value_or(std::sqrt(3.0f)), 2) + std::pow(model_standard_deviation.get_value_or(0.0f), 2);</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; Mat Sigma = Mat::zeros(3 * num_landmarks, 3 * num_landmarks, CV_32FC1);</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 3 * num_landmarks; ++i) {</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; Sigma.at&lt;<span class="keywordtype">float</span>&gt;(i, i) = 1.0f / std::sqrt(sigma_squared_2D); <span class="comment">// the higher the sigma_squared_2D, the smaller the diagonal entries of Sigma will be</span></div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; }</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; Mat Omega = Sigma.t() * Sigma; <span class="comment">// just squares the diagonal</span></div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="comment">// The landmarks in matrix notation (in homogeneous coordinates), $3N\times 1$</span></div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; Mat y = Mat::ones(3 * num_landmarks, 1, CV_32FC1);</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; num_landmarks; ++i) {</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; y.at&lt;<span class="keywordtype">float</span>&gt;(3 * i, 0) = landmarks[i][0];</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; y.at&lt;<span class="keywordtype">float</span>&gt;((3 * i) + 1, 0) = landmarks[i][1];</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <span class="comment">//y.at&lt;float&gt;((3 * i) + 2, 0) = 1; // already 1, stays (homogeneous coordinate)</span></div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; }</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <span class="comment">// The mean, with an added homogeneous coordinate (x_1, y_1, z_1, 1, x_2, ...)^t</span></div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; Mat v_bar = Mat::ones(4 * num_landmarks, 1, CV_32FC1);</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; num_landmarks; ++i) {</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="comment">//cv::Vec4f model_mean = morphable_model.get_shape_model().get_mean_at_point(vertex_ids[i]);</span></div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; cv::Vec4f model_mean(base_face.at&lt;<span class="keywordtype">float</span>&gt;(vertex_ids[i] * 3), base_face.at&lt;<span class="keywordtype">float</span>&gt;(vertex_ids[i] * 3 + 1), base_face.at&lt;<span class="keywordtype">float</span>&gt;(vertex_ids[i] * 3 + 2), 1.0f);</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; v_bar.at&lt;<span class="keywordtype">float</span>&gt;(4 * i, 0) = model_mean[0];</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; v_bar.at&lt;<span class="keywordtype">float</span>&gt;((4 * i) + 1, 0) = model_mean[1];</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; v_bar.at&lt;<span class="keywordtype">float</span>&gt;((4 * i) + 2, 0) = model_mean[2];</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="comment">//v_bar.at&lt;float&gt;((4 * i) + 3, 0) = 1; // already 1, stays (homogeneous coordinate)</span></div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="comment">// note: now that a Vec4f is returned, we could use copyTo?</span></div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; }</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="comment">// Bring into standard regularised quadratic form with diagonal distance matrix Omega</span></div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; Mat A = P * V_hat_h; <span class="comment">// camera matrix times the basis</span></div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; Mat b = P * v_bar - y; <span class="comment">// camera matrix times the mean, minus the landmarks.</span></div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="comment">//Mat c_s; // The x, we solve for this! (the variance-normalised shape parameter vector, $c_s = [a_1/sigma_{s,1} , ..., a_m-1/sigma_{s,m-1}]^t$</span></div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <span class="comment">//int numShapePc = morphableModel.getShapeModel().getNumberOfPrincipalComponents();</span></div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <span class="keyword">const</span> <span class="keywordtype">int</span> num_shape_pc = num_coeffs_to_fit;</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; Mat AtOmegaA = A.t() * Omega * A;</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; Mat AtOmegaAReg = AtOmegaA + lambda * Mat::eye(num_shape_pc, num_shape_pc, CV_32FC1);</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="comment">// Invert (and perform some sanity checks) using Eigen:</span></div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;<span class="comment">/* using RowMajorMatrixXf = Eigen::Matrix&lt;float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor&gt;;</span></div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;<span class="comment"> Eigen::Map&lt;RowMajorMatrixXf&gt; AtOmegaAReg_Eigen(AtOmegaAReg.ptr&lt;float&gt;(), AtOmegaAReg.rows, AtOmegaAReg.cols);</span></div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="comment"> Eigen::FullPivLU&lt;RowMajorMatrixXf&gt; luOfAtOmegaAReg(AtOmegaAReg_Eigen); // Calculate the full-pivoting LU decomposition of the regularized AtA. Note: We could also try FullPivHouseholderQR if our system is non-minimal (i.e. there are more constraints than unknowns).</span></div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;<span class="comment"> auto rankOfAtOmegaAReg = luOfAtOmegaAReg.rank();</span></div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;<span class="comment"> bool isAtOmegaARegInvertible = luOfAtOmegaAReg.isInvertible();</span></div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;<span class="comment"> float threshold = std::abs(luOfAtOmegaAReg.maxPivot()) * luOfAtOmegaAReg.threshold(); // originaly &quot;2 * ...&quot; but I commented it out</span></div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;<span class="comment"> RowMajorMatrixXf AtARegInv_EigenFullLU = luOfAtOmegaAReg.inverse(); // Note: We should use ::solve() instead</span></div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;<span class="comment"> Mat AtOmegaARegInvFullLU(AtARegInv_EigenFullLU.rows(), AtARegInv_EigenFullLU.cols(), CV_32FC1, AtARegInv_EigenFullLU.data()); // create an OpenCV Mat header for the Eigen data</span></div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; <span class="comment">// Solve using OpenCV:</span></div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; Mat c_s; <span class="comment">// Note/Todo: We get coefficients ~ N(0, sigma) I think. They are not multiplied with the eigenvalues.</span></div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <span class="keywordtype">bool</span> non_singular = cv::solve(AtOmegaAReg, -A.t() * Omega.t() * b, c_s, cv::DECOMP_SVD); <span class="comment">// DECOMP_SVD calculates the pseudo-inverse if the matrix is not invertible.</span></div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <span class="comment">// Because we&#39;re using SVD, non_singular will always be true. If we were to use e.g. Cholesky, we could return an expected&lt;T&gt;.</span></div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="keywordflow">return</span> std::vector&lt;float&gt;(c_s);</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;};</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160;</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; } <span class="comment">/* namespace fitting */</span></div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;} <span class="comment">/* namespace eos */</span></div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* LINEARSHAPEFITTING_HPP_ */</span><span class="preprocessor"></span></div><div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_af0597eb2cf01c98e397773740f3a8258"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#af0597eb2cf01c98e397773740f3a8258">eos::morphablemodel::PcaModel::get_normalised_pca_basis</a></div><div class="ttdeci">cv::Mat get_normalised_pca_basis() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:188</div></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_a309148e123fc5fecd3cf10513f75b657"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#a309148e123fc5fecd3cf10513f75b657">eos::morphablemodel::PcaModel::get_num_principal_components</a></div><div class="ttdeci">int get_num_principal_components() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:84</div></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div> <div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&amp;#39;s 3D model fitting functionality. </div></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/fitting/linear_shape_fitting.hpp</span></div> <div class="ttc" id="namespaceeos_1_1fitting_html_ae558a318d1d0c1da35d64b7abb209fac"><div class="ttname"><a href="namespaceeos_1_1fitting.html#ae558a318d1d0c1da35d64b7abb209fac">eos::fitting::fit_shape_to_landmarks_linear</a></div><div class="ttdeci">std::vector&lt; float &gt; fit_shape_to_landmarks_linear(morphablemodel::MorphableModel morphable_model, cv::Mat affine_camera_matrix, std::vector&lt; cv::Vec2f &gt; landmarks, std::vector&lt; int &gt; vertex_ids, cv::Mat base_face=cv::Mat(), float lambda=3.0f, boost::optional&lt; int &gt; num_coefficients_to_fit=boost::optional&lt; int &gt;(), boost::optional&lt; float &gt; detector_standard_deviation=boost::optional&lt; float &gt;(), boost::optional&lt; float &gt; model_standard_deviation=boost::optional&lt; float &gt;())</div><div class="ttdef"><b>Definition:</b> linear_shape_fitting.hpp:60</div></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_af05c96c2a5d3936503b961a9b4238495"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495">eos::morphablemodel::PcaModel::get_mean</a></div><div class="ttdeci">cv::Mat get_mean() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:119</div></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2014, 2015 Patrik Huber</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef LINEARSHAPEFITTING_HPP_</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define LINEARSHAPEFITTING_HPP_</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;eos/morphablemodel/MorphableModel.hpp&quot;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="comment">//#include &quot;Eigen/LU&quot;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;</div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &quot;boost/optional.hpp&quot;</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor">#include &lt;cmath&gt;</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="preprocessor">#include &lt;cassert&gt;</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; <span class="keyword">namespace </span>fitting {</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;</div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#ae68794185075b5b67fddae9d359cf208"> 60</a></span>&#160;<span class="keyword">inline</span> std::vector&lt;float&gt; <a class="code" href="namespaceeos_1_1fitting.html#ae68794185075b5b67fddae9d359cf208">fit_shape_to_landmarks_linear</a>(<a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html">morphablemodel::MorphableModel</a> morphable_model, cv::Mat affine_camera_matrix, std::vector&lt;cv::Vec2f&gt; landmarks, std::vector&lt;int&gt; vertex_ids, <span class="keywordtype">float</span> lambda=3.0f, boost::optional&lt;int&gt; num_coefficients_to_fit=boost::optional&lt;int&gt;(), boost::optional&lt;float&gt; detector_standard_deviation=boost::optional&lt;float&gt;(), boost::optional&lt;float&gt; model_standard_deviation=boost::optional&lt;float&gt;())</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;{</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="keyword">using</span> cv::Mat;</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; assert(landmarks.size() == vertex_ids.size());</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="keywordtype">int</span> num_coeffs_to_fit = num_coefficients_to_fit.get_value_or(morphable_model.<a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11">get_shape_model</a>().<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a309148e123fc5fecd3cf10513f75b657">get_num_principal_components</a>());</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keywordtype">int</span> num_landmarks = <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(landmarks.size());</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="comment">// $\hat{V} \in R^{3N\times m-1}$, subselect the rows of the eigenvector matrix $V$ associated with the $N$ feature points</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="comment">// And we insert a row of zeros after every third row, resulting in matrix $\hat{V}_h \in R^{4N\times m-1}$:</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; Mat V_hat_h = Mat::zeros(4 * num_landmarks, num_coeffs_to_fit, CV_32FC1);</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="keywordtype">int</span> row_index = 0;</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; num_landmarks; ++i) {</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; Mat basis_rows = morphable_model.<a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11">get_shape_model</a>().<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#af0597eb2cf01c98e397773740f3a8258">get_normalised_pca_basis</a>(vertex_ids[i]); <span class="comment">// In the paper, the not-normalised basis might be used? I&#39;m not sure, check it. It&#39;s even a mess in the paper. PH 26.5.2014: I think the normalised basis is fine/better.</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="comment">//basisRows.copyTo(V_hat_h.rowRange(rowIndex, rowIndex + 3));</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; basis_rows.colRange(0, num_coeffs_to_fit).copyTo(V_hat_h.rowRange(row_index, row_index + 3));</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; row_index += 4; <span class="comment">// replace 3 rows and skip the 4th one, it has all zeros</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; }</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="comment">// Form a block diagonal matrix $P \in R^{3N\times 4N}$ in which the camera matrix C (P_Affine, affineCam) is placed on the diagonal:</span></div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; Mat P = Mat::zeros(3 * num_landmarks, 4 * num_landmarks, CV_32FC1);</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; num_landmarks; ++i) {</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; Mat submatrix_to_replace = P.colRange(4 * i, (4 * i) + 4).rowRange(3 * i, (3 * i) + 3);</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; affine_camera_matrix.copyTo(submatrix_to_replace);</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; }</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="comment">// The variances: Add the 2D and 3D standard deviations.</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="comment">// If the user doesn&#39;t provide them, we choose the following:</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="comment">// 2D (detector) standard deviation: In pixel, we follow [1] and choose sqrt(3) as the default value.</span></div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="comment">// 3D (model) variance: 0.0f. It only makes sense to set it to something when we have a different variance for different vertices.</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="comment">// The 3D variance has to be projected to 2D (for details, see paper [1]) so the units do match up.</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="keywordtype">float</span> sigma_squared_2D = std::pow(detector_standard_deviation.get_value_or(std::sqrt(3.0f)), 2) + std::pow(model_standard_deviation.get_value_or(0.0f), 2);</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; Mat Sigma = Mat::zeros(3 * num_landmarks, 3 * num_landmarks, CV_32FC1);</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 3 * num_landmarks; ++i) {</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; Sigma.at&lt;<span class="keywordtype">float</span>&gt;(i, i) = 1.0f / std::sqrt(sigma_squared_2D); <span class="comment">// the higher the sigma_squared_2D, the smaller the diagonal entries of Sigma will be</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; }</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; Mat Omega = Sigma.t() * Sigma; <span class="comment">// just squares the diagonal</span></div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <span class="comment">// The landmarks in matrix notation (in homogeneous coordinates), $3N\times 1$</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; Mat y = Mat::ones(3 * num_landmarks, 1, CV_32FC1);</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; num_landmarks; ++i) {</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; y.at&lt;<span class="keywordtype">float</span>&gt;(3 * i, 0) = landmarks[i][0];</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; y.at&lt;<span class="keywordtype">float</span>&gt;((3 * i) + 1, 0) = landmarks[i][1];</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="comment">//y.at&lt;float&gt;((3 * i) + 2, 0) = 1; // already 1, stays (homogeneous coordinate)</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; }</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <span class="comment">// The mean, with an added homogeneous coordinate (x_1, y_1, z_1, 1, x_2, ...)^t</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; Mat v_bar = Mat::ones(4 * num_landmarks, 1, CV_32FC1);</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; num_landmarks; ++i) {</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; cv::Vec4f model_mean = morphable_model.<a class="code" href="classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11">get_shape_model</a>().<a class="code" href="classeos_1_1morphablemodel_1_1_pca_model.html#a1820ad4e0b9719884811188f3c932592">get_mean_at_point</a>(vertex_ids[i]);</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; v_bar.at&lt;<span class="keywordtype">float</span>&gt;(4 * i, 0) = model_mean[0];</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; v_bar.at&lt;<span class="keywordtype">float</span>&gt;((4 * i) + 1, 0) = model_mean[1];</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; v_bar.at&lt;<span class="keywordtype">float</span>&gt;((4 * i) + 2, 0) = model_mean[2];</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="comment">//v_bar.at&lt;float&gt;((4 * i) + 3, 0) = 1; // already 1, stays (homogeneous coordinate)</span></div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="comment">// note: now that a Vec4f is returned, we could use copyTo?</span></div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; }</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="comment">// Bring into standard regularised quadratic form with diagonal distance matrix Omega</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; Mat A = P * V_hat_h; <span class="comment">// camera matrix times the basis</span></div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; Mat b = P * v_bar - y; <span class="comment">// camera matrix times the mean, minus the landmarks.</span></div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="comment">//Mat c_s; // The x, we solve for this! (the variance-normalised shape parameter vector, $c_s = [a_1/sigma_{s,1} , ..., a_m-1/sigma_{s,m-1}]^t$</span></div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="comment">//int numShapePc = morphableModel.getShapeModel().getNumberOfPrincipalComponents();</span></div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="keywordtype">int</span> num_shape_pc = num_coeffs_to_fit;</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; Mat AtOmegaA = A.t() * Omega * A;</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; Mat AtOmegaAReg = AtOmegaA + lambda * Mat::eye(num_shape_pc, num_shape_pc, CV_32FC1);</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <span class="comment">// Invert using OpenCV:</span></div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; Mat AtOmegaARegInv = AtOmegaAReg.inv(cv::DECOMP_SVD); <span class="comment">// DECOMP_SVD calculates the pseudo-inverse if the matrix is not invertible.</span></div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <span class="comment">// Invert (and perform some sanity checks) using Eigen:</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;<span class="comment">/* using RowMajorMatrixXf = Eigen::Matrix&lt;float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor&gt;;</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;<span class="comment"> Eigen::Map&lt;RowMajorMatrixXf&gt; AtOmegaAReg_Eigen(AtOmegaAReg.ptr&lt;float&gt;(), AtOmegaAReg.rows, AtOmegaAReg.cols);</span></div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;<span class="comment"> Eigen::FullPivLU&lt;RowMajorMatrixXf&gt; luOfAtOmegaAReg(AtOmegaAReg_Eigen); // Calculate the full-pivoting LU decomposition of the regularized AtA. Note: We could also try FullPivHouseholderQR if our system is non-minimal (i.e. there are more constraints than unknowns).</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;<span class="comment"> auto rankOfAtOmegaAReg = luOfAtOmegaAReg.rank();</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;<span class="comment"> bool isAtOmegaARegInvertible = luOfAtOmegaAReg.isInvertible();</span></div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;<span class="comment"> float threshold = std::abs(luOfAtOmegaAReg.maxPivot()) * luOfAtOmegaAReg.threshold(); // originaly &quot;2 * ...&quot; but I commented it out</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="comment"> RowMajorMatrixXf AtARegInv_EigenFullLU = luOfAtOmegaAReg.inverse(); // Note: We should use ::solve() instead</span></div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;<span class="comment"> Mat AtOmegaARegInvFullLU(AtARegInv_EigenFullLU.rows(), AtARegInv_EigenFullLU.cols(), CV_32FC1, AtARegInv_EigenFullLU.data()); // create an OpenCV Mat header for the Eigen data</span></div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;<span class="comment">*/</span></div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; Mat AtOmegatb = A.t() * Omega.t() * b;</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; Mat c_s = -AtOmegaARegInv * AtOmegatb; <span class="comment">// Note/Todo: We get coefficients ~ N(0, sigma) I think. They are not multiplied with the eigenvalues.</span></div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; <span class="keywordflow">return</span> std::vector&lt;float&gt;(c_s);</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;};</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; } <span class="comment">/* namespace fitting */</span></div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;} <span class="comment">/* namespace eos */</span></div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* LINEARSHAPEFITTING_HPP_ */</span><span class="preprocessor"></span></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_af0597eb2cf01c98e397773740f3a8258"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#af0597eb2cf01c98e397773740f3a8258">eos::morphablemodel::PcaModel::get_normalised_pca_basis</a></div><div class="ttdeci">cv::Mat get_normalised_pca_basis() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:190</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_a309148e123fc5fecd3cf10513f75b657"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#a309148e123fc5fecd3cf10513f75b657">eos::morphablemodel::PcaModel::get_num_principal_components</a></div><div class="ttdeci">int get_num_principal_components() const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:83</div></div>
<div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&#39;s 3D model fitting functionality. </div></div>
<div class="ttc" id="namespaceeos_1_1fitting_html_ae68794185075b5b67fddae9d359cf208"><div class="ttname"><a href="namespaceeos_1_1fitting.html#ae68794185075b5b67fddae9d359cf208">eos::fitting::fit_shape_to_landmarks_linear</a></div><div class="ttdeci">std::vector&lt; float &gt; fit_shape_to_landmarks_linear(morphablemodel::MorphableModel morphable_model, cv::Mat affine_camera_matrix, std::vector&lt; cv::Vec2f &gt; landmarks, std::vector&lt; int &gt; vertex_ids, float lambda=3.0f, boost::optional&lt; int &gt; num_coefficients_to_fit=boost::optional&lt; int &gt;(), boost::optional&lt; float &gt; detector_standard_deviation=boost::optional&lt; float &gt;(), boost::optional&lt; float &gt; model_standard_deviation=boost::optional&lt; float &gt;())</div><div class="ttdef"><b>Definition:</b> linear_shape_fitting.hpp:60</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html_a990bf9c518307c811691facb8c1daa11"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11">eos::morphablemodel::MorphableModel::get_shape_model</a></div><div class="ttdeci">PcaModel get_shape_model() const </div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:77</div></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html_a990bf9c518307c811691facb8c1daa11"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11">eos::morphablemodel::MorphableModel::get_shape_model</a></div><div class="ttdeci">PcaModel get_shape_model() const </div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:77</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_pca_model_html_a1820ad4e0b9719884811188f3c932592"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_pca_model.html#a1820ad4e0b9719884811188f3c932592">eos::morphablemodel::PcaModel::get_mean_at_point</a></div><div class="ttdeci">cv::Vec4f get_mean_at_point(int vertex_index) const </div><div class="ttdef"><b>Definition:</b> PcaModel.hpp:129</div></div>
<div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a></div><div class="ttdoc">A class representing a 3D Morphable Model, consisting of a shape- and colour (albedo) PCA model...</div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:54</div></div> <div class="ttc" id="classeos_1_1morphablemodel_1_1_morphable_model_html"><div class="ttname"><a href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a></div><div class="ttdoc">A class representing a 3D Morphable Model, consisting of a shape- and colour (albedo) PCA model...</div><div class="ttdef"><b>Definition:</b> MorphableModel.hpp:54</div></div>
</div><!-- fragment --></div><!-- contents --> </div><!-- fragment --></div><!-- contents -->
<!-- start footer part --> <!-- start footer part -->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/morphablemodel/io/mat_cerealisation.hpp Source File</title> <title>eos: include/eos/morphablemodel/io/mat_cerealisation.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div id="nav-path" class="navpath"> <div id="nav-path" class="navpath">
<ul> <ul>
<li class="navelem"><a class="el" href="dir_ce53d3124a8ddb93985ce6ec479297f4.html">include</a></li><li class="navelem"><a class="el" href="dir_c7ebde285fcef06dba0b090642612638.html">eos</a></li><li class="navelem"><a class="el" href="dir_a487f496b1daaab0ce4d44d536b7440b.html">morphablemodel</a></li><li class="navelem"><a class="el" href="dir_98df3b346fc34412198a19044150842b.html">io</a></li> </ul> <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_8c2f38a39d6204ca353f500c7575d762.html">morphablemodel</a></li><li class="navelem"><a class="el" href="dir_987dbb4ef52a44c98ac43896696e0fee.html">io</a></li> </ul>
</div> </div>
</div><!-- top --> </div><!-- top -->
<div class="header"> <div class="header">
...@@ -95,106 +95,16 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -95,106 +95,16 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="title">mat_cerealisation.hpp</div> </div> <div class="title">mat_cerealisation.hpp</div> </div>
</div><!--header--> </div><!--header-->
<div class="contents"> <div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div> <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment">* Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment">*</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment">* File: include/eos/morphablemodel/io/mat_cerealisation.hpp</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2015, 2016 Patrik Huber</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef MATCEREALISATION_HPP_</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define MATCEREALISATION_HPP_</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;cereal/cereal.hpp&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="namespacecv.html"> 38</a></span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacecv.html">cv</a> {</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;template&lt;class Archive, cereal::traits::DisableIf&lt;cereal::traits::is_text_archive&lt;Archive&gt;::value&gt;</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; = cereal::traits::sfinae&gt;</div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="namespacecv.html#a758b4418894b35447bfd472847c1dfaf"> 50</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacecv.html#a758b4418894b35447bfd472847c1dfaf">save</a>(Archive&amp; ar, <span class="keyword">const</span> cv::Mat&amp; mat)</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;{</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="keywordtype">int</span> rows, cols, type;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; <span class="keywordtype">bool</span> continuous;</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; rows = mat.rows;</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; cols = mat.cols;</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; type = mat.type();</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; continuous = mat.isContinuous();</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; ar &amp; rows &amp; cols &amp; type &amp; continuous;</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="keywordflow">if</span> (continuous) {</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="keyword">const</span> <span class="keywordtype">int</span> data_size = rows * cols * <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(mat.elemSize());</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="keyword">auto</span> mat_data = cereal::binary_data(mat.ptr(), data_size);</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; ar &amp; mat_data;</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; }</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="keywordflow">else</span> {</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="keyword">const</span> <span class="keywordtype">int</span> row_size = cols * <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(mat.elemSize());</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; rows; i++) {</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="keyword">auto</span> row_data = cereal::binary_data(mat.ptr(i), row_size);</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; ar &amp; row_data;</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; }</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; }</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;};</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;template&lt;class Archive, cereal::traits::DisableIf&lt;cereal::traits::is_text_archive&lt;Archive&gt;::value&gt;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; = cereal::traits::sfinae&gt;</div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="namespacecv.html#a9efebfa4f4c3e7117f0effe0ef18fd61"> 86</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacecv.html#a9efebfa4f4c3e7117f0effe0ef18fd61">load</a>(Archive&amp; ar, cv::Mat&amp; mat)</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;{</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="keywordtype">int</span> rows, cols, type;</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="keywordtype">bool</span> continuous;</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; ar &amp; rows &amp; cols &amp; type &amp; continuous;</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keywordflow">if</span> (continuous) {</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; mat.create(rows, cols, type);</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <span class="keyword">const</span> <span class="keywordtype">int</span> data_size = rows * cols * <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(mat.elemSize());</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="keyword">auto</span> mat_data = cereal::binary_data(mat.ptr(), data_size);</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; ar &amp; mat_data;</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; }</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keywordflow">else</span> {</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; mat.create(rows, cols, type);</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <span class="keyword">const</span> <span class="keywordtype">int</span> row_size = cols * <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(mat.elemSize());</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; rows; i++) {</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <span class="keyword">auto</span> row_data = cereal::binary_data(mat.ptr(i), row_size);</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; ar &amp; row_data;</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; }</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; }</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;};</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">class </span>Archive,</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; cereal::traits::EnableIf&lt;cereal::traits::is_text_archive&lt;Archive&gt;::value&gt;</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; = cereal::traits::sfinae&gt;</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <span class="keywordtype">void</span> <a class="code" href="namespacecv.html#a758b4418894b35447bfd472847c1dfaf">save</a>(Archive&amp; ar, <span class="keyword">const</span> cv::Mat&amp; mat)</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;{</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="keywordtype">int</span> rows, cols, type;</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="keywordtype">bool</span> continuous;</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; rows = mat.rows;</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; cols = mat.cols;</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; type = mat.type();</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; continuous = mat.isContinuous();</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160;</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; <span class="comment">//ar &amp; rows &amp; cols &amp; type &amp; continuous;</span></div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; assert(mat.dims == 2); <span class="comment">// correct?</span></div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <span class="keywordflow">if</span> (continuous) { <span class="comment">// We go row by row anyway so no need for this distinction?</span></div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="comment">//const int data_size = rows * cols * static_cast&lt;int&gt;(mat.elemSize());</span></div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <span class="comment">//std::vector&lt;float&gt; test(mat.begin&lt;float&gt;(), mat.end&lt;float&gt;());</span></div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <span class="comment">//ar &amp; test;</span></div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; std::vector&lt;std::vector&lt;float&gt;&gt; mat_data;</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; rows; i++) {</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; Mat this_row = mat.row(i); <span class="comment">// need a temporary, otherwise goes up to 8GB RAM usage</span></div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; mat_data.push_back(std::vector&lt;float&gt;(this_row.begin&lt;<span class="keywordtype">float</span>&gt;(), this_row.end&lt;<span class="keywordtype">float</span>&gt;()));</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; }</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; ar &amp; cereal::make_nvp(<span class="stringliteral">&quot;data&quot;</span>, mat_data); <span class="comment">// Can we somehow not give this a name and make it like the &quot;root&quot; node, part of the parent object? Maybe look at the std::string serialisation?</span></div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; }</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <span class="keywordflow">else</span> {</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; <span class="keyword">const</span> <span class="keywordtype">int</span> row_size = cols * <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(mat.elemSize());</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; rows; i++) {</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <span class="comment">//auto row_data = cereal::binary_data(mat.ptr(i), row_size);</span></div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <span class="comment">//ar &amp; row_data;</span></div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; }</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; }</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;};</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160;</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">class </span>Archive,</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; cereal::traits::EnableIf&lt;cereal::traits::is_text_archive&lt;Archive&gt;::value&gt;</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; = cereal::traits::sfinae&gt;</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; <span class="keywordtype">void</span> <a class="code" href="namespacecv.html#a9efebfa4f4c3e7117f0effe0ef18fd61">load</a>(Archive&amp; ar, cv::Mat&amp; mat)</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160;{</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <span class="comment">//int rows, cols, type;</span></div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="comment">//bool continuous;</span></div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="comment">//ar &amp; rows &amp; cols &amp; type &amp; continuous;</span></div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; std::vector&lt;std::vector&lt;float&gt;&gt; mat_data;</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; ar &amp; mat_data;</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; assert(mat_data.size() &gt; 0); <span class="comment">// hmm can&#39;t store empty cv::Mat&#39;s... not so nice. Will create problems with SFM shape-only models?</span></div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; <span class="keywordtype">int</span> rows = <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(mat_data.size());</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="keywordtype">int</span> cols = <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(mat_data[0].size());</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; mat.create(rows, cols, CV_32FC1);</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> r = 0; r &lt; rows; ++r) {</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> c = 0; c &lt; cols; ++c) {</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; mat.at&lt;<span class="keywordtype">float</span>&gt;(r, c) = mat_data[r][c];</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; }</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; }</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160;</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160;<span class="comment">/* mat.create(rows, cols, type);</span></div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160;<span class="comment"> const int data_size = rows * cols * static_cast&lt;int&gt;(mat.elemSize());</span></div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160;<span class="comment"> auto mat_data = cereal::binary_data(mat.ptr(), data_size);</span></div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160;<span class="comment"> ar &amp; mat_data;</span></div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160;<span class="comment"> </span></div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160;<span class="comment"> mat.create(rows, cols, type);</span></div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160;<span class="comment"> const int row_size = cols * static_cast&lt;int&gt;(mat.elemSize());</span></div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160;<span class="comment"> for (int i = 0; i &lt; rows; i++) {</span></div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160;<span class="comment"> auto row_data = cereal::binary_data(mat.ptr(i), row_size);</span></div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160;<span class="comment"> ar &amp; row_data;</span></div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160;<span class="comment"> }*/</span></div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160;};</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160;</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160;</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">class</span> Archive&gt;</div><div class="line"><a name="l00218"></a><span class="lineno"><a class="line" href="namespacecv.html#a51eb61cb95a3e45290a030560ac7a2cd"> 218</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacecv.html#a51eb61cb95a3e45290a030560ac7a2cd">serialize</a>(Archive&amp; ar, cv::Vec2f&amp; vec)</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160;{</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; ar(vec[0], vec[1]);</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160;};</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160;</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160;} <span class="comment">/* namespace cv */</span></div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160;</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* MATCEREALISATION_HPP_ */</span><span class="preprocessor"></span></div><div class="ttc" id="namespacecv_html_a9efebfa4f4c3e7117f0effe0ef18fd61"><div class="ttname"><a href="namespacecv.html#a9efebfa4f4c3e7117f0effe0ef18fd61">cv::load</a></div><div class="ttdeci">void load(Archive &amp;ar, cv::Mat &amp;mat)</div><div class="ttdoc">De-serialise a cv::Mat using cereal. </div><div class="ttdef"><b>Definition:</b> mat_cerealisation.hpp:86</div></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * superviseddescent: A C++11 implementation of the supervised descent</span></div> <div class="ttc" id="namespacecv_html"><div class="ttname"><a href="namespacecv.html">cv</a></div><div class="ttdoc">Serialisation of OpenCV cv::Mat matrices for the serialisation library cereal (http://uscilab.github.io/cereal/index.html). </div><div class="ttdef"><b>Definition:</b> mat_cerealisation.hpp:38</div></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> * optimisation method</span></div> <div class="ttc" id="namespacecv_html_a758b4418894b35447bfd472847c1dfaf"><div class="ttname"><a href="namespacecv.html#a758b4418894b35447bfd472847c1dfaf">cv::save</a></div><div class="ttdeci">void save(Archive &amp;ar, const cv::Mat &amp;mat)</div><div class="ttdoc">Serialise a cv::Mat using cereal. </div><div class="ttdef"><b>Definition:</b> mat_cerealisation.hpp:50</div></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: superviseddescent/matcerealisation.hpp</span></div> <div class="ttc" id="namespacecv_html_a51eb61cb95a3e45290a030560ac7a2cd"><div class="ttname"><a href="namespacecv.html#a51eb61cb95a3e45290a030560ac7a2cd">cv::serialize</a></div><div class="ttdeci">void serialize(Archive &amp;ar, cv::Vec2f &amp;vec)</div><div class="ttdoc">Serialisation of a cv::Vec2f using cereal. </div><div class="ttdef"><b>Definition:</b> mat_cerealisation.hpp:218</div></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2015 Patrik Huber</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef MATCEREALISATION_HPP_</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define MATCEREALISATION_HPP_</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;cereal/cereal.hpp&quot;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="namespacecv.html"> 33</a></span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacecv.html">cv</a> {</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">class</span> Archive&gt;</div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="namespacecv.html#a62cc822cc258c9305ac746d3a832f9d4"> 44</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacecv.html#a62cc822cc258c9305ac746d3a832f9d4">save</a>(Archive&amp; ar, <span class="keyword">const</span> cv::Mat&amp; mat)</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;{</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <span class="keywordtype">int</span> rows, cols, type;</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <span class="keywordtype">bool</span> continuous;</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;</div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; rows = mat.rows;</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; cols = mat.cols;</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; type = mat.type();</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; continuous = mat.isContinuous();</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; ar &amp; rows &amp; cols &amp; type &amp; continuous;</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; <span class="keywordflow">if</span> (continuous) {</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <span class="keyword">const</span> <span class="keywordtype">int</span> data_size = rows * cols * <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(mat.elemSize());</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <span class="keyword">auto</span> mat_data = cereal::binary_data(mat.ptr(), data_size);</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; ar &amp; mat_data;</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; }</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="keyword">const</span> <span class="keywordtype">int</span> row_size = cols * <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(mat.elemSize());</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; rows; i++) {</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="keyword">auto</span> row_data = cereal::binary_data(mat.ptr(i), row_size);</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; ar &amp; row_data;</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; }</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; }</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;};</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">class</span> Archive&gt;</div>
<div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="namespacecv.html#a7172a20ab6627a1c1967d322bdfc8756"> 79</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacecv.html#a7172a20ab6627a1c1967d322bdfc8756">load</a>(Archive&amp; ar, cv::Mat&amp; mat)</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;{</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="keywordtype">int</span> rows, cols, type;</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="keywordtype">bool</span> continuous;</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; ar &amp; rows &amp; cols &amp; type &amp; continuous;</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="keywordflow">if</span> (continuous) {</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; mat.create(rows, cols, type);</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="keyword">const</span> <span class="keywordtype">int</span> data_size = rows * cols * <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(mat.elemSize());</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="keyword">auto</span> mat_data = cereal::binary_data(mat.ptr(), data_size);</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; ar &amp; mat_data;</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; }</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; mat.create(rows, cols, type);</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="keyword">const</span> <span class="keywordtype">int</span> row_size = cols * <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(mat.elemSize());</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; rows; i++) {</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="keyword">auto</span> row_data = cereal::binary_data(mat.ptr(i), row_size);</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; ar &amp; row_data;</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; }</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; }</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;};</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">class</span> Archive&gt;</div>
<div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="namespacecv.html#a51eb61cb95a3e45290a030560ac7a2cd"> 109</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacecv.html#a51eb61cb95a3e45290a030560ac7a2cd">serialize</a>(Archive&amp; ar, cv::Vec2f&amp; vec)</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160;{</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; ar(vec[0], vec[1]);</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;};</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;}</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* MATCEREALISATION_HPP_ */</span><span class="preprocessor"></span></div>
<div class="ttc" id="namespacecv_html"><div class="ttname"><a href="namespacecv.html">cv</a></div><div class="ttdoc">Serialisation of OpenCV cv::Mat matrices for the serialisation library cereal (http://uscilab.github.io/cereal/index.html). </div><div class="ttdef"><b>Definition:</b> mat_cerealisation.hpp:33</div></div>
<div class="ttc" id="namespacecv_html_a62cc822cc258c9305ac746d3a832f9d4"><div class="ttname"><a href="namespacecv.html#a62cc822cc258c9305ac746d3a832f9d4">cv::save</a></div><div class="ttdeci">void save(Archive &amp;ar, const cv::Mat &amp;mat)</div><div class="ttdoc">Serialise a cv::Mat using cereal. </div><div class="ttdef"><b>Definition:</b> mat_cerealisation.hpp:44</div></div>
<div class="ttc" id="namespacecv_html_a7172a20ab6627a1c1967d322bdfc8756"><div class="ttname"><a href="namespacecv.html#a7172a20ab6627a1c1967d322bdfc8756">cv::load</a></div><div class="ttdeci">void load(Archive &amp;ar, cv::Mat &amp;mat)</div><div class="ttdoc">De-serialise a cv::Mat using cereal. </div><div class="ttdef"><b>Definition:</b> mat_cerealisation.hpp:79</div></div>
<div class="ttc" id="namespacecv_html_a51eb61cb95a3e45290a030560ac7a2cd"><div class="ttname"><a href="namespacecv.html#a51eb61cb95a3e45290a030560ac7a2cd">cv::serialize</a></div><div class="ttdeci">void serialize(Archive &amp;ar, cv::Vec2f &amp;vec)</div><div class="ttdoc">Serialisation of a cv::Vec2f using cereal. </div><div class="ttdef"><b>Definition:</b> mat_cerealisation.hpp:109</div></div>
</div><!-- fragment --></div><!-- contents --> </div><!-- fragment --></div><!-- contents -->
<!-- start footer part --> <!-- start footer part -->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: cv Namespace Reference</title> <title>eos: cv Namespace Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -100,14 +100,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -100,14 +100,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<table class="memberdecls"> <table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr> Functions</h2></td></tr>
<tr class="memitem:a62cc822cc258c9305ac746d3a832f9d4"><td class="memTemplParams" colspan="2">template&lt;class Archive &gt; </td></tr> <tr class="memitem:a758b4418894b35447bfd472847c1dfaf"><td class="memTemplParams" colspan="2">template&lt;class Archive , cereal::traits::DisableIf&lt; cereal::traits::is_text_archive&lt; Archive &gt;::value &gt; = cereal::traits::sfinae&gt; </td></tr>
<tr class="memitem:a62cc822cc258c9305ac746d3a832f9d4"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacecv.html#a62cc822cc258c9305ac746d3a832f9d4">save</a> (Archive &amp;ar, const cv::Mat &amp;mat)</td></tr> <tr class="memitem:a758b4418894b35447bfd472847c1dfaf"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacecv.html#a758b4418894b35447bfd472847c1dfaf">save</a> (Archive &amp;ar, const cv::Mat &amp;mat)</td></tr>
<tr class="memdesc:a62cc822cc258c9305ac746d3a832f9d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serialise a cv::Mat using cereal. <a href="#a62cc822cc258c9305ac746d3a832f9d4">More...</a><br /></td></tr> <tr class="memdesc:a758b4418894b35447bfd472847c1dfaf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serialise a cv::Mat using cereal. <a href="#a758b4418894b35447bfd472847c1dfaf">More...</a><br /></td></tr>
<tr class="separator:a62cc822cc258c9305ac746d3a832f9d4"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a758b4418894b35447bfd472847c1dfaf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7172a20ab6627a1c1967d322bdfc8756"><td class="memTemplParams" colspan="2">template&lt;class Archive &gt; </td></tr> <tr class="memitem:a9efebfa4f4c3e7117f0effe0ef18fd61"><td class="memTemplParams" colspan="2">template&lt;class Archive , cereal::traits::DisableIf&lt; cereal::traits::is_text_archive&lt; Archive &gt;::value &gt; = cereal::traits::sfinae&gt; </td></tr>
<tr class="memitem:a7172a20ab6627a1c1967d322bdfc8756"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacecv.html#a7172a20ab6627a1c1967d322bdfc8756">load</a> (Archive &amp;ar, cv::Mat &amp;mat)</td></tr> <tr class="memitem:a9efebfa4f4c3e7117f0effe0ef18fd61"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacecv.html#a9efebfa4f4c3e7117f0effe0ef18fd61">load</a> (Archive &amp;ar, cv::Mat &amp;mat)</td></tr>
<tr class="memdesc:a7172a20ab6627a1c1967d322bdfc8756"><td class="mdescLeft">&#160;</td><td class="mdescRight">De-serialise a cv::Mat using cereal. <a href="#a7172a20ab6627a1c1967d322bdfc8756">More...</a><br /></td></tr> <tr class="memdesc:a9efebfa4f4c3e7117f0effe0ef18fd61"><td class="mdescLeft">&#160;</td><td class="mdescRight">De-serialise a cv::Mat using cereal. <a href="#a9efebfa4f4c3e7117f0effe0ef18fd61">More...</a><br /></td></tr>
<tr class="separator:a7172a20ab6627a1c1967d322bdfc8756"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a9efebfa4f4c3e7117f0effe0ef18fd61"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51eb61cb95a3e45290a030560ac7a2cd"><td class="memTemplParams" colspan="2">template&lt;class Archive &gt; </td></tr> <tr class="memitem:a51eb61cb95a3e45290a030560ac7a2cd"><td class="memTemplParams" colspan="2">template&lt;class Archive &gt; </td></tr>
<tr class="memitem:a51eb61cb95a3e45290a030560ac7a2cd"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacecv.html#a51eb61cb95a3e45290a030560ac7a2cd">serialize</a> (Archive &amp;ar, cv::Vec2f &amp;vec)</td></tr> <tr class="memitem:a51eb61cb95a3e45290a030560ac7a2cd"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacecv.html#a51eb61cb95a3e45290a030560ac7a2cd">serialize</a> (Archive &amp;ar, cv::Vec2f &amp;vec)</td></tr>
<tr class="memdesc:a51eb61cb95a3e45290a030560ac7a2cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serialisation of a cv::Vec2f using cereal. <a href="#a51eb61cb95a3e45290a030560ac7a2cd">More...</a><br /></td></tr> <tr class="memdesc:a51eb61cb95a3e45290a030560ac7a2cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serialisation of a cv::Vec2f using cereal. <a href="#a51eb61cb95a3e45290a030560ac7a2cd">More...</a><br /></td></tr>
...@@ -115,12 +115,14 @@ Functions</h2></td></tr> ...@@ -115,12 +115,14 @@ Functions</h2></td></tr>
</table> </table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Serialisation of OpenCV <code>cv::Mat</code> matrices for the serialisation library cereal (<a href="http://uscilab.github.io/cereal/index.html">http://uscilab.github.io/cereal/index.html</a>). </p> <div class="textblock"><p>Serialisation of OpenCV <code>cv::Mat</code> matrices for the serialisation library cereal (<a href="http://uscilab.github.io/cereal/index.html">http://uscilab.github.io/cereal/index.html</a>). </p>
<p>Contains serialisation for <code>cv::Mat</code> matrices to binary archives, and serialisation of cv::Vec2f.</p>
<p>Contains also an experimental serialisation to save/load cv::Mat's from JSON. </p>
</div><h2 class="groupheader">Function Documentation</h2> </div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a7172a20ab6627a1c1967d322bdfc8756"></a> <a class="anchor" id="a9efebfa4f4c3e7117f0effe0ef18fd61"></a>
<div class="memitem"> <div class="memitem">
<div class="memproto"> <div class="memproto">
<div class="memtemplate"> <div class="memtemplate">
template&lt;class Archive &gt; </div> template&lt;class Archive , cereal::traits::DisableIf&lt; cereal::traits::is_text_archive&lt; Archive &gt;::value &gt; = cereal::traits::sfinae&gt; </div>
<table class="memname"> <table class="memname">
<tr> <tr>
<td class="memname">void cv::load </td> <td class="memname">void cv::load </td>
...@@ -143,7 +145,16 @@ template&lt;class Archive &gt; </div> ...@@ -143,7 +145,16 @@ template&lt;class Archive &gt; </div>
</div><div class="memdoc"> </div><div class="memdoc">
<p>De-serialise a cv::Mat using cereal. </p> <p>De-serialise a cv::Mat using cereal. </p>
<p>De-serialise a cv::Mat using cereal, for text archives (JSON specifically).</p>
<p>Supports all types of matrices as well as non-contiguous ones.</p> <p>Supports all types of matrices as well as non-contiguous ones.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">ar</td><td>The archive to deserialise from. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">mat</td><td>The matrix to deserialise into.</td></tr>
</table>
</dd>
</dl>
<p>Experimental: This specialisation is enabled for text archives (e.g. XML, JSON), and was created to convert the JSON output from the BFM Matlab converter script to a cereal binary model. See the notes of the <a class="el" href="namespacecv.html#a758b4418894b35447bfd472847c1dfaf" title="Serialise a cv::Mat using cereal. ">save()</a> method!</p>
<dl class="params"><dt>Parameters</dt><dd> <dl class="params"><dt>Parameters</dt><dd>
<table class="params"> <table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">ar</td><td>The archive to deserialise from. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">ar</td><td>The archive to deserialise from. </td></tr>
...@@ -154,11 +165,11 @@ template&lt;class Archive &gt; </div> ...@@ -154,11 +165,11 @@ template&lt;class Archive &gt; </div>
</div> </div>
</div> </div>
<a class="anchor" id="a62cc822cc258c9305ac746d3a832f9d4"></a> <a class="anchor" id="a758b4418894b35447bfd472847c1dfaf"></a>
<div class="memitem"> <div class="memitem">
<div class="memproto"> <div class="memproto">
<div class="memtemplate"> <div class="memtemplate">
template&lt;class Archive &gt; </div> template&lt;class Archive , cereal::traits::DisableIf&lt; cereal::traits::is_text_archive&lt; Archive &gt;::value &gt; = cereal::traits::sfinae&gt; </div>
<table class="memname"> <table class="memname">
<tr> <tr>
<td class="memname">void cv::save </td> <td class="memname">void cv::save </td>
...@@ -181,7 +192,20 @@ template&lt;class Archive &gt; </div> ...@@ -181,7 +192,20 @@ template&lt;class Archive &gt; </div>
</div><div class="memdoc"> </div><div class="memdoc">
<p>Serialise a cv::Mat using cereal. </p> <p>Serialise a cv::Mat using cereal. </p>
<p>Serialise a cv::Mat using cereal, for text archives (JSON specifically).</p>
<p>Supports all types of matrices as well as non-contiguous ones.</p> <p>Supports all types of matrices as well as non-contiguous ones.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">ar</td><td>The archive to serialise to. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">mat</td><td>The matrix to serialise.</td></tr>
</table>
</dd>
</dl>
<p>Experimental: This specialisation is enabled for text archives (e.g. XML, JSON), and was created to convert the JSON output from the BFM Matlab converter script to a cereal binary model.</p>
<p>Notes:</p><ul>
<li>Only for 2-dim matrices, and float values, i.e. CV_32FC1 cv::Mat's. Actually, <em>only</em> 32FC1, because of the <a class="el" href="namespacecv.html#a9efebfa4f4c3e7117f0effe0ef18fd61" title="De-serialise a cv::Mat using cereal. ">load()</a> method. In fact, maybe we should store the type, since we're storing cv::Mat's.</li>
<li>Writes the data row-wise to a json array? or a json object?</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd> <dl class="params"><dt>Parameters</dt><dd>
<table class="params"> <table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">ar</td><td>The archive to serialise to. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">ar</td><td>The archive to serialise to. </td></tr>
...@@ -234,7 +258,7 @@ template&lt;class Archive &gt; </div> ...@@ -234,7 +258,7 @@ template&lt;class Archive &gt; </div>
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: eos Namespace Reference</title> <title>eos: eos Namespace Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -120,7 +120,7 @@ Namespaces</h2></td></tr> ...@@ -120,7 +120,7 @@ Namespaces</h2></td></tr>
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: eos::core Namespace Reference</title> <title>eos: eos::core Namespace Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -174,7 +174,7 @@ template&lt;class T &gt; </div> ...@@ -174,7 +174,7 @@ template&lt;class T &gt; </div>
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: eos::fitting Namespace Reference</title> <title>eos: eos::fitting Namespace Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -94,6 +94,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -94,6 +94,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="header"> <div class="header">
<div class="summary"> <div class="summary">
<a href="#nested-classes">Classes</a> &#124; <a href="#nested-classes">Classes</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a> </div> <a href="#func-members">Functions</a> </div>
<div class="headertitle"> <div class="headertitle">
<div class="title">eos::fitting Namespace Reference</div> </div> <div class="title">eos::fitting Namespace Reference</div> </div>
...@@ -105,40 +106,92 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -105,40 +106,92 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<table class="memberdecls"> <table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr> Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1fitting_1_1_contour_landmarks.html">ContourLandmarks</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Defines which 2D landmarks comprise the right and left face contour. <a href="structeos_1_1fitting_1_1_contour_landmarks.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1fitting_1_1_frustum.html">Frustum</a></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1fitting_1_1_frustum.html">Frustum</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A class representing a camera viewing frustum. At the moment used as orthographic camera only. <a href="structeos_1_1fitting_1_1_frustum.html#details">More...</a><br /></td></tr> <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A class representing a camera viewing frustum. At the moment used as orthographic camera only. <a href="structeos_1_1fitting_1_1_frustum.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">OrthographicRenderingParameters</a></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1fitting_1_1_model_contour.html">ModelContour</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Represents a set of estimated model parameters (rotation, translation) and camera parameters (viewing frustum). <a href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html#details">More...</a><br /></td></tr> <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Definition of the vertex indices that define the right and left model contour. <a href="structeos_1_1fitting_1_1_model_contour.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">RenderingParameters</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Represents a set of estimated model parameters (rotation, translation) and camera parameters (viewing frustum). <a href="structeos_1_1fitting_1_1_rendering_parameters.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls"> </table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a63fce336daef96cde45f61701c4a3cf4"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#a63fce336daef96cde45f61701c4a3cf4">CameraType</a> { <b>Orthographic</b>,
<b>Perspective</b>
}<tr class="memdesc:a63fce336daef96cde45f61701c4a3cf4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Type of a camera (projection). <a href="namespaceeos_1_1fitting.html#a63fce336daef96cde45f61701c4a3cf4">More...</a><br /></td></tr>
</td></tr>
<tr class="separator:a63fce336daef96cde45f61701c4a3cf4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr> Functions</h2></td></tr>
<tr class="memitem:afce5f7297094056a04ad26785c94bbd8"><td class="memItemLeft" align="right" valign="top">cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#afce5f7297094056a04ad26785c94bbd8">estimate_affine_camera</a> (std::vector&lt; cv::Vec2f &gt; image_points, std::vector&lt; cv::Vec4f &gt; model_points)</td></tr> <tr class="memitem:afce5f7297094056a04ad26785c94bbd8"><td class="memItemLeft" align="right" valign="top">cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#afce5f7297094056a04ad26785c94bbd8">estimate_affine_camera</a> (std::vector&lt; cv::Vec2f &gt; image_points, std::vector&lt; cv::Vec4f &gt; model_points)</td></tr>
<tr class="separator:afce5f7297094056a04ad26785c94bbd8"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:afce5f7297094056a04ad26785c94bbd8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e99a34e412f0bb5b2c6568dd37ae413"><td class="memItemLeft" align="right" valign="top">cv::Vec2f&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#a3e99a34e412f0bb5b2c6568dd37ae413">project_affine</a> (cv::Vec4f vertex, cv::Mat affine_camera_matrix, int screen_width, int screen_height)</td></tr> <tr class="memitem:a3e99a34e412f0bb5b2c6568dd37ae413"><td class="memItemLeft" align="right" valign="top">cv::Vec2f&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#a3e99a34e412f0bb5b2c6568dd37ae413">project_affine</a> (cv::Vec4f vertex, cv::Mat affine_camera_matrix, int screen_width, int screen_height)</td></tr>
<tr class="separator:a3e99a34e412f0bb5b2c6568dd37ae413"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a3e99a34e412f0bb5b2c6568dd37ae413"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae68794185075b5b67fddae9d359cf208"><td class="memItemLeft" align="right" valign="top">std::vector&lt; float &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#ae68794185075b5b67fddae9d359cf208">fit_shape_to_landmarks_linear</a> (<a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">morphablemodel::MorphableModel</a> morphable_model, cv::Mat affine_camera_matrix, std::vector&lt; cv::Vec2f &gt; landmarks, std::vector&lt; int &gt; vertex_ids, float lambda=3.0f, boost::optional&lt; int &gt; num_coefficients_to_fit=boost::optional&lt; int &gt;(), boost::optional&lt; float &gt; detector_standard_deviation=boost::optional&lt; float &gt;(), boost::optional&lt; float &gt; model_standard_deviation=boost::optional&lt; float &gt;())</td></tr> <tr class="memitem:ac429313cbc0ed61744f1b0fa4dba672b"><td class="memItemLeft" align="right" valign="top">std::vector&lt; float &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#ac429313cbc0ed61744f1b0fa4dba672b">fit_blendshapes_to_landmarks_linear</a> (std::vector&lt; <a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html">eos::morphablemodel::Blendshape</a> &gt; blendshapes, cv::Mat face_instance, cv::Mat affine_camera_matrix, std::vector&lt; cv::Vec2f &gt; landmarks, std::vector&lt; int &gt; vertex_ids, float lambda=500.0f)</td></tr>
<tr class="separator:ae68794185075b5b67fddae9d359cf208"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:ac429313cbc0ed61744f1b0fa4dba672b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6a307eaa4a1a9f2c5e2c33a95a6e261d"><td class="memItemLeft" align="right" valign="top">std::pair&lt; std::vector&lt; std::string &gt;, std::vector&lt; int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#a6a307eaa4a1a9f2c5e2c33a95a6e261d">select_contour</a> (float yaw_angle, const <a class="el" href="structeos_1_1fitting_1_1_contour_landmarks.html">ContourLandmarks</a> &amp;contour_landmarks, const <a class="el" href="structeos_1_1fitting_1_1_model_contour.html">ModelContour</a> &amp;model_contour)</td></tr>
<tr class="separator:a6a307eaa4a1a9f2c5e2c33a95a6e261d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ade368ea637ac45c9e344dde326ffe174"><td class="memItemLeft" align="right" valign="top">std::tuple&lt; std::vector&lt; cv::Vec2f &gt;, std::vector&lt; cv::Vec4f &gt;, std::vector&lt; int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#ade368ea637ac45c9e344dde326ffe174">get_nearest_contour_correspondences</a> (const <a class="el" href="namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b">eos::core::LandmarkCollection</a>&lt; cv::Vec2f &gt; &amp;landmarks, const std::vector&lt; std::string &gt; &amp;landmark_contour_identifiers, const std::vector&lt; int &gt; &amp;model_contour_indices, const <a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">morphablemodel::MorphableModel</a> &amp;morphable_model, const glm::mat4x4 &amp;view_model, const glm::mat4x4 &amp;ortho_projection, const glm::vec4 &amp;viewport)</td></tr>
<tr class="separator:ade368ea637ac45c9e344dde326ffe174"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af8ce6f464c22e42b5f98e96ef7f06ab0"><td class="memItemLeft" align="right" valign="top">std::tuple&lt; std::vector&lt; cv::Vec2f &gt;, std::vector&lt; cv::Vec4f &gt;, std::vector&lt; int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#af8ce6f464c22e42b5f98e96ef7f06ab0">get_contour_correspondences</a> (const <a class="el" href="namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b">eos::core::LandmarkCollection</a>&lt; cv::Vec2f &gt; &amp;landmarks, const <a class="el" href="structeos_1_1fitting_1_1_contour_landmarks.html">ContourLandmarks</a> &amp;contour_landmarks, const <a class="el" href="structeos_1_1fitting_1_1_model_contour.html">ModelContour</a> &amp;model_contour, float yaw_angle, const <a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">morphablemodel::MorphableModel</a> &amp;morphable_model, const glm::mat4x4 &amp;view_model, const glm::mat4x4 &amp;ortho_projection, const glm::vec4 &amp;viewport)</td></tr>
<tr class="separator:af8ce6f464c22e42b5f98e96ef7f06ab0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5ddb4f44f4576ad148a9edd85d78c1f7"><td class="memItemLeft" align="right" valign="top">cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#a5ddb4f44f4576ad148a9edd85d78c1f7">fit_shape</a> (cv::Mat affine_camera_matrix, <a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a> morphable_model, std::vector&lt; <a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html">eos::morphablemodel::Blendshape</a> &gt; blendshapes, std::vector&lt; cv::Vec2f &gt; image_points, std::vector&lt; int &gt; vertex_indices, float lambda, boost::optional&lt; int &gt; num_coefficients_to_fit, std::vector&lt; float &gt; &amp;pca_shape_coefficients, std::vector&lt; float &gt; &amp;blendshape_coefficients)</td></tr>
<tr class="separator:a5ddb4f44f4576ad148a9edd85d78c1f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae3bcf9f955efce788838cc055b5282b6"><td class="memItemLeft" align="right" valign="top">cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#ae3bcf9f955efce788838cc055b5282b6">fit_shape</a> (cv::Mat affine_camera_matrix, <a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a> morphable_model, std::vector&lt; <a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html">eos::morphablemodel::Blendshape</a> &gt; blendshapes, std::vector&lt; cv::Vec2f &gt; image_points, std::vector&lt; int &gt; vertex_indices, float lambda=3.0f, boost::optional&lt; int &gt; num_coefficients_to_fit=boost::optional&lt; int &gt;())</td></tr>
<tr class="separator:ae3bcf9f955efce788838cc055b5282b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae558a318d1d0c1da35d64b7abb209fac"><td class="memItemLeft" align="right" valign="top">std::vector&lt; float &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#ae558a318d1d0c1da35d64b7abb209fac">fit_shape_to_landmarks_linear</a> (<a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">morphablemodel::MorphableModel</a> morphable_model, cv::Mat affine_camera_matrix, std::vector&lt; cv::Vec2f &gt; landmarks, std::vector&lt; int &gt; vertex_ids, cv::Mat base_face=cv::Mat(), float lambda=3.0f, boost::optional&lt; int &gt; num_coefficients_to_fit=boost::optional&lt; int &gt;(), boost::optional&lt; float &gt; detector_standard_deviation=boost::optional&lt; float &gt;(), boost::optional&lt; float &gt; model_standard_deviation=boost::optional&lt; float &gt;())</td></tr>
<tr class="separator:ae558a318d1d0c1da35d64b7abb209fac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a03b4bc35b0619e7f4bd0fccbb2d35e2c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#a03b4bc35b0619e7f4bd0fccbb2d35e2c">save_rendering_parameters</a> (<a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">RenderingParameters</a> rendering_parameters, std::string filename)</td></tr>
<tr class="separator:a03b4bc35b0619e7f4bd0fccbb2d35e2c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a93f7464a6c6dee7b3885638014ec009a"><td class="memItemLeft" align="right" valign="top">cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#a93f7464a6c6dee7b3885638014ec009a">to_mat</a> (const glm::mat4x4 &amp;glm_matrix)</td></tr> <tr class="memitem:a93f7464a6c6dee7b3885638014ec009a"><td class="memItemLeft" align="right" valign="top">cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#a93f7464a6c6dee7b3885638014ec009a">to_mat</a> (const glm::mat4x4 &amp;glm_matrix)</td></tr>
<tr class="memdesc:a93f7464a6c6dee7b3885638014ec009a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts a glm::mat4x4 to a cv::Mat. <a href="#a93f7464a6c6dee7b3885638014ec009a">More...</a><br /></td></tr> <tr class="memdesc:a93f7464a6c6dee7b3885638014ec009a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts a glm::mat4x4 to a cv::Mat. <a href="#a93f7464a6c6dee7b3885638014ec009a">More...</a><br /></td></tr>
<tr class="separator:a93f7464a6c6dee7b3885638014ec009a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a93f7464a6c6dee7b3885638014ec009a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a503a126cfe1bbd6a7c8b7a786a8e73b8"><td class="memItemLeft" align="right" valign="top">glm::mat4x4&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#a503a126cfe1bbd6a7c8b7a786a8e73b8">get_4x4_modelview_matrix</a> (<a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">fitting::OrthographicRenderingParameters</a> params)</td></tr> <tr class="memitem:a198aa8a0c4d90a51bb1b422cfc6a87c4"><td class="memItemLeft" align="right" valign="top">glm::mat4x4&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#a198aa8a0c4d90a51bb1b422cfc6a87c4">get_4x4_modelview_matrix</a> (<a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">fitting::RenderingParameters</a> params)</td></tr>
<tr class="memdesc:a503a126cfe1bbd6a7c8b7a786a8e73b8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a 4x4 model-view matrix from given fitting parameters. <a href="#a503a126cfe1bbd6a7c8b7a786a8e73b8">More...</a><br /></td></tr> <tr class="memdesc:a198aa8a0c4d90a51bb1b422cfc6a87c4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a 4x4 model-view matrix from given fitting parameters. <a href="#a198aa8a0c4d90a51bb1b422cfc6a87c4">More...</a><br /></td></tr>
<tr class="separator:a503a126cfe1bbd6a7c8b7a786a8e73b8"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a198aa8a0c4d90a51bb1b422cfc6a87c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af600978a071bc5dc0443cfe41ae613bf"><td class="memItemLeft" align="right" valign="top">cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#af600978a071bc5dc0443cfe41ae613bf">get_3x4_affine_camera_matrix</a> (<a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">fitting::OrthographicRenderingParameters</a> params, int width, int height)</td></tr> <tr class="memitem:abebc061912b7ef0b180536b467e8dc6f"><td class="memItemLeft" align="right" valign="top">cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#abebc061912b7ef0b180536b467e8dc6f">get_3x4_affine_camera_matrix</a> (<a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">fitting::RenderingParameters</a> params, int width, int height)</td></tr>
<tr class="memdesc:af600978a071bc5dc0443cfe41ae613bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a 3x4 affine camera matrix from given fitting parameters. The matrix transforms points directly from model-space to screen-space. <a href="#af600978a071bc5dc0443cfe41ae613bf">More...</a><br /></td></tr> <tr class="memdesc:abebc061912b7ef0b180536b467e8dc6f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a 3x4 affine camera matrix from given fitting parameters. The matrix transforms points directly from model-space to screen-space. <a href="#abebc061912b7ef0b180536b467e8dc6f">More...</a><br /></td></tr>
<tr class="separator:af600978a071bc5dc0443cfe41ae613bf"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:abebc061912b7ef0b180536b467e8dc6f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4e713b5555396806a9b26817184eacd0"><td class="memItemLeft" align="right" valign="top">glm::vec4&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#a4e713b5555396806a9b26817184eacd0">get_opencv_viewport</a> (int width, int height)</td></tr> <tr class="memitem:a4e713b5555396806a9b26817184eacd0"><td class="memItemLeft" align="right" valign="top">glm::vec4&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#a4e713b5555396806a9b26817184eacd0">get_opencv_viewport</a> (int width, int height)</td></tr>
<tr class="memdesc:a4e713b5555396806a9b26817184eacd0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a glm/OpenGL compatible viewport vector that flips y and has the origin on the top-left, like in OpenCV. <a href="#a4e713b5555396806a9b26817184eacd0">More...</a><br /></td></tr> <tr class="memdesc:a4e713b5555396806a9b26817184eacd0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a glm/OpenGL compatible viewport vector that flips y and has the origin on the top-left, like in OpenCV. <a href="#a4e713b5555396806a9b26817184eacd0">More...</a><br /></td></tr>
<tr class="separator:a4e713b5555396806a9b26817184eacd0"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a4e713b5555396806a9b26817184eacd0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aebab65b3f9f46758b1363a347e6de852"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">OrthographicRenderingParameters</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#aebab65b3f9f46758b1363a347e6de852">estimate_orthographic_camera</a> (std::vector&lt; cv::Vec2f &gt; image_points, std::vector&lt; cv::Vec4f &gt; model_points, int width, int height)</td></tr> <tr class="memitem:a9f55324bfa740c6b5061518535506084"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">RenderingParameters</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1fitting.html#a9f55324bfa740c6b5061518535506084">estimate_orthographic_camera</a> (std::vector&lt; cv::Vec2f &gt; image_points, std::vector&lt; cv::Vec4f &gt; model_points, int width, int height)</td></tr>
<tr class="memdesc:aebab65b3f9f46758b1363a347e6de852"><td class="mdescLeft">&#160;</td><td class="mdescRight">This algorithm estimates the rotation angles and translation of the model, as well as the viewing frustum of the camera, given a set of corresponding 2D-3D points. <a href="#aebab65b3f9f46758b1363a347e6de852">More...</a><br /></td></tr> <tr class="memdesc:a9f55324bfa740c6b5061518535506084"><td class="mdescLeft">&#160;</td><td class="mdescRight">This algorithm estimates the rotation angles and translation of the model, as well as the viewing frustum of the camera, given a set of corresponding 2D-3D points. <a href="#a9f55324bfa740c6b5061518535506084">More...</a><br /></td></tr>
<tr class="separator:aebab65b3f9f46758b1363a347e6de852"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a9f55324bfa740c6b5061518535506084"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table> </table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Pose and shape fitting of a 3D Morphable Model. </p> <div class="textblock"><p>Pose and shape fitting of a 3D Morphable Model. </p>
</div><h2 class="groupheader">Function Documentation</h2> </div><h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="a63fce336daef96cde45f61701c4a3cf4"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="namespaceeos_1_1fitting.html#a63fce336daef96cde45f61701c4a3cf4">eos::fitting::CameraType</a></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">strong</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Type of a camera (projection). </p>
<p>Currently either orthographic or perspective. Used in <a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html" title="Represents a set of estimated model parameters (rotation, translation) and camera parameters (viewing...">RenderingParameters</a>. </p>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="afce5f7297094056a04ad26785c94bbd8"></a> <a class="anchor" id="afce5f7297094056a04ad26785c94bbd8"></a>
<div class="memitem"> <div class="memitem">
<div class="memproto"> <div class="memproto">
...@@ -176,12 +229,12 @@ Functions</h2></td></tr> ...@@ -176,12 +229,12 @@ Functions</h2></td></tr>
</div> </div>
</div> </div>
<a class="anchor" id="aebab65b3f9f46758b1363a347e6de852"></a> <a class="anchor" id="a9f55324bfa740c6b5061518535506084"></a>
<div class="memitem"> <div class="memitem">
<div class="memproto"> <div class="memproto">
<table class="memname"> <table class="memname">
<tr> <tr>
<td class="memname"><a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">OrthographicRenderingParameters</a> eos::fitting::estimate_orthographic_camera </td> <td class="memname"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">RenderingParameters</a> eos::fitting::estimate_orthographic_camera </td>
<td>(</td> <td>(</td>
<td class="paramtype">std::vector&lt; cv::Vec2f &gt;&#160;</td> <td class="paramtype">std::vector&lt; cv::Vec2f &gt;&#160;</td>
<td class="paramname"><em>image_points</em>, </td> <td class="paramname"><em>image_points</em>, </td>
...@@ -233,7 +286,234 @@ Functions</h2></td></tr> ...@@ -233,7 +286,234 @@ Functions</h2></td></tr>
</div> </div>
</div> </div>
<a class="anchor" id="ae68794185075b5b67fddae9d359cf208"></a> <a class="anchor" id="ac429313cbc0ed61744f1b0fa4dba672b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::vector&lt;float&gt; eos::fitting::fit_blendshapes_to_landmarks_linear </td>
<td>(</td>
<td class="paramtype">std::vector&lt; <a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html">eos::morphablemodel::Blendshape</a> &gt;&#160;</td>
<td class="paramname"><em>blendshapes</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">cv::Mat&#160;</td>
<td class="paramname"><em>face_instance</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">cv::Mat&#160;</td>
<td class="paramname"><em>affine_camera_matrix</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::vector&lt; cv::Vec2f &gt;&#160;</td>
<td class="paramname"><em>landmarks</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::vector&lt; int &gt;&#160;</td>
<td class="paramname"><em>vertex_ids</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>lambda</em> = <code>500.0f</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Fits blendshape coefficients to given 2D landmarks, given a current face shape instance. It's a linear, closed-form solution fitting algorithm, with regularisation (constraining the L2-norm of the coefficients).</p>
<p>This algorithm is very similar to the shape fitting in fit_shape_to_landmarks_linear. Instead of the PCA basis, the blendshapes are used, and instead of the mean, a current face instance is used to do the fitting from.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">blendshapes</td><td>A vector with blendshapes to estimate the coefficients for. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">face_instance</td><td>A shape instance from which the blendshape coefficients should be estimated (i.e. the current mesh without expressions, e.g. estimated from a previous PCA-model fitting). A 3m x 1 matrix. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">affine_camera_matrix</td><td>A 3x4 affine camera matrix from model to screen-space (should probably be of type CV_32FC1 as all our calculations are done with float). </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">landmarks</td><td>2D landmarks from an image to fit the blendshapes to. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">vertex_ids</td><td>The vertex ids in the model that correspond to the 2D points. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">lambda</td><td>A regularisation parameter, constraining the L2-norm of the coefficients. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The estimated blendshape-coefficients. </dd></dl>
</div>
</div>
<a class="anchor" id="a5ddb4f44f4576ad148a9edd85d78c1f7"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">cv::Mat eos::fitting::fit_shape </td>
<td>(</td>
<td class="paramtype">cv::Mat&#160;</td>
<td class="paramname"><em>affine_camera_matrix</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a>&#160;</td>
<td class="paramname"><em>morphable_model</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::vector&lt; <a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html">eos::morphablemodel::Blendshape</a> &gt;&#160;</td>
<td class="paramname"><em>blendshapes</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::vector&lt; cv::Vec2f &gt;&#160;</td>
<td class="paramname"><em>image_points</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::vector&lt; int &gt;&#160;</td>
<td class="paramname"><em>vertex_indices</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>lambda</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">boost::optional&lt; int &gt;&#160;</td>
<td class="paramname"><em>num_coefficients_to_fit</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::vector&lt; float &gt; &amp;&#160;</td>
<td class="paramname"><em>pca_shape_coefficients</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::vector&lt; float &gt; &amp;&#160;</td>
<td class="paramname"><em>blendshape_coefficients</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Convenience function that fits the shape model and expression blendshapes to landmarks. Makes the fitted PCA shape and blendshape coefficients accessible via the out parameters <code>pca_shape_coefficients</code> and <code>blendshape_coefficients</code>. It iterates PCA-shape and blendshape fitting until convergence (usually it converges within 5 to 10 iterations).</p>
<p>See fit_shape_model(cv::Mat, eos::morphablemodel::MorphableModel, std::vector&lt;eos::morphablemodel::Blendshape&gt;, std::vector&lt;cv::Vec2f&gt;, std::vector&lt;int&gt;, float lambda) for a simpler overload that just returns the shape instance.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">affine_camera_matrix</td><td>The estimated pose as a 3x4 affine camera matrix that is used to fit the shape. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">morphable_model</td><td>The 3D Morphable Model used for the shape fitting. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">blendshapes</td><td>A vector of blendshapes that are being fit to the landmarks in addition to the PCA model. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">image_points</td><td>2D landmarks from an image to fit the model to. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">vertex_indices</td><td>The vertex indices in the model that correspond to the 2D points. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">lambda</td><td>Regularisation parameter of the PCA shape fitting. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">num_coefficients_to_fit</td><td>How many shape-coefficients to fit (all others will stay 0). Should be bigger than zero, or boost::none to fit all coefficients. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">pca_shape_coefficients</td><td>Output parameter that will contain the resulting pca shape coefficients. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">blendshape_coefficients</td><td>Output parameter that will contain the resulting blendshape coefficients. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The fitted model shape instance. </dd></dl>
</div>
</div>
<a class="anchor" id="ae3bcf9f955efce788838cc055b5282b6"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">cv::Mat eos::fitting::fit_shape </td>
<td>(</td>
<td class="paramtype">cv::Mat&#160;</td>
<td class="paramname"><em>affine_camera_matrix</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">eos::morphablemodel::MorphableModel</a>&#160;</td>
<td class="paramname"><em>morphable_model</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::vector&lt; <a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html">eos::morphablemodel::Blendshape</a> &gt;&#160;</td>
<td class="paramname"><em>blendshapes</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::vector&lt; cv::Vec2f &gt;&#160;</td>
<td class="paramname"><em>image_points</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::vector&lt; int &gt;&#160;</td>
<td class="paramname"><em>vertex_indices</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>lambda</em> = <code>3.0f</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">boost::optional&lt; int &gt;&#160;</td>
<td class="paramname"><em>num_coefficients_to_fit</em> = <code>boost::optional&lt;int&gt;()</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Convenience function that fits the shape model and expression blendshapes to landmarks. It iterates PCA-shape and blendshape fitting until convergence (usually it converges within 5 to 10 iterations).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">affine_camera_matrix</td><td>The estimated pose as a 3x4 affine camera matrix that is used to fit the shape. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">morphable_model</td><td>The 3D Morphable Model used for the shape fitting. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">blendshapes</td><td>A vector of blendshapes that are being fit to the landmarks in addition to the PCA model. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">image_points</td><td>2D landmarks from an image to fit the model to. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">vertex_indices</td><td>The vertex indices in the model that correspond to the 2D points. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">lambda</td><td>Regularisation parameter of the PCA shape fitting. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">num_coefficients_to_fit</td><td>How many shape-coefficients to fit (all others will stay 0). Should be bigger than zero, or boost::none to fit all coefficients. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The fitted model shape instance. </dd></dl>
</div>
</div>
<a class="anchor" id="ae558a318d1d0c1da35d64b7abb209fac"></a>
<div class="memitem"> <div class="memitem">
<div class="memproto"> <div class="memproto">
<table class="mlabels"> <table class="mlabels">
...@@ -264,6 +544,12 @@ Functions</h2></td></tr> ...@@ -264,6 +544,12 @@ Functions</h2></td></tr>
<td class="paramtype">std::vector&lt; int &gt;&#160;</td> <td class="paramtype">std::vector&lt; int &gt;&#160;</td>
<td class="paramname"><em>vertex_ids</em>, </td> <td class="paramname"><em>vertex_ids</em>, </td>
</tr> </tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">cv::Mat&#160;</td>
<td class="paramname"><em>base_face</em> = <code>cv::Mat()</code>, </td>
</tr>
<tr> <tr>
<td class="paramkey"></td> <td class="paramkey"></td>
<td></td> <td></td>
...@@ -307,10 +593,11 @@ Functions</h2></td></tr> ...@@ -307,10 +593,11 @@ Functions</h2></td></tr>
<table class="params"> <table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">morphable_model</td><td>The Morphable Model whose shape (coefficients) are estimated. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">morphable_model</td><td>The Morphable Model whose shape (coefficients) are estimated. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">affine_camera_matrix</td><td>A 3x4 affine camera matrix from model to screen-space (should probably be of type CV_32FC1 as all our calculations are done with float). </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">affine_camera_matrix</td><td>A 3x4 affine camera matrix from model to screen-space (should probably be of type CV_32FC1 as all our calculations are done with float). </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">landmarks</td><td>2D landmarks from an image, given in clip-coordinates. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">landmarks</td><td>2D landmarks from an image to fit the model to. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">vertex_ids</td><td>The vertex ids in the model that correspond to the 2D points. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">vertex_ids</td><td>The vertex ids in the model that correspond to the 2D points. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">base_face</td><td>The base or reference face from where the fitting is started. Usually this would be the models mean face, which is what will be used if the parameter is not explicitly specified. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">lambda</td><td>The regularisation parameter (weight of the prior towards the mean). </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">lambda</td><td>The regularisation parameter (weight of the prior towards the mean). </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">num_coefficients_to_fit</td><td>How many shape-coefficients to fit (all others will stay 0). Not tested thoroughly. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">num_coefficients_to_fit</td><td>How many shape-coefficients to fit (all others will stay 0). Should be bigger than zero, or boost::none to fit all coefficients. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">detector_standard_deviation</td><td>The standard deviation of the 2D landmarks given (e.g. of the detector used), in pixels. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">detector_standard_deviation</td><td>The standard deviation of the 2D landmarks given (e.g. of the detector used), in pixels. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">model_standard_deviation</td><td>The standard deviation of the 3D vertex points in the 3D model, projected to 2D (so the value is in pixels). </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">model_standard_deviation</td><td>The standard deviation of the 3D vertex points in the 3D model, projected to 2D (so the value is in pixels). </td></tr>
</table> </table>
...@@ -320,14 +607,14 @@ Functions</h2></td></tr> ...@@ -320,14 +607,14 @@ Functions</h2></td></tr>
</div> </div>
</div> </div>
<a class="anchor" id="af600978a071bc5dc0443cfe41ae613bf"></a> <a class="anchor" id="abebc061912b7ef0b180536b467e8dc6f"></a>
<div class="memitem"> <div class="memitem">
<div class="memproto"> <div class="memproto">
<table class="memname"> <table class="memname">
<tr> <tr>
<td class="memname">cv::Mat eos::fitting::get_3x4_affine_camera_matrix </td> <td class="memname">cv::Mat eos::fitting::get_3x4_affine_camera_matrix </td>
<td>(</td> <td>(</td>
<td class="paramtype"><a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">fitting::OrthographicRenderingParameters</a>&#160;</td> <td class="paramtype"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">fitting::RenderingParameters</a>&#160;</td>
<td class="paramname"><em>params</em>, </td> <td class="paramname"><em>params</em>, </td>
</tr> </tr>
<tr> <tr>
...@@ -351,18 +638,18 @@ Functions</h2></td></tr> ...@@ -351,18 +638,18 @@ Functions</h2></td></tr>
</div><div class="memdoc"> </div><div class="memdoc">
<p>Creates a 3x4 affine camera matrix from given fitting parameters. The matrix transforms points directly from model-space to screen-space. </p> <p>Creates a 3x4 affine camera matrix from given fitting parameters. The matrix transforms points directly from model-space to screen-space. </p>
<p>This function is mainly used since the linear shape fitting <a class="el" href="namespaceeos_1_1fitting.html#ae68794185075b5b67fddae9d359cf208">fitting::fit_shape_to_landmarks_linear</a> expects one of these 3x4 affine camera matrices, as well as <a class="el" href="namespaceeos_1_1render.html#aafa8c960c3b6eb080da1536cc3634577">render::extract_texture</a>. </p> <p>This function is mainly used since the linear shape fitting <a class="el" href="namespaceeos_1_1fitting.html#ae558a318d1d0c1da35d64b7abb209fac">fitting::fit_shape_to_landmarks_linear</a> expects one of these 3x4 affine camera matrices, as well as <a class="el" href="namespaceeos_1_1render.html#aafa8c960c3b6eb080da1536cc3634577">render::extract_texture</a>. </p>
</div> </div>
</div> </div>
<a class="anchor" id="a503a126cfe1bbd6a7c8b7a786a8e73b8"></a> <a class="anchor" id="a198aa8a0c4d90a51bb1b422cfc6a87c4"></a>
<div class="memitem"> <div class="memitem">
<div class="memproto"> <div class="memproto">
<table class="memname"> <table class="memname">
<tr> <tr>
<td class="memname">glm::mat4x4 eos::fitting::get_4x4_modelview_matrix </td> <td class="memname">glm::mat4x4 eos::fitting::get_4x4_modelview_matrix </td>
<td>(</td> <td>(</td>
<td class="paramtype"><a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">fitting::OrthographicRenderingParameters</a>&#160;</td> <td class="paramtype"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">fitting::RenderingParameters</a>&#160;</td>
<td class="paramname"><em>params</em></td><td>)</td> <td class="paramname"><em>params</em></td><td>)</td>
<td></td> <td></td>
</tr> </tr>
...@@ -371,15 +658,157 @@ Functions</h2></td></tr> ...@@ -371,15 +658,157 @@ Functions</h2></td></tr>
<p>Creates a 4x4 model-view matrix from given fitting parameters. </p> <p>Creates a 4x4 model-view matrix from given fitting parameters. </p>
<p>Together with the <a class="el" href="structeos_1_1fitting_1_1_frustum.html" title="A class representing a camera viewing frustum. At the moment used as orthographic camera only...">Frustum</a> information, this describes the full orthographic rendering parameters of the OpenGL pipeline. Example:</p> <p>Together with the <a class="el" href="structeos_1_1fitting_1_1_frustum.html" title="A class representing a camera viewing frustum. At the moment used as orthographic camera only...">Frustum</a> information, this describes the full orthographic rendering parameters of the OpenGL pipeline. Example:</p>
<div class="fragment"><div class="line">fitting::OrthographicRenderingParameters rendering_params = ...;</div> <div class="fragment"><div class="line">fitting::OrthographicRenderingParameters rendering_params = ...;</div><div class="line">glm::mat4x4 view_model = <a class="code" href="namespaceeos_1_1fitting.html#a198aa8a0c4d90a51bb1b422cfc6a87c4">get_4x4_modelview_matrix</a>(rendering_params);</div><div class="line">glm::mat4x4 ortho_projection = glm::ortho(rendering_params.frustum.l, rendering_params.frustum.r, rendering_params.frustum.b, rendering_params.frustum.t);</div><div class="line">glm::vec4 viewport(0, image.rows, image.cols, -image.rows); <span class="comment">// flips y, origin top-left, like in OpenCV</span></div><div class="line"></div><div class="line"><span class="comment">// project a point from 3D to 2D:</span></div><div class="line">glm::vec3 point_3d = ...; <span class="comment">// from a mesh for example</span></div><div class="line">glm::vec3 point_2d = glm::project(point_3d, view_model, ortho_projection, viewport);</div></div><!-- fragment -->
<div class="line">glm::mat4x4 view_model = <a class="code" href="namespaceeos_1_1fitting.html#a503a126cfe1bbd6a7c8b7a786a8e73b8">get_4x4_modelview_matrix</a>(rendering_params);</div> </div>
<div class="line">glm::mat4x4 ortho_projection = glm::ortho(rendering_params.frustum.l, rendering_params.frustum.r, rendering_params.frustum.b, rendering_params.frustum.t);</div> </div>
<div class="line">glm::vec4 viewport(0, image.rows, image.cols, -image.rows); <span class="comment">// flips y, origin top-left, like in OpenCV</span></div> <a class="anchor" id="af8ce6f464c22e42b5f98e96ef7f06ab0"></a>
<div class="line"></div> <div class="memitem">
<div class="line"><span class="comment">// project a point from 3D to 2D:</span></div> <div class="memproto">
<div class="line">glm::vec3 point_3d = ...; <span class="comment">// from a mesh for example</span></div> <table class="memname">
<div class="line">glm::vec3 point_2d = glm::project(point_3d, view_model, ortho_projection, viewport);</div> <tr>
</div><!-- fragment --> <td class="memname">std::tuple&lt;std::vector&lt;cv::Vec2f&gt;, std::vector&lt;cv::Vec4f&gt;, std::vector&lt;int&gt; &gt; eos::fitting::get_contour_correspondences </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b">eos::core::LandmarkCollection</a>&lt; cv::Vec2f &gt; &amp;&#160;</td>
<td class="paramname"><em>landmarks</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="structeos_1_1fitting_1_1_contour_landmarks.html">ContourLandmarks</a> &amp;&#160;</td>
<td class="paramname"><em>contour_landmarks</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="structeos_1_1fitting_1_1_model_contour.html">ModelContour</a> &amp;&#160;</td>
<td class="paramname"><em>model_contour</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>yaw_angle</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">morphablemodel::MorphableModel</a> &amp;&#160;</td>
<td class="paramname"><em>morphable_model</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const glm::mat4x4 &amp;&#160;</td>
<td class="paramname"><em>view_model</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const glm::mat4x4 &amp;&#160;</td>
<td class="paramname"><em>ortho_projection</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const glm::vec4 &amp;&#160;</td>
<td class="paramname"><em>viewport</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Given a set of 2D image landmarks, finds the closest (in a L2 sense) 3D vertex from a list of vertices pre-defined in <code>model_contour</code>. <code>landmarks</code> can contain all landmarks, and the function will sub-select the relevant contour landmarks with the help of the given <code>contour_landmarks</code>. This function choses the front-facing contour and only fits this contour to the 3D model, since these correspondences are approximately static and do not move with changing pose-angle.</p>
<p>It's the main contour fitting function that calls all other functions.</p>
<p>Note: Maybe rename to find_contour_correspondences, to highlight that there is (potentially a lot) computational cost involved? Note: Does ortho_projection have to be specifically orthographic? Otherwise, if it works with perspective too, rename to just "projection".</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">landmarks</td><td>All image landmarks. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">contour_landmarks</td><td>2D image contour ids of left or right side (for example for ibug landmarks). </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">model_contour</td><td>The model contour indices that should be considered to find the closest corresponding 3D vertex. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">yaw_angle</td><td>Yaw angle of the current fitting. The front-facing contour will be chosen depending on this yaw angle. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">morphable_model</td><td>A Morphable Model whose mean is used. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">view_model</td><td>Model-view matrix of the current fitting to project the 3D model vertices to 2D. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">ortho_projection</td><td>Projection matrix to project the 3D model vertices to 2D. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">viewport</td><td>Current viewport to use. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A tuple with the 2D contour landmark points, the corresponding points in the 3D shape model and their vertex indices. </dd></dl>
</div>
</div>
<a class="anchor" id="ade368ea637ac45c9e344dde326ffe174"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::tuple&lt; std::vector&lt; cv::Vec2f &gt;, std::vector&lt; cv::Vec4f &gt;, std::vector&lt; int &gt; &gt; eos::fitting::get_nearest_contour_correspondences </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b">eos::core::LandmarkCollection</a>&lt; cv::Vec2f &gt; &amp;&#160;</td>
<td class="paramname"><em>landmarks</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; std::string &gt; &amp;&#160;</td>
<td class="paramname"><em>landmark_contour_identifiers</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; int &gt; &amp;&#160;</td>
<td class="paramname"><em>model_contour_indices</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">morphablemodel::MorphableModel</a> &amp;&#160;</td>
<td class="paramname"><em>morphable_model</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const glm::mat4x4 &amp;&#160;</td>
<td class="paramname"><em>view_model</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const glm::mat4x4 &amp;&#160;</td>
<td class="paramname"><em>ortho_projection</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const glm::vec4 &amp;&#160;</td>
<td class="paramname"><em>viewport</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Given a set of 2D image landmarks, finds the closest (in a L2 sense) 3D vertex from a list of vertices pre-defined in <code>model_contour</code>. Assumes to be given contour correspondences of the front-facing contour.</p>
<p>Note: Maybe rename to find_nearest_contour_points, to highlight that there is (potentially a lot) computational cost involved? Note: Does ortho_projection have to be specifically orthographic? Otherwise, if it works with perspective too, rename to just "projection". More notes: Actually, only return the vertex id, not the point? Same with get_corresponding_pointset? Because then it's much easier to use the current shape estimate instead of the mean! But this function needs to project. So... it should take a Mesh actually? But creating a Mesh is a lot of computation? When we want to use the non-mean, then we need to use draw_sample() anyway? So overhead of Mesh is only if we use the mean? Maybe two overloads? Note: Uses the mean to calculate.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">landmarks</td><td>All image landmarks. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">landmark_contour_identifiers</td><td>2D image contour ids of left or right side (for example for ibug landmarks). </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">model_contour_indices</td><td>The model contour indices that should be considered to find the closest corresponding 3D vertex. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">morphable_model</td><td>The Morphable Model whose shape (coefficients) are estimated. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">view_model</td><td>Model-view matrix of the current fitting to project the 3D model vertices to 2D. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">ortho_projection</td><td>Projection matrix to project the 3D model vertices to 2D. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">viewport</td><td>Current viewport to use. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A tuple with the 2D contour landmark points, the corresponding points in the 3D shape model and their vertex indices. </dd></dl>
</div> </div>
</div> </div>
<a class="anchor" id="a4e713b5555396806a9b26817184eacd0"></a> <a class="anchor" id="a4e713b5555396806a9b26817184eacd0"></a>
...@@ -455,7 +884,7 @@ Functions</h2></td></tr> ...@@ -455,7 +884,7 @@ Functions</h2></td></tr>
</table> </table>
</div><div class="memdoc"> </div><div class="memdoc">
<p>Projects a point from world coordinates to screen coordinates. First, an estimated affine camera matrix is used to transform the point to clip space. Second, the point is transformed to screen coordinates using the window transform. The window transform also flips the y-axis (the image origin is top-left, while in clip space top is +1 and bottom is -1).</p> <p>Projects a point from world coordinates to screen coordinates. First, an estimated affine camera matrix is used to transform the point to clip space. Second, the point is transformed to screen coordinates using the window transform. The window transform also flips the y-axis (the image origin is top-left, while in clip space top is +1 and bottom is -1).</p>
<p>Note: Assumes the affine camera matrix only projects from world to clip space, because a subsequent window transform is applied. #Todo: This is outdated, now that we estimate the matrix from world to screen space directly.</p> <p>Note: Assumes the affine camera matrix only projects from world to clip space, because a subsequent window transform is applied. Todo: This is outdated, now that we estimate the matrix from world to screen space directly.</p>
<dl class="params"><dt>Parameters</dt><dd> <dl class="params"><dt>Parameters</dt><dd>
<table class="params"> <table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">vertex</td><td>A vertex in 3D space. vertex[3] = 1.0f. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">vertex</td><td>A vertex in 3D space. vertex[3] = 1.0f. </td></tr>
...@@ -467,6 +896,89 @@ Functions</h2></td></tr> ...@@ -467,6 +896,89 @@ Functions</h2></td></tr>
</dl> </dl>
<dl class="section return"><dt>Returns</dt><dd>A vector with x and y coordinates transformed to screen coordinates. </dd></dl> <dl class="section return"><dt>Returns</dt><dd>A vector with x and y coordinates transformed to screen coordinates. </dd></dl>
</div>
</div>
<a class="anchor" id="a03b4bc35b0619e7f4bd0fccbb2d35e2c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void eos::fitting::save_rendering_parameters </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">RenderingParameters</a>&#160;</td>
<td class="paramname"><em>rendering_parameters</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::string&#160;</td>
<td class="paramname"><em>filename</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Saves the rendering parameters for an image to a json file.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">rendering_parameters</td><td>An instance of class <a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html" title="Represents a set of estimated model parameters (rotation, translation) and camera parameters (viewing...">RenderingParameters</a>. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">filename</td><td>The file to write. </td></tr>
</table>
</dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">std::runtime_error</td><td>if unable to open the given file for writing. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a6a307eaa4a1a9f2c5e2c33a95a6e261d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::pair&lt; std::vector&lt; std::string &gt;, std::vector&lt; int &gt; &gt; eos::fitting::select_contour </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>yaw_angle</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="structeos_1_1fitting_1_1_contour_landmarks.html">ContourLandmarks</a> &amp;&#160;</td>
<td class="paramname"><em>contour_landmarks</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="structeos_1_1fitting_1_1_model_contour.html">ModelContour</a> &amp;&#160;</td>
<td class="paramname"><em>model_contour</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Takes a set of 2D and 3D contour landmarks and a yaw angle and returns two vectors with either the right or the left 2D and 3D contour indices. This function does not establish correspondence between the 2D and 3D landmarks, it just selects the front-facing contour. The two returned vectors can thus have different size. Correspondence can be established using <a class="el" href="namespaceeos_1_1fitting.html#ade368ea637ac45c9e344dde326ffe174">get_nearest_contour_correspondences()</a>.</p>
<p>Note: Maybe rename to find_nearest_contour_points, to highlight that there is (potentially a lot) computational cost involved?</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">yaw_angle</td><td>yaw angle in degrees. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">contour_landmarks</td><td>2D image contour ids of left or right side (for example for ibug landmarks). </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">model_contour</td><td>The model contour indices that should be used/considered to find the closest corresponding 3D vertex. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pair with two vectors containing the selected 2D image contour landmark ids and the 3D model contour indices. </dd></dl>
</div> </div>
</div> </div>
<a class="anchor" id="a93f7464a6c6dee7b3885638014ec009a"></a> <a class="anchor" id="a93f7464a6c6dee7b3885638014ec009a"></a>
...@@ -493,7 +1005,7 @@ Functions</h2></td></tr> ...@@ -493,7 +1005,7 @@ Functions</h2></td></tr>
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: eos::morphablemodel Namespace Reference</title> <title>eos: eos::morphablemodel Namespace Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -105,6 +105,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -105,6 +105,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<table class="memberdecls"> <table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr> Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html">Blendshape</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A class representing a 3D blendshape. <a href="structeos_1_1morphablemodel_1_1_blendshape.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">MorphableModel</a></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">MorphableModel</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A class representing a 3D Morphable Model, consisting of a shape- and colour (albedo) PCA model. <a href="classeos_1_1morphablemodel_1_1_morphable_model.html#details">More...</a><br /></td></tr> <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A class representing a 3D Morphable Model, consisting of a shape- and colour (albedo) PCA model. <a href="classeos_1_1morphablemodel_1_1_morphable_model.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
...@@ -114,6 +117,10 @@ Classes</h2></td></tr> ...@@ -114,6 +117,10 @@ Classes</h2></td></tr>
</table><table class="memberdecls"> </table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr> Functions</h2></td></tr>
<tr class="memitem:a408184d7cae7e40c5c8e76c2bc114811"><td class="memItemLeft" align="right" valign="top">std::vector&lt; <a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html">Blendshape</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1morphablemodel.html#a408184d7cae7e40c5c8e76c2bc114811">load_blendshapes</a> (std::string filename)</td></tr>
<tr class="separator:a408184d7cae7e40c5c8e76c2bc114811"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2578fc03dbaa1809873578f17991e278"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1morphablemodel.html#a2578fc03dbaa1809873578f17991e278">save_coefficients</a> (std::vector&lt; float &gt; coefficients, std::string filename)</td></tr>
<tr class="separator:a2578fc03dbaa1809873578f17991e278"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afa73fdf5b394458b7e21639ae50d074c"><td class="memItemLeft" align="right" valign="top">std::vector&lt; cv::Vec2f &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1morphablemodel.html#afa73fdf5b394458b7e21639ae50d074c">load_isomap</a> (boost::filesystem::path isomap_file)</td></tr> <tr class="memitem:afa73fdf5b394458b7e21639ae50d074c"><td class="memItemLeft" align="right" valign="top">std::vector&lt; cv::Vec2f &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1morphablemodel.html#afa73fdf5b394458b7e21639ae50d074c">load_isomap</a> (boost::filesystem::path isomap_file)</td></tr>
<tr class="separator:afa73fdf5b394458b7e21639ae50d074c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:afa73fdf5b394458b7e21639ae50d074c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0d607b8838d70cd8ec41cb4bfe116f58"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">MorphableModel</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1morphablemodel.html#a0d607b8838d70cd8ec41cb4bfe116f58">load_scm_model</a> (boost::filesystem::path model_filename, boost::filesystem::path isomap_file=boost::filesystem::path())</td></tr> <tr class="memitem:a0d607b8838d70cd8ec41cb4bfe116f58"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">MorphableModel</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1morphablemodel.html#a0d607b8838d70cd8ec41cb4bfe116f58">load_scm_model</a> (boost::filesystem::path model_filename, boost::filesystem::path isomap_file=boost::filesystem::path())</td></tr>
...@@ -122,14 +129,44 @@ Functions</h2></td></tr> ...@@ -122,14 +129,44 @@ Functions</h2></td></tr>
<tr class="separator:a0da6e35ec49f1ebdf55f9596540cf8f8"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a0da6e35ec49f1ebdf55f9596540cf8f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aad09e0fd0788cb7fea41ed799c653e71"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1morphablemodel.html#aad09e0fd0788cb7fea41ed799c653e71">save_model</a> (<a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">MorphableModel</a> model, std::string filename)</td></tr> <tr class="memitem:aad09e0fd0788cb7fea41ed799c653e71"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1morphablemodel.html#aad09e0fd0788cb7fea41ed799c653e71">save_model</a> (<a class="el" href="classeos_1_1morphablemodel_1_1_morphable_model.html">MorphableModel</a> model, std::string filename)</td></tr>
<tr class="separator:aad09e0fd0788cb7fea41ed799c653e71"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:aad09e0fd0788cb7fea41ed799c653e71"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a73d9baeb67f25d4604fc291a23e5e2d8"><td class="memItemLeft" align="right" valign="top">cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1morphablemodel.html#a73d9baeb67f25d4604fc291a23e5e2d8">normalise_pca_basis</a> (cv::Mat unnormalisedBasis, cv::Mat eigenvalues)</td></tr> <tr class="memitem:a31a2b98e73170ae558f6c50e76524817"><td class="memItemLeft" align="right" valign="top">cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1morphablemodel.html#a31a2b98e73170ae558f6c50e76524817">normalise_pca_basis</a> (cv::Mat unnormalised_basis, cv::Mat eigenvalues)</td></tr>
<tr class="separator:a73d9baeb67f25d4604fc291a23e5e2d8"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a31a2b98e73170ae558f6c50e76524817"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d9ed5fa969cbd540ebe9587540f3607"><td class="memItemLeft" align="right" valign="top">cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1morphablemodel.html#a3d9ed5fa969cbd540ebe9587540f3607">unnormalise_pca_basis</a> (cv::Mat normalisedBasis, cv::Mat eigenvalues)</td></tr> <tr class="memitem:a90682d9e8a88243a1113b5a6c149799e"><td class="memItemLeft" align="right" valign="top">cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1morphablemodel.html#a90682d9e8a88243a1113b5a6c149799e">unnormalise_pca_basis</a> (cv::Mat normalised_basis, cv::Mat eigenvalues)</td></tr>
<tr class="separator:a3d9ed5fa969cbd540ebe9587540f3607"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a90682d9e8a88243a1113b5a6c149799e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table> </table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Functionality to represent a Morphable Model, containing it's PCA models and loading functions. </p> <div class="textblock"><p>Functionality to represent a Morphable Model, containing it's PCA models and loading functions. </p>
</div><h2 class="groupheader">Function Documentation</h2> </div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a408184d7cae7e40c5c8e76c2bc114811"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::vector&lt;<a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html">Blendshape</a>&gt; eos::morphablemodel::load_blendshapes </td>
<td>(</td>
<td class="paramtype">std::string&#160;</td>
<td class="paramname"><em>filename</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Helper method to load a file with blendshapes from a cereal::BinaryInputArchive from the harddisk.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">filename</td><td>Filename to a blendshapes-file. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The loaded blendshapes. </dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">std::runtime_error</td><td>When the file given in <code>filename</code> fails to be opened (most likely because the file doesn't exist). </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="afa73fdf5b394458b7e21639ae50d074c"></a> <a class="anchor" id="afa73fdf5b394458b7e21639ae50d074c"></a>
<div class="memitem"> <div class="memitem">
<div class="memproto"> <div class="memproto">
...@@ -235,7 +272,7 @@ Functions</h2></td></tr> ...@@ -235,7 +272,7 @@ Functions</h2></td></tr>
</div> </div>
</div> </div>
<a class="anchor" id="a73d9baeb67f25d4604fc291a23e5e2d8"></a> <a class="anchor" id="a31a2b98e73170ae558f6c50e76524817"></a>
<div class="memitem"> <div class="memitem">
<div class="memproto"> <div class="memproto">
<table class="mlabels"> <table class="mlabels">
...@@ -276,6 +313,46 @@ Functions</h2></td></tr> ...@@ -276,6 +313,46 @@ Functions</h2></td></tr>
</dl> </dl>
<dl class="section return"><dt>Returns</dt><dd>The normalised PCA basis matrix. </dd></dl> <dl class="section return"><dt>Returns</dt><dd>The normalised PCA basis matrix. </dd></dl>
</div>
</div>
<a class="anchor" id="a2578fc03dbaa1809873578f17991e278"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void eos::morphablemodel::save_coefficients </td>
<td>(</td>
<td class="paramtype">std::vector&lt; float &gt;&#160;</td>
<td class="paramname"><em>coefficients</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::string&#160;</td>
<td class="paramname"><em>filename</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Saves coefficients (for example PCA shape coefficients) to a json file.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">coefficients</td><td>A vector of coefficients. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">filename</td><td>The file to write. </td></tr>
</table>
</dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">std::runtime_error</td><td>if unable to open the given file for writing. </td></tr>
</table>
</dd>
</dl>
</div> </div>
</div> </div>
<a class="anchor" id="aad09e0fd0788cb7fea41ed799c653e71"></a> <a class="anchor" id="aad09e0fd0788cb7fea41ed799c653e71"></a>
...@@ -312,7 +389,7 @@ Functions</h2></td></tr> ...@@ -312,7 +389,7 @@ Functions</h2></td></tr>
</div> </div>
</div> </div>
<a class="anchor" id="a3d9ed5fa969cbd540ebe9587540f3607"></a> <a class="anchor" id="a90682d9e8a88243a1113b5a6c149799e"></a>
<div class="memitem"> <div class="memitem">
<div class="memproto"> <div class="memproto">
<table class="mlabels"> <table class="mlabels">
...@@ -360,7 +437,7 @@ Functions</h2></td></tr> ...@@ -360,7 +437,7 @@ Functions</h2></td></tr>
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: eos::render Namespace Reference</title> <title>eos: eos::render Namespace Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -110,6 +110,7 @@ Classes</h2></td></tr> ...@@ -110,6 +110,7 @@ Classes</h2></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordinates. <a href="structeos_1_1render_1_1_mesh.html#details">More...</a><br /></td></tr> <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordinates. <a href="structeos_1_1render_1_1_mesh.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1render_1_1_texture.html">Texture</a></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1render_1_1_texture.html">Texture</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Represents a texture for rendering. <a href="classeos_1_1render_1_1_texture.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls"> </table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
...@@ -117,19 +118,19 @@ Enumerations</h2></td></tr> ...@@ -117,19 +118,19 @@ Enumerations</h2></td></tr>
<tr class="memitem:a298bda0bf8e9ee6947522b96d32ab237"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1render.html#a298bda0bf8e9ee6947522b96d32ab237">TextureInterpolation</a> { <b>NearestNeighbour</b>, <tr class="memitem:a298bda0bf8e9ee6947522b96d32ab237"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1render.html#a298bda0bf8e9ee6947522b96d32ab237">TextureInterpolation</a> { <b>NearestNeighbour</b>,
<b>Bilinear</b>, <b>Bilinear</b>,
<b>Area</b> <b>Area</b>
}<tr class="separator:a298bda0bf8e9ee6947522b96d32ab237"><td class="memSeparator" colspan="2">&#160;</td></tr> }</td></tr>
</td></tr> <tr class="separator:a298bda0bf8e9ee6947522b96d32ab237"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls"> </table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr> Functions</h2></td></tr>
<tr class="memitem:a9b4673997fae6d670d7a9cc23543e8d7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1render.html#a9b4673997fae6d670d7a9cc23543e8d7">write_obj</a> (<a class="el" href="structeos_1_1render_1_1_mesh.html">Mesh</a> mesh, std::string filename)</td></tr> <tr class="memitem:a9b4673997fae6d670d7a9cc23543e8d7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1render.html#a9b4673997fae6d670d7a9cc23543e8d7">write_obj</a> (<a class="el" href="structeos_1_1render_1_1_mesh.html">Mesh</a> mesh, std::string filename)</td></tr>
<tr class="memdesc:a9b4673997fae6d670d7a9cc23543e8d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes the given <a class="el" href="structeos_1_1render_1_1_mesh.html" title="This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordin...">Mesh</a> to an obj file that for example can be read by Meshlab. <a href="#a9b4673997fae6d670d7a9cc23543e8d7">More...</a><br /></td></tr> <tr class="memdesc:a9b4673997fae6d670d7a9cc23543e8d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes the given <a class="el" href="structeos_1_1render_1_1_mesh.html" title="This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordin...">Mesh</a> to an obj file that for example can be read by MeshLab. <a href="#a9b4673997fae6d670d7a9cc23543e8d7">More...</a><br /></td></tr>
<tr class="separator:a9b4673997fae6d670d7a9cc23543e8d7"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a9b4673997fae6d670d7a9cc23543e8d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afd6561b065b9c0dd6815580ab12c3204"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1render.html#afd6561b065b9c0dd6815580ab12c3204">write_textured_obj</a> (<a class="el" href="structeos_1_1render_1_1_mesh.html">Mesh</a> mesh, std::string filename)</td></tr> <tr class="memitem:afd6561b065b9c0dd6815580ab12c3204"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1render.html#afd6561b065b9c0dd6815580ab12c3204">write_textured_obj</a> (<a class="el" href="structeos_1_1render_1_1_mesh.html">Mesh</a> mesh, std::string filename)</td></tr>
<tr class="memdesc:afd6561b065b9c0dd6815580ab12c3204"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes an obj file of the given <a class="el" href="structeos_1_1render_1_1_mesh.html" title="This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordin...">Mesh</a>, including texture coordinates, and an mtl file containing a reference to the isomap. <a href="#afd6561b065b9c0dd6815580ab12c3204">More...</a><br /></td></tr> <tr class="memdesc:afd6561b065b9c0dd6815580ab12c3204"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes an obj file of the given <a class="el" href="structeos_1_1render_1_1_mesh.html" title="This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordin...">Mesh</a>, including texture coordinates, and an mtl file containing a reference to the isomap. <a href="#afd6561b065b9c0dd6815580ab12c3204">More...</a><br /></td></tr>
<tr class="separator:afd6561b065b9c0dd6815580ab12c3204"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:afd6561b065b9c0dd6815580ab12c3204"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7628a42875570658bea6ffb4f46723e5"><td class="memItemLeft" align="right" valign="top">std::pair&lt; cv::Mat, cv::Mat &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1render.html#a7628a42875570658bea6ffb4f46723e5">render</a> (<a class="el" href="structeos_1_1render_1_1_mesh.html">Mesh</a> mesh, cv::Mat model_view_matrix, cv::Mat projection_matrix, int viewport_width, int viewport_height, const <a class="el" href="classeos_1_1render_1_1_texture.html">Texture</a> &amp;texture, bool enable_backface_culling=false, bool enable_near_clipping=true, bool enable_far_clipping=true)</td></tr> <tr class="memitem:a097a630659b6c06a4596ca138f66ec94"><td class="memItemLeft" align="right" valign="top">std::pair&lt; cv::Mat, cv::Mat &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1render.html#a097a630659b6c06a4596ca138f66ec94">render</a> (<a class="el" href="structeos_1_1render_1_1_mesh.html">Mesh</a> mesh, cv::Mat model_view_matrix, cv::Mat projection_matrix, int viewport_width, int viewport_height, const boost::optional&lt; <a class="el" href="classeos_1_1render_1_1_texture.html">Texture</a> &gt; &amp;texture=boost::none, bool enable_backface_culling=false, bool enable_near_clipping=true, bool enable_far_clipping=true)</td></tr>
<tr class="separator:a7628a42875570658bea6ffb4f46723e5"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a097a630659b6c06a4596ca138f66ec94"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1adc532475d45d16f7b0c0eddf1bc7cb"><td class="memItemLeft" align="right" valign="top">std::pair&lt; cv::Mat, cv::Mat &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1render.html#a1adc532475d45d16f7b0c0eddf1bc7cb">render_affine</a> (<a class="el" href="structeos_1_1render_1_1_mesh.html">Mesh</a> mesh, cv::Mat affine_camera_matrix, int viewport_width, int viewport_height, bool do_backface_culling=true)</td></tr> <tr class="memitem:a1adc532475d45d16f7b0c0eddf1bc7cb"><td class="memItemLeft" align="right" valign="top">std::pair&lt; cv::Mat, cv::Mat &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1render.html#a1adc532475d45d16f7b0c0eddf1bc7cb">render_affine</a> (<a class="el" href="structeos_1_1render_1_1_mesh.html">Mesh</a> mesh, cv::Mat affine_camera_matrix, int viewport_width, int viewport_height, bool do_backface_culling=true)</td></tr>
<tr class="separator:a1adc532475d45d16f7b0c0eddf1bc7cb"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a1adc532475d45d16f7b0c0eddf1bc7cb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aafa8c960c3b6eb080da1536cc3634577"><td class="memItemLeft" align="right" valign="top">cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1render.html#aafa8c960c3b6eb080da1536cc3634577">extract_texture</a> (<a class="el" href="structeos_1_1render_1_1_mesh.html">Mesh</a> mesh, cv::Mat affine_camera_matrix, cv::Mat image, cv::Mat depthbuffer, bool compute_view_angle, <a class="el" href="namespaceeos_1_1render.html#a298bda0bf8e9ee6947522b96d32ab237">TextureInterpolation</a> mapping_type, int isomap_resolution)</td></tr> <tr class="memitem:aafa8c960c3b6eb080da1536cc3634577"><td class="memItemLeft" align="right" valign="top">cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceeos_1_1render.html#aafa8c960c3b6eb080da1536cc3634577">extract_texture</a> (<a class="el" href="structeos_1_1render_1_1_mesh.html">Mesh</a> mesh, cv::Mat affine_camera_matrix, cv::Mat image, cv::Mat depthbuffer, bool compute_view_angle, <a class="el" href="namespaceeos_1_1render.html#a298bda0bf8e9ee6947522b96d32ab237">TextureInterpolation</a> mapping_type, int isomap_resolution)</td></tr>
...@@ -442,7 +443,7 @@ bool&#160;</td><td class="memItemRight" valign="bottom"><b>is_power_of_two</b> ( ...@@ -442,7 +443,7 @@ bool&#160;</td><td class="memItemRight" valign="bottom"><b>is_power_of_two</b> (
</table> </table>
</div><div class="memdoc"> </div><div class="memdoc">
<p>Extracts the texture of the face from the given image and stores it as isomap (a rectangular texture map).</p> <p>Extracts the texture of the face from the given image and stores it as isomap (a rectangular texture map).</p>
<p>Note/#Todo: Only use TextureInterpolation::NearestNeighbour for the moment, the other methods don't have correct handling of the alpha channel (and will most likely throw an exception).</p> <p>Note/Todo: Only use TextureInterpolation::NearestNeighbour for the moment, the other methods don't have correct handling of the alpha channel (and will most likely throw an exception).</p>
<p>Todo: These should be renamed to extract_texture_affine? Can we combine both cases somehow? Or an overload with RenderingParameters?</p> <p>Todo: These should be renamed to extract_texture_affine? Can we combine both cases somehow? Or an overload with RenderingParameters?</p>
<p>For TextureInterpolation::NearestNeighbour, returns a 4-channel isomap with the visibility in the 4th channel (0=invis, 255=visible).</p> <p>For TextureInterpolation::NearestNeighbour, returns a 4-channel isomap with the visibility in the 4th channel (0=invis, 255=visible).</p>
<dl class="params"><dt>Parameters</dt><dd> <dl class="params"><dt>Parameters</dt><dd>
...@@ -460,7 +461,7 @@ bool&#160;</td><td class="memItemRight" valign="bottom"><b>is_power_of_two</b> ( ...@@ -460,7 +461,7 @@ bool&#160;</td><td class="memItemRight" valign="bottom"><b>is_power_of_two</b> (
</div> </div>
</div> </div>
<a class="anchor" id="a7628a42875570658bea6ffb4f46723e5"></a> <a class="anchor" id="a097a630659b6c06a4596ca138f66ec94"></a>
<div class="memitem"> <div class="memitem">
<div class="memproto"> <div class="memproto">
<table class="memname"> <table class="memname">
...@@ -497,8 +498,8 @@ bool&#160;</td><td class="memItemRight" valign="bottom"><b>is_power_of_two</b> ( ...@@ -497,8 +498,8 @@ bool&#160;</td><td class="memItemRight" valign="bottom"><b>is_power_of_two</b> (
<tr> <tr>
<td class="paramkey"></td> <td class="paramkey"></td>
<td></td> <td></td>
<td class="paramtype">const <a class="el" href="classeos_1_1render_1_1_texture.html">Texture</a> &amp;&#160;</td> <td class="paramtype">const boost::optional&lt; <a class="el" href="classeos_1_1render_1_1_texture.html">Texture</a> &gt; &amp;&#160;</td>
<td class="paramname"><em>texture</em>, </td> <td class="paramname"><em>texture</em> = <code>boost::none</code>, </td>
</tr> </tr>
<tr> <tr>
<td class="paramkey"></td> <td class="paramkey"></td>
...@@ -545,10 +546,10 @@ bool&#160;</td><td class="memItemRight" valign="bottom"><b>is_power_of_two</b> ( ...@@ -545,10 +546,10 @@ bool&#160;</td><td class="memItemRight" valign="bottom"><b>is_power_of_two</b> (
<tr><td class="paramdir">[in]</td><td class="paramname">projection_matrix</td><td>A 4x4 orthographic or perspective OpenGL projection matrix. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">projection_matrix</td><td>A 4x4 orthographic or perspective OpenGL projection matrix. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">viewport_width</td><td>Screen width. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">viewport_width</td><td>Screen width. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">viewport_height</td><td>Screen height. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">viewport_height</td><td>Screen height. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">texture</td><td>An optional texture map (TODO: Not optional yet!). </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">texture</td><td>An optional texture map. If not given, vertex-colouring is used. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">enable_backface_culling</td><td>Whether the renderer should perform backface culling. If true, only draw triangles with vertices ordered CCW in screen-space. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">enable_backface_culling</td><td>Whether the renderer should perform backface culling. If true, only draw triangles with vertices ordered CCW in screen-space. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">enable_near_clipping</td><td>Screen height. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">enable_near_clipping</td><td>Whether vertices should be clipped against the near plane. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">enable_far_clipping</td><td>Screen height. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">enable_far_clipping</td><td>Whether vertices should be clipped against the far plane. </td></tr>
</table> </table>
</dd> </dd>
</dl> </dl>
...@@ -696,12 +697,12 @@ bool&#160;</td><td class="memItemRight" valign="bottom"><b>is_power_of_two</b> ( ...@@ -696,12 +697,12 @@ bool&#160;</td><td class="memItemRight" valign="bottom"><b>is_power_of_two</b> (
</table> </table>
</div><div class="memdoc"> </div><div class="memdoc">
<p>Writes the given <a class="el" href="structeos_1_1render_1_1_mesh.html" title="This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordin...">Mesh</a> to an obj file that for example can be read by Meshlab. </p> <p>Writes the given <a class="el" href="structeos_1_1render_1_1_mesh.html" title="This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordin...">Mesh</a> to an obj file that for example can be read by MeshLab. </p>
<p>If the mesh contains vertex colour information, it will be written to the obj as well.</p> <p>If the mesh contains vertex colour information, it will be written to the obj as well.</p>
<dl class="params"><dt>Parameters</dt><dd> <dl class="params"><dt>Parameters</dt><dd>
<table class="params"> <table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">mesh</td><td>The mesh to save as obj. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">mesh</td><td>The mesh to save as obj. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">filename</td><td>Output filename. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">filename</td><td>Output filename (including ".obj"). </td></tr>
</table> </table>
</dd> </dd>
</dl> </dl>
...@@ -757,7 +758,7 @@ bool&#160;</td><td class="memItemRight" valign="bottom"><b>is_power_of_two</b> ( ...@@ -757,7 +758,7 @@ bool&#160;</td><td class="memItemRight" valign="bottom"><b>is_power_of_two</b> (
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: Namespace Members</title> <title>eos: Namespace Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -80,6 +80,23 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -80,6 +80,23 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<li><a href="namespacemembers_enum.html"><span>Enumerations</span></a></li> <li><a href="namespacemembers_enum.html"><span>Enumerations</span></a></li>
</ul> </ul>
</div> </div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="#index_c"><span>c</span></a></li>
<li><a href="#index_d"><span>d</span></a></li>
<li><a href="#index_e"><span>e</span></a></li>
<li><a href="#index_f"><span>f</span></a></li>
<li><a href="#index_g"><span>g</span></a></li>
<li><a href="#index_l"><span>l</span></a></li>
<li><a href="#index_n"><span>n</span></a></li>
<li><a href="#index_p"><span>p</span></a></li>
<li><a href="#index_r"><span>r</span></a></li>
<li><a href="#index_s"><span>s</span></a></li>
<li><a href="#index_t"><span>t</span></a></li>
<li><a href="#index_u"><span>u</span></a></li>
<li class="current"><a href="#index_w"><span>w</span></a></li>
</ul>
</div>
</div><!-- top --> </div><!-- top -->
<!-- window showing the filter options --> <!-- window showing the filter options -->
<div id="MSearchSelectWindow" <div id="MSearchSelectWindow"
...@@ -96,45 +113,85 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -96,45 +113,85 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</div> </div>
<div class="contents"> <div class="contents">
<div class="textblock">Here is a list of all documented namespace members with links to the namespaces they belong to:</div><ul> <div class="textblock">Here is a list of all documented namespace members with links to the namespaces they belong to:</div>
<h3><a class="anchor" id="index_c"></a>- c -</h3><ul>
<li>calculate_face_normal() <li>calculate_face_normal()
: <a class="el" href="namespaceeos_1_1render.html#ac72cdee6eed13468a424824ddd0b3074">eos::render</a> : <a class="el" href="namespaceeos_1_1render.html#ac72cdee6eed13468a424824ddd0b3074">eos::render</a>
</li> </li>
<li>CameraType
: <a class="el" href="namespaceeos_1_1fitting.html#a63fce336daef96cde45f61701c4a3cf4">eos::fitting</a>
</li>
<li>clip_to_screen_space() <li>clip_to_screen_space()
: <a class="el" href="namespaceeos_1_1render.html#a04bb2f816e97ecb7f33cf8a50328e0db">eos::render</a> : <a class="el" href="namespaceeos_1_1render.html#a04bb2f816e97ecb7f33cf8a50328e0db">eos::render</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_d"></a>- d -</h3><ul>
<li>draw_texcoords() <li>draw_texcoords()
: <a class="el" href="namespaceeos_1_1render.html#a4edecd42a4a04ba6eb95089dd3ff256a">eos::render</a> : <a class="el" href="namespaceeos_1_1render.html#a4edecd42a4a04ba6eb95089dd3ff256a">eos::render</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_e"></a>- e -</h3><ul>
<li>estimate_affine_camera() <li>estimate_affine_camera()
: <a class="el" href="namespaceeos_1_1fitting.html#afce5f7297094056a04ad26785c94bbd8">eos::fitting</a> : <a class="el" href="namespaceeos_1_1fitting.html#afce5f7297094056a04ad26785c94bbd8">eos::fitting</a>
</li> </li>
<li>estimate_orthographic_camera() <li>estimate_orthographic_camera()
: <a class="el" href="namespaceeos_1_1fitting.html#aebab65b3f9f46758b1363a347e6de852">eos::fitting</a> : <a class="el" href="namespaceeos_1_1fitting.html#a9f55324bfa740c6b5061518535506084">eos::fitting</a>
</li> </li>
<li>extract_texture() <li>extract_texture()
: <a class="el" href="namespaceeos_1_1render.html#aafa8c960c3b6eb080da1536cc3634577">eos::render</a> : <a class="el" href="namespaceeos_1_1render.html#aafa8c960c3b6eb080da1536cc3634577">eos::render</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_f"></a>- f -</h3><ul>
<li>filter() <li>filter()
: <a class="el" href="namespaceeos_1_1core.html#aacf41dc417a1dbfc929c9cc7f2c7feeb">eos::core</a> : <a class="el" href="namespaceeos_1_1core.html#aacf41dc417a1dbfc929c9cc7f2c7feeb">eos::core</a>
</li> </li>
<li>fit_blendshapes_to_landmarks_linear()
: <a class="el" href="namespaceeos_1_1fitting.html#ac429313cbc0ed61744f1b0fa4dba672b">eos::fitting</a>
</li>
<li>fit_shape()
: <a class="el" href="namespaceeos_1_1fitting.html#ae3bcf9f955efce788838cc055b5282b6">eos::fitting</a>
</li>
<li>fit_shape_to_landmarks_linear() <li>fit_shape_to_landmarks_linear()
: <a class="el" href="namespaceeos_1_1fitting.html#ae68794185075b5b67fddae9d359cf208">eos::fitting</a> : <a class="el" href="namespaceeos_1_1fitting.html#ae558a318d1d0c1da35d64b7abb209fac">eos::fitting</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_g"></a>- g -</h3><ul>
<li>get_3x4_affine_camera_matrix() <li>get_3x4_affine_camera_matrix()
: <a class="el" href="namespaceeos_1_1fitting.html#af600978a071bc5dc0443cfe41ae613bf">eos::fitting</a> : <a class="el" href="namespaceeos_1_1fitting.html#abebc061912b7ef0b180536b467e8dc6f">eos::fitting</a>
</li> </li>
<li>get_4x4_modelview_matrix() <li>get_4x4_modelview_matrix()
: <a class="el" href="namespaceeos_1_1fitting.html#a503a126cfe1bbd6a7c8b7a786a8e73b8">eos::fitting</a> : <a class="el" href="namespaceeos_1_1fitting.html#a198aa8a0c4d90a51bb1b422cfc6a87c4">eos::fitting</a>
</li>
<li>get_contour_correspondences()
: <a class="el" href="namespaceeos_1_1fitting.html#af8ce6f464c22e42b5f98e96ef7f06ab0">eos::fitting</a>
</li>
<li>get_nearest_contour_correspondences()
: <a class="el" href="namespaceeos_1_1fitting.html#ade368ea637ac45c9e344dde326ffe174">eos::fitting</a>
</li> </li>
<li>get_opencv_viewport() <li>get_opencv_viewport()
: <a class="el" href="namespaceeos_1_1fitting.html#a4e713b5555396806a9b26817184eacd0">eos::fitting</a> : <a class="el" href="namespaceeos_1_1fitting.html#a4e713b5555396806a9b26817184eacd0">eos::fitting</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_l"></a>- l -</h3><ul>
<li>LandmarkCollection <li>LandmarkCollection
: <a class="el" href="namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b">eos::core</a> : <a class="el" href="namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b">eos::core</a>
</li> </li>
<li>load() <li>load()
: <a class="el" href="namespacecv.html#a7172a20ab6627a1c1967d322bdfc8756">cv</a> : <a class="el" href="namespacecv.html#a9efebfa4f4c3e7117f0effe0ef18fd61">cv</a>
</li>
<li>load_blendshapes()
: <a class="el" href="namespaceeos_1_1morphablemodel.html#a408184d7cae7e40c5c8e76c2bc114811">eos::morphablemodel</a>
</li> </li>
<li>load_isomap() <li>load_isomap()
: <a class="el" href="namespaceeos_1_1morphablemodel.html#afa73fdf5b394458b7e21639ae50d074c">eos::morphablemodel</a> : <a class="el" href="namespaceeos_1_1morphablemodel.html#afa73fdf5b394458b7e21639ae50d074c">eos::morphablemodel</a>
...@@ -145,39 +202,76 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -145,39 +202,76 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<li>load_scm_model() <li>load_scm_model()
: <a class="el" href="namespaceeos_1_1morphablemodel.html#a0d607b8838d70cd8ec41cb4bfe116f58">eos::morphablemodel</a> : <a class="el" href="namespaceeos_1_1morphablemodel.html#a0d607b8838d70cd8ec41cb4bfe116f58">eos::morphablemodel</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_n"></a>- n -</h3><ul>
<li>normalise_pca_basis() <li>normalise_pca_basis()
: <a class="el" href="namespaceeos_1_1morphablemodel.html#a73d9baeb67f25d4604fc291a23e5e2d8">eos::morphablemodel</a> : <a class="el" href="namespaceeos_1_1morphablemodel.html#a31a2b98e73170ae558f6c50e76524817">eos::morphablemodel</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_p"></a>- p -</h3><ul>
<li>project_affine() <li>project_affine()
: <a class="el" href="namespaceeos_1_1fitting.html#a3e99a34e412f0bb5b2c6568dd37ae413">eos::fitting</a> : <a class="el" href="namespaceeos_1_1fitting.html#a3e99a34e412f0bb5b2c6568dd37ae413">eos::fitting</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_r"></a>- r -</h3><ul>
<li>render() <li>render()
: <a class="el" href="namespaceeos_1_1render.html#a7628a42875570658bea6ffb4f46723e5">eos::render</a> : <a class="el" href="namespaceeos_1_1render.html#a097a630659b6c06a4596ca138f66ec94">eos::render</a>
</li> </li>
<li>render_affine() <li>render_affine()
: <a class="el" href="namespaceeos_1_1render.html#a1adc532475d45d16f7b0c0eddf1bc7cb">eos::render</a> : <a class="el" href="namespaceeos_1_1render.html#a1adc532475d45d16f7b0c0eddf1bc7cb">eos::render</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_s"></a>- s -</h3><ul>
<li>save() <li>save()
: <a class="el" href="namespacecv.html#a62cc822cc258c9305ac746d3a832f9d4">cv</a> : <a class="el" href="namespacecv.html#a758b4418894b35447bfd472847c1dfaf">cv</a>
</li>
<li>save_coefficients()
: <a class="el" href="namespaceeos_1_1morphablemodel.html#a2578fc03dbaa1809873578f17991e278">eos::morphablemodel</a>
</li> </li>
<li>save_model() <li>save_model()
: <a class="el" href="namespaceeos_1_1morphablemodel.html#aad09e0fd0788cb7fea41ed799c653e71">eos::morphablemodel</a> : <a class="el" href="namespaceeos_1_1morphablemodel.html#aad09e0fd0788cb7fea41ed799c653e71">eos::morphablemodel</a>
</li> </li>
<li>save_rendering_parameters()
: <a class="el" href="namespaceeos_1_1fitting.html#a03b4bc35b0619e7f4bd0fccbb2d35e2c">eos::fitting</a>
</li>
<li>screen_to_clip_space() <li>screen_to_clip_space()
: <a class="el" href="namespaceeos_1_1render.html#a7c4b923267e9b3b09c0c588bfdd4cb85">eos::render</a> : <a class="el" href="namespaceeos_1_1render.html#a7c4b923267e9b3b09c0c588bfdd4cb85">eos::render</a>
</li> </li>
<li>select_contour()
: <a class="el" href="namespaceeos_1_1fitting.html#a6a307eaa4a1a9f2c5e2c33a95a6e261d">eos::fitting</a>
</li>
<li>serialize() <li>serialize()
: <a class="el" href="namespacecv.html#a51eb61cb95a3e45290a030560ac7a2cd">cv</a> : <a class="el" href="namespacecv.html#a51eb61cb95a3e45290a030560ac7a2cd">cv</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_t"></a>- t -</h3><ul>
<li>TextureInterpolation <li>TextureInterpolation
: <a class="el" href="namespaceeos_1_1render.html#a298bda0bf8e9ee6947522b96d32ab237">eos::render</a> : <a class="el" href="namespaceeos_1_1render.html#a298bda0bf8e9ee6947522b96d32ab237">eos::render</a>
</li> </li>
<li>to_mat() <li>to_mat()
: <a class="el" href="namespaceeos_1_1fitting.html#a93f7464a6c6dee7b3885638014ec009a">eos::fitting</a> : <a class="el" href="namespaceeos_1_1fitting.html#a93f7464a6c6dee7b3885638014ec009a">eos::fitting</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_u"></a>- u -</h3><ul>
<li>unnormalise_pca_basis() <li>unnormalise_pca_basis()
: <a class="el" href="namespaceeos_1_1morphablemodel.html#a3d9ed5fa969cbd540ebe9587540f3607">eos::morphablemodel</a> : <a class="el" href="namespaceeos_1_1morphablemodel.html#a90682d9e8a88243a1113b5a6c149799e">eos::morphablemodel</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_w"></a>- w -</h3><ul>
<li>write_obj() <li>write_obj()
: <a class="el" href="namespaceeos_1_1render.html#a9b4673997fae6d670d7a9cc23543e8d7">eos::render</a> : <a class="el" href="namespaceeos_1_1render.html#a9b4673997fae6d670d7a9cc23543e8d7">eos::render</a>
</li> </li>
...@@ -190,7 +284,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -190,7 +284,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: Namespace Members</title> <title>eos: Namespace Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -97,6 +97,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -97,6 +97,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="contents"> <div class="contents">
&#160;<ul> &#160;<ul>
<li>CameraType
: <a class="el" href="namespaceeos_1_1fitting.html#a63fce336daef96cde45f61701c4a3cf4">eos::fitting</a>
</li>
<li>TextureInterpolation <li>TextureInterpolation
: <a class="el" href="namespaceeos_1_1render.html#a298bda0bf8e9ee6947522b96d32ab237">eos::render</a> : <a class="el" href="namespaceeos_1_1render.html#a298bda0bf8e9ee6947522b96d32ab237">eos::render</a>
</li> </li>
...@@ -106,7 +109,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -106,7 +109,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: Namespace Members</title> <title>eos: Namespace Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -80,6 +80,23 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -80,6 +80,23 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<li><a href="namespacemembers_enum.html"><span>Enumerations</span></a></li> <li><a href="namespacemembers_enum.html"><span>Enumerations</span></a></li>
</ul> </ul>
</div> </div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="#index_c"><span>c</span></a></li>
<li><a href="#index_d"><span>d</span></a></li>
<li><a href="#index_e"><span>e</span></a></li>
<li><a href="#index_f"><span>f</span></a></li>
<li><a href="#index_g"><span>g</span></a></li>
<li><a href="#index_l"><span>l</span></a></li>
<li><a href="#index_n"><span>n</span></a></li>
<li><a href="#index_p"><span>p</span></a></li>
<li><a href="#index_r"><span>r</span></a></li>
<li><a href="#index_s"><span>s</span></a></li>
<li><a href="#index_t"><span>t</span></a></li>
<li><a href="#index_u"><span>u</span></a></li>
<li class="current"><a href="#index_w"><span>w</span></a></li>
</ul>
</div>
</div><!-- top --> </div><!-- top -->
<!-- window showing the filter options --> <!-- window showing the filter options -->
<div id="MSearchSelectWindow" <div id="MSearchSelectWindow"
...@@ -96,42 +113,79 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -96,42 +113,79 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</div> </div>
<div class="contents"> <div class="contents">
&#160;<ul> &#160;
<h3><a class="anchor" id="index_c"></a>- c -</h3><ul>
<li>calculate_face_normal() <li>calculate_face_normal()
: <a class="el" href="namespaceeos_1_1render.html#ac72cdee6eed13468a424824ddd0b3074">eos::render</a> : <a class="el" href="namespaceeos_1_1render.html#ac72cdee6eed13468a424824ddd0b3074">eos::render</a>
</li> </li>
<li>clip_to_screen_space() <li>clip_to_screen_space()
: <a class="el" href="namespaceeos_1_1render.html#a04bb2f816e97ecb7f33cf8a50328e0db">eos::render</a> : <a class="el" href="namespaceeos_1_1render.html#a04bb2f816e97ecb7f33cf8a50328e0db">eos::render</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_d"></a>- d -</h3><ul>
<li>draw_texcoords() <li>draw_texcoords()
: <a class="el" href="namespaceeos_1_1render.html#a4edecd42a4a04ba6eb95089dd3ff256a">eos::render</a> : <a class="el" href="namespaceeos_1_1render.html#a4edecd42a4a04ba6eb95089dd3ff256a">eos::render</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_e"></a>- e -</h3><ul>
<li>estimate_affine_camera() <li>estimate_affine_camera()
: <a class="el" href="namespaceeos_1_1fitting.html#afce5f7297094056a04ad26785c94bbd8">eos::fitting</a> : <a class="el" href="namespaceeos_1_1fitting.html#afce5f7297094056a04ad26785c94bbd8">eos::fitting</a>
</li> </li>
<li>estimate_orthographic_camera() <li>estimate_orthographic_camera()
: <a class="el" href="namespaceeos_1_1fitting.html#aebab65b3f9f46758b1363a347e6de852">eos::fitting</a> : <a class="el" href="namespaceeos_1_1fitting.html#a9f55324bfa740c6b5061518535506084">eos::fitting</a>
</li> </li>
<li>extract_texture() <li>extract_texture()
: <a class="el" href="namespaceeos_1_1render.html#aafa8c960c3b6eb080da1536cc3634577">eos::render</a> : <a class="el" href="namespaceeos_1_1render.html#aafa8c960c3b6eb080da1536cc3634577">eos::render</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_f"></a>- f -</h3><ul>
<li>filter() <li>filter()
: <a class="el" href="namespaceeos_1_1core.html#aacf41dc417a1dbfc929c9cc7f2c7feeb">eos::core</a> : <a class="el" href="namespaceeos_1_1core.html#aacf41dc417a1dbfc929c9cc7f2c7feeb">eos::core</a>
</li> </li>
<li>fit_blendshapes_to_landmarks_linear()
: <a class="el" href="namespaceeos_1_1fitting.html#ac429313cbc0ed61744f1b0fa4dba672b">eos::fitting</a>
</li>
<li>fit_shape()
: <a class="el" href="namespaceeos_1_1fitting.html#ae3bcf9f955efce788838cc055b5282b6">eos::fitting</a>
</li>
<li>fit_shape_to_landmarks_linear() <li>fit_shape_to_landmarks_linear()
: <a class="el" href="namespaceeos_1_1fitting.html#ae68794185075b5b67fddae9d359cf208">eos::fitting</a> : <a class="el" href="namespaceeos_1_1fitting.html#ae558a318d1d0c1da35d64b7abb209fac">eos::fitting</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_g"></a>- g -</h3><ul>
<li>get_3x4_affine_camera_matrix() <li>get_3x4_affine_camera_matrix()
: <a class="el" href="namespaceeos_1_1fitting.html#af600978a071bc5dc0443cfe41ae613bf">eos::fitting</a> : <a class="el" href="namespaceeos_1_1fitting.html#abebc061912b7ef0b180536b467e8dc6f">eos::fitting</a>
</li> </li>
<li>get_4x4_modelview_matrix() <li>get_4x4_modelview_matrix()
: <a class="el" href="namespaceeos_1_1fitting.html#a503a126cfe1bbd6a7c8b7a786a8e73b8">eos::fitting</a> : <a class="el" href="namespaceeos_1_1fitting.html#a198aa8a0c4d90a51bb1b422cfc6a87c4">eos::fitting</a>
</li>
<li>get_contour_correspondences()
: <a class="el" href="namespaceeos_1_1fitting.html#af8ce6f464c22e42b5f98e96ef7f06ab0">eos::fitting</a>
</li>
<li>get_nearest_contour_correspondences()
: <a class="el" href="namespaceeos_1_1fitting.html#ade368ea637ac45c9e344dde326ffe174">eos::fitting</a>
</li> </li>
<li>get_opencv_viewport() <li>get_opencv_viewport()
: <a class="el" href="namespaceeos_1_1fitting.html#a4e713b5555396806a9b26817184eacd0">eos::fitting</a> : <a class="el" href="namespaceeos_1_1fitting.html#a4e713b5555396806a9b26817184eacd0">eos::fitting</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_l"></a>- l -</h3><ul>
<li>load() <li>load()
: <a class="el" href="namespacecv.html#a7172a20ab6627a1c1967d322bdfc8756">cv</a> : <a class="el" href="namespacecv.html#a9efebfa4f4c3e7117f0effe0ef18fd61">cv</a>
</li>
<li>load_blendshapes()
: <a class="el" href="namespaceeos_1_1morphablemodel.html#a408184d7cae7e40c5c8e76c2bc114811">eos::morphablemodel</a>
</li> </li>
<li>load_isomap() <li>load_isomap()
: <a class="el" href="namespaceeos_1_1morphablemodel.html#afa73fdf5b394458b7e21639ae50d074c">eos::morphablemodel</a> : <a class="el" href="namespaceeos_1_1morphablemodel.html#afa73fdf5b394458b7e21639ae50d074c">eos::morphablemodel</a>
...@@ -142,36 +196,73 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -142,36 +196,73 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<li>load_scm_model() <li>load_scm_model()
: <a class="el" href="namespaceeos_1_1morphablemodel.html#a0d607b8838d70cd8ec41cb4bfe116f58">eos::morphablemodel</a> : <a class="el" href="namespaceeos_1_1morphablemodel.html#a0d607b8838d70cd8ec41cb4bfe116f58">eos::morphablemodel</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_n"></a>- n -</h3><ul>
<li>normalise_pca_basis() <li>normalise_pca_basis()
: <a class="el" href="namespaceeos_1_1morphablemodel.html#a73d9baeb67f25d4604fc291a23e5e2d8">eos::morphablemodel</a> : <a class="el" href="namespaceeos_1_1morphablemodel.html#a31a2b98e73170ae558f6c50e76524817">eos::morphablemodel</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_p"></a>- p -</h3><ul>
<li>project_affine() <li>project_affine()
: <a class="el" href="namespaceeos_1_1fitting.html#a3e99a34e412f0bb5b2c6568dd37ae413">eos::fitting</a> : <a class="el" href="namespaceeos_1_1fitting.html#a3e99a34e412f0bb5b2c6568dd37ae413">eos::fitting</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_r"></a>- r -</h3><ul>
<li>render() <li>render()
: <a class="el" href="namespaceeos_1_1render.html#a7628a42875570658bea6ffb4f46723e5">eos::render</a> : <a class="el" href="namespaceeos_1_1render.html#a097a630659b6c06a4596ca138f66ec94">eos::render</a>
</li> </li>
<li>render_affine() <li>render_affine()
: <a class="el" href="namespaceeos_1_1render.html#a1adc532475d45d16f7b0c0eddf1bc7cb">eos::render</a> : <a class="el" href="namespaceeos_1_1render.html#a1adc532475d45d16f7b0c0eddf1bc7cb">eos::render</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_s"></a>- s -</h3><ul>
<li>save() <li>save()
: <a class="el" href="namespacecv.html#a62cc822cc258c9305ac746d3a832f9d4">cv</a> : <a class="el" href="namespacecv.html#a758b4418894b35447bfd472847c1dfaf">cv</a>
</li>
<li>save_coefficients()
: <a class="el" href="namespaceeos_1_1morphablemodel.html#a2578fc03dbaa1809873578f17991e278">eos::morphablemodel</a>
</li> </li>
<li>save_model() <li>save_model()
: <a class="el" href="namespaceeos_1_1morphablemodel.html#aad09e0fd0788cb7fea41ed799c653e71">eos::morphablemodel</a> : <a class="el" href="namespaceeos_1_1morphablemodel.html#aad09e0fd0788cb7fea41ed799c653e71">eos::morphablemodel</a>
</li> </li>
<li>save_rendering_parameters()
: <a class="el" href="namespaceeos_1_1fitting.html#a03b4bc35b0619e7f4bd0fccbb2d35e2c">eos::fitting</a>
</li>
<li>screen_to_clip_space() <li>screen_to_clip_space()
: <a class="el" href="namespaceeos_1_1render.html#a7c4b923267e9b3b09c0c588bfdd4cb85">eos::render</a> : <a class="el" href="namespaceeos_1_1render.html#a7c4b923267e9b3b09c0c588bfdd4cb85">eos::render</a>
</li> </li>
<li>select_contour()
: <a class="el" href="namespaceeos_1_1fitting.html#a6a307eaa4a1a9f2c5e2c33a95a6e261d">eos::fitting</a>
</li>
<li>serialize() <li>serialize()
: <a class="el" href="namespacecv.html#a51eb61cb95a3e45290a030560ac7a2cd">cv</a> : <a class="el" href="namespacecv.html#a51eb61cb95a3e45290a030560ac7a2cd">cv</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_t"></a>- t -</h3><ul>
<li>to_mat() <li>to_mat()
: <a class="el" href="namespaceeos_1_1fitting.html#a93f7464a6c6dee7b3885638014ec009a">eos::fitting</a> : <a class="el" href="namespaceeos_1_1fitting.html#a93f7464a6c6dee7b3885638014ec009a">eos::fitting</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_u"></a>- u -</h3><ul>
<li>unnormalise_pca_basis() <li>unnormalise_pca_basis()
: <a class="el" href="namespaceeos_1_1morphablemodel.html#a3d9ed5fa969cbd540ebe9587540f3607">eos::morphablemodel</a> : <a class="el" href="namespaceeos_1_1morphablemodel.html#a90682d9e8a88243a1113b5a6c149799e">eos::morphablemodel</a>
</li> </li>
</ul>
<h3><a class="anchor" id="index_w"></a>- w -</h3><ul>
<li>write_obj() <li>write_obj()
: <a class="el" href="namespaceeos_1_1render.html#a9b4673997fae6d670d7a9cc23543e8d7">eos::render</a> : <a class="el" href="namespaceeos_1_1render.html#a9b4673997fae6d670d7a9cc23543e8d7">eos::render</a>
</li> </li>
...@@ -184,7 +275,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -184,7 +275,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: Namespace Members</title> <title>eos: Namespace Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -106,7 +106,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -106,7 +106,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: Namespace List</title> <title>eos: Namespace List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -107,7 +107,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -107,7 +107,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/fitting/nonlinear_camera_estimation.hpp Source File</title> <title>eos: include/eos/fitting/nonlinear_camera_estimation.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div id="nav-path" class="navpath"> <div id="nav-path" class="navpath">
<ul> <ul>
<li class="navelem"><a class="el" href="dir_ce53d3124a8ddb93985ce6ec479297f4.html">include</a></li><li class="navelem"><a class="el" href="dir_c7ebde285fcef06dba0b090642612638.html">eos</a></li><li class="navelem"><a class="el" href="dir_349d8dd52ed72e674b9a830f9a7a4dcc.html">fitting</a></li> </ul> <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_5c0181df23c28f36a953fd4c7a01cbc0.html">fitting</a></li> </ul>
</div> </div>
</div><!-- top --> </div><!-- top -->
<div class="header"> <div class="header">
...@@ -95,156 +95,24 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -95,156 +95,24 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="title">nonlinear_camera_estimation.hpp</div> </div> <div class="title">nonlinear_camera_estimation.hpp</div> </div>
</div><!--header--> </div><!--header-->
<div class="contents"> <div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div> <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/fitting/nonlinear_camera_estimation.hpp</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2015 Patrik Huber</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef NONLINEARCAMERAESTIMATION_HPP_</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define NONLINEARCAMERAESTIMATION_HPP_</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;eos/fitting/detail/nonlinear_camera_estimation_detail.hpp&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;glm/gtc/matrix_transform.hpp&quot;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &quot;eos/fitting/detail/optional_cerealisation.hpp&quot;</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &quot;cereal/cereal.hpp&quot;</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &quot;cereal/archives/json.hpp&quot;</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="preprocessor">#include &quot;Eigen/Geometry&quot;</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor">#include &quot;unsupported/Eigen/NonLinearOptimization&quot;</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="preprocessor">#include &quot;boost/optional.hpp&quot;</span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="preprocessor">#include &lt;cassert&gt;</span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; <span class="keyword">namespace </span>fitting {</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;</div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="structeos_1_1fitting_1_1_frustum.html"> 50</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structeos_1_1fitting_1_1_frustum.html">Frustum</a></div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;{</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="keywordtype">float</span> l, r, b, t;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; <span class="comment">// optional&lt;float&gt; n, f;</span></div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; boost::optional&lt;float&gt; n;</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; boost::optional&lt;float&gt; f;</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span>cereal::access;</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">class</span> Archive&gt;</div><div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="structeos_1_1fitting_1_1_frustum.html#ad2927fb97762ef726696cf6296b5b9d4"> 64</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="structeos_1_1fitting_1_1_frustum.html#ad2927fb97762ef726696cf6296b5b9d4">serialize</a>(Archive&amp; archive)</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; {</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; archive(CEREAL_NVP(l), CEREAL_NVP(r), CEREAL_NVP(b), CEREAL_NVP(t), CEREAL_NVP(n), CEREAL_NVP(f));</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; };</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;};</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;</div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#a63fce336daef96cde45f61701c4a3cf4"> 75</a></span>&#160;<span class="keyword">enum class</span> <a class="code" href="namespaceeos_1_1fitting.html#a63fce336daef96cde45f61701c4a3cf4">CameraType</a></div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;{</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; Orthographic,</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; Perspective</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;};</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;</div><div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="structeos_1_1fitting_1_1_rendering_parameters.html"> 102</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structeos_1_1fitting_1_1_rendering_parameters.html">RenderingParameters</a></div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;{</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <a class="code" href="namespaceeos_1_1fitting.html#a63fce336daef96cde45f61701c4a3cf4">CameraType</a> camera_type; <span class="comment">// what&#39;s the default?</span></div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <a class="code" href="structeos_1_1fitting_1_1_frustum.html">Frustum</a> frustum;</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; </div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <span class="keywordtype">float</span> r_x; <span class="comment">// Pitch.</span></div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="keywordtype">float</span> r_y; <span class="comment">// Yaw. Positive means subject is looking left (we see her right cheek).</span></div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="keywordtype">float</span> r_z; <span class="comment">// Roll. Positive means the subject&#39;s right eye is further down than the other one (he tilts his head to the right).</span></div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="keywordtype">float</span> t_x; <span class="comment">// Todo: define whether it&#39;s the camera translation/rotation or the model&#39;s.</span></div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keywordtype">float</span> t_y;</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; </div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="keywordtype">int</span> screen_width;</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <span class="keywordtype">int</span> screen_height;</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; boost::optional&lt;float&gt; focal_length; <span class="comment">// only for certain camera types</span></div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span>cereal::access;</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">class</span> Archive&gt;</div><div class="line"><a name="l00125"></a><span class="lineno"><a class="line" href="structeos_1_1fitting_1_1_rendering_parameters.html#a5d9a13513843bc122a58ebae9801fada"> 125</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="structeos_1_1fitting_1_1_rendering_parameters.html#a5d9a13513843bc122a58ebae9801fada">serialize</a>(Archive&amp; archive)</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; {</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; archive(CEREAL_NVP(camera_type), CEREAL_NVP(frustum), CEREAL_NVP(r_x), CEREAL_NVP(r_y), CEREAL_NVP(r_z), CEREAL_NVP(t_x), CEREAL_NVP(t_y), CEREAL_NVP(screen_width), CEREAL_NVP(screen_height), CEREAL_NVP(focal_length));</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; };</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;};</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;</div><div class="line"><a name="l00138"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#a03b4bc35b0619e7f4bd0fccbb2d35e2c"> 138</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespaceeos_1_1fitting.html#a03b4bc35b0619e7f4bd0fccbb2d35e2c">save_rendering_parameters</a>(<a class="code" href="structeos_1_1fitting_1_1_rendering_parameters.html">RenderingParameters</a> rendering_parameters, std::string filename)</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;{</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; std::ofstream file(filename);</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <span class="keywordflow">if</span> (file.fail()) {</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">&quot;Error opening file for writing: &quot;</span> + filename);</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; }</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; cereal::JSONOutputArchive output_archive(file);</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; output_archive(cereal::make_nvp(<span class="stringliteral">&quot;rendering_parameters&quot;</span>, rendering_parameters));</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;};</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;</div><div class="line"><a name="l00153"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#a93f7464a6c6dee7b3885638014ec009a"> 153</a></span>&#160;cv::Mat <a class="code" href="namespaceeos_1_1fitting.html#a93f7464a6c6dee7b3885638014ec009a">to_mat</a>(<span class="keyword">const</span> glm::mat4x4&amp; glm_matrix)</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160;{</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; <span class="comment">// glm stores its matrices in col-major order in memory, OpenCV in row-major order.</span></div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <span class="comment">// Hence we transpose the glm matrix to flip the memory layout, and then point OpenCV</span></div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <span class="comment">// to that location.</span></div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <span class="keyword">auto</span> glm_matrix_t = glm::transpose(glm_matrix);</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; cv::Mat opencv_mat(4, 4, CV_32FC1, &amp;glm_matrix_t[0]);</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <span class="comment">// we need to clone because the underlying data of the original goes out of scope</span></div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <span class="keywordflow">return</span> opencv_mat.clone();</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;};</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160;</div><div class="line"><a name="l00182"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#a198aa8a0c4d90a51bb1b422cfc6a87c4"> 182</a></span>&#160;glm::mat4x4 <a class="code" href="namespaceeos_1_1fitting.html#a198aa8a0c4d90a51bb1b422cfc6a87c4">get_4x4_modelview_matrix</a>(<a class="code" href="structeos_1_1fitting_1_1_rendering_parameters.html">fitting::RenderingParameters</a> params)</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160;{</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <span class="comment">// rotation order: RPY * P</span></div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <span class="keyword">auto</span> rot_mtx_x = glm::rotate(glm::mat4(1.0f), params.r_x, glm::vec3{ 1.0f, 0.0f, 0.0f });</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <span class="keyword">auto</span> rot_mtx_y = glm::rotate(glm::mat4(1.0f), params.r_y, glm::vec3{ 0.0f, 1.0f, 0.0f });</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <span class="keyword">auto</span> rot_mtx_z = glm::rotate(glm::mat4(1.0f), params.r_z, glm::vec3{ 0.0f, 0.0f, 1.0f });</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; <span class="keyword">auto</span> t_mtx = glm::translate(glm::mat4(1.0f), glm::vec3{ params.t_x, params.t_y, 0.0f });</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="keyword">auto</span> modelview = t_mtx * rot_mtx_z * rot_mtx_x * rot_mtx_y;</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; <span class="keywordflow">return</span> modelview;</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160;};</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160;</div><div class="line"><a name="l00200"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#abebc061912b7ef0b180536b467e8dc6f"> 200</a></span>&#160;cv::Mat <a class="code" href="namespaceeos_1_1fitting.html#abebc061912b7ef0b180536b467e8dc6f">get_3x4_affine_camera_matrix</a>(<a class="code" href="structeos_1_1fitting_1_1_rendering_parameters.html">fitting::RenderingParameters</a> params, <span class="keywordtype">int</span> width, <span class="keywordtype">int</span> height)</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160;{</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <span class="keyword">auto</span> view_model = <a class="code" href="namespaceeos_1_1fitting.html#a93f7464a6c6dee7b3885638014ec009a">to_mat</a>(<a class="code" href="namespaceeos_1_1fitting.html#a198aa8a0c4d90a51bb1b422cfc6a87c4">get_4x4_modelview_matrix</a>(params));</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; <span class="keyword">auto</span> ortho_projection = <a class="code" href="namespaceeos_1_1fitting.html#a93f7464a6c6dee7b3885638014ec009a">to_mat</a>(glm::ortho(params.frustum.l, params.frustum.r, params.frustum.b, params.frustum.t));</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; cv::Mat mvp = ortho_projection * view_model;</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160;</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; glm::vec4 viewport(0, height, width, -height); <span class="comment">// flips y, origin top-left, like in OpenCV</span></div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; <span class="comment">// equivalent to what glm::project&#39;s viewport does, but we don&#39;t change z and w:</span></div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; cv::Mat viewport_mat = (cv::Mat_&lt;float&gt;(4, 4) &lt;&lt; viewport[2] / 2.0f, 0.0f, 0.0f, viewport[2] / 2.0f + viewport[0],</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; 0.0f, viewport[3] / 2.0f, 0.0f, viewport[3] / 2.0f + viewport[1],</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; 0.0f, 0.0f, 1.0f, 0.0f,</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; 0.0f, 0.0f, 0.0f, 1.0f);</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160;</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; cv::Mat full_projection_4x4 = viewport_mat * mvp;</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; cv::Mat full_projection_3x4 = full_projection_4x4.rowRange(0, 3); <span class="comment">// we take the first 3 rows, but then set the last one to [0 0 0 1]</span></div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; full_projection_3x4.at&lt;<span class="keywordtype">float</span>&gt;(2, 0) = 0.0f;</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; full_projection_3x4.at&lt;<span class="keywordtype">float</span>&gt;(2, 1) = 0.0f;</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; full_projection_3x4.at&lt;<span class="keywordtype">float</span>&gt;(2, 2) = 0.0f;</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; full_projection_3x4.at&lt;<span class="keywordtype">float</span>&gt;(2, 3) = 1.0f;</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160;</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; <span class="keywordflow">return</span> full_projection_3x4;</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160;};</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160;</div><div class="line"><a name="l00229"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#a4e713b5555396806a9b26817184eacd0"> 229</a></span>&#160;glm::vec4 <a class="code" href="namespaceeos_1_1fitting.html#a4e713b5555396806a9b26817184eacd0">get_opencv_viewport</a>(<span class="keywordtype">int</span> width, <span class="keywordtype">int</span> height)</div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160;{</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; <span class="keywordflow">return</span> glm::vec4(0, height, width, -height);</div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160;};</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160;</div><div class="line"><a name="l00259"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#a9f55324bfa740c6b5061518535506084"> 259</a></span>&#160;<a class="code" href="structeos_1_1fitting_1_1_rendering_parameters.html">RenderingParameters</a> <a class="code" href="namespaceeos_1_1fitting.html#a9f55324bfa740c6b5061518535506084">estimate_orthographic_camera</a>(std::vector&lt;cv::Vec2f&gt; image_points, std::vector&lt;cv::Vec4f&gt; model_points, <span class="keywordtype">int</span> width, <span class="keywordtype">int</span> height)</div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160;{</div><div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; <span class="keyword">using</span> cv::Mat;</div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; assert(image_points.size() == model_points.size());</div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; assert(image_points.size() &gt;= 6); <span class="comment">// Number of correspondence points given needs to be equal to or larger than 6</span></div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160;</div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> aspect = <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(width) / height;</div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160;</div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160; <span class="comment">// Set up the initial parameter vector and the cost function:</span></div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160; <span class="keywordtype">int</span> num_params = 6;</div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160; Eigen::VectorXd parameters; <span class="comment">// [rot_x_pitch, rot_y_yaw, rot_z_roll, t_x, t_y, frustum_scale]</span></div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; parameters.setConstant(num_params, 0.0); <span class="comment">// Set all 6 values to zero (except frustum_scale, see next line)</span></div><div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; parameters[5] = 110.0; <span class="comment">// This is just a rough hand-chosen scaling estimate - we could do a lot better. But it works.</span></div><div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; detail::OrthographicParameterProjection cost_function(image_points, model_points, width, height);</div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160;</div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; <span class="comment">// Note: we have analytical derivatives, so we should use them!</span></div><div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160; Eigen::NumericalDiff&lt;detail::OrthographicParameterProjection&gt; cost_function_with_derivative(cost_function, 0.0001);</div><div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; <span class="comment">// I had to change the default value of epsfcn, it works well around 0.0001. It couldn&#39;t produce the derivative with the default, I guess the changes in the gradient were too small.</span></div><div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160;</div><div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; Eigen::LevenbergMarquardt&lt;Eigen::NumericalDiff&lt;detail::OrthographicParameterProjection&gt;&gt; lm(cost_function_with_derivative);</div><div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160; <span class="keyword">auto</span> info = lm.minimize(parameters); <span class="comment">// we could or should use the return value</span></div><div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; <span class="comment">// &#39;parameters&#39; contains the solution now.</span></div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160;</div><div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; <a class="code" href="structeos_1_1fitting_1_1_frustum.html">Frustum</a> camera_frustum{ -1.0f * aspect * <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(parameters[5]), 1.0f * aspect * static_cast&lt;float&gt;(parameters[5]), -1.0f * <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(parameters[5]), 1.0f * static_cast&lt;float&gt;(parameters[5]) };</div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; <span class="keywordflow">return</span> <a class="code" href="structeos_1_1fitting_1_1_rendering_parameters.html">RenderingParameters</a>{ CameraType::Orthographic, camera_frustum, <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(parameters[0]), static_cast&lt;float&gt;(parameters[1]), <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(parameters[2]), static_cast&lt;float&gt;(parameters[3]), <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(parameters[4]), width, height };</div><div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160;};</div><div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160;</div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; } <span class="comment">/* namespace fitting */</span></div><div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160;} <span class="comment">/* namespace eos */</span></div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160;</div><div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* NONLINEARCAMERAESTIMATION_HPP_ */</span><span class="preprocessor"></span></div><div class="ttc" id="namespaceeos_1_1fitting_html_a93f7464a6c6dee7b3885638014ec009a"><div class="ttname"><a href="namespaceeos_1_1fitting.html#a93f7464a6c6dee7b3885638014ec009a">eos::fitting::to_mat</a></div><div class="ttdeci">cv::Mat to_mat(const glm::mat4x4 &amp;glm_matrix)</div><div class="ttdoc">Converts a glm::mat4x4 to a cv::Mat. </div><div class="ttdef"><b>Definition:</b> nonlinear_camera_estimation.hpp:153</div></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div> <div class="ttc" id="namespaceeos_1_1fitting_html_a9f55324bfa740c6b5061518535506084"><div class="ttname"><a href="namespaceeos_1_1fitting.html#a9f55324bfa740c6b5061518535506084">eos::fitting::estimate_orthographic_camera</a></div><div class="ttdeci">RenderingParameters estimate_orthographic_camera(std::vector&lt; cv::Vec2f &gt; image_points, std::vector&lt; cv::Vec4f &gt; model_points, int width, int height)</div><div class="ttdoc">This algorithm estimates the rotation angles and translation of the model, as well as the viewing fru...</div><div class="ttdef"><b>Definition:</b> nonlinear_camera_estimation.hpp:259</div></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div> <div class="ttc" id="namespaceeos_1_1fitting_html_a03b4bc35b0619e7f4bd0fccbb2d35e2c"><div class="ttname"><a href="namespaceeos_1_1fitting.html#a03b4bc35b0619e7f4bd0fccbb2d35e2c">eos::fitting::save_rendering_parameters</a></div><div class="ttdeci">void save_rendering_parameters(RenderingParameters rendering_parameters, std::string filename)</div><div class="ttdef"><b>Definition:</b> nonlinear_camera_estimation.hpp:138</div></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/fitting/nonlinear_camera_estimation.hpp</span></div> <div class="ttc" id="namespaceeos_1_1fitting_html_a4e713b5555396806a9b26817184eacd0"><div class="ttname"><a href="namespaceeos_1_1fitting.html#a4e713b5555396806a9b26817184eacd0">eos::fitting::get_opencv_viewport</a></div><div class="ttdeci">glm::vec4 get_opencv_viewport(int width, int height)</div><div class="ttdoc">Returns a glm/OpenGL compatible viewport vector that flips y and has the origin on the top-left...</div><div class="ttdef"><b>Definition:</b> nonlinear_camera_estimation.hpp:229</div></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div> <div class="ttc" id="namespaceeos_1_1fitting_html_abebc061912b7ef0b180536b467e8dc6f"><div class="ttname"><a href="namespaceeos_1_1fitting.html#abebc061912b7ef0b180536b467e8dc6f">eos::fitting::get_3x4_affine_camera_matrix</a></div><div class="ttdeci">cv::Mat get_3x4_affine_camera_matrix(fitting::RenderingParameters params, int width, int height)</div><div class="ttdoc">Creates a 3x4 affine camera matrix from given fitting parameters. The matrix transforms points direct...</div><div class="ttdef"><b>Definition:</b> nonlinear_camera_estimation.hpp:200</div></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2015 Patrik Huber</span></div> <div class="ttc" id="structeos_1_1fitting_1_1_frustum_html_ad2927fb97762ef726696cf6296b5b9d4"><div class="ttname"><a href="structeos_1_1fitting_1_1_frustum.html#ad2927fb97762ef726696cf6296b5b9d4">eos::fitting::Frustum::serialize</a></div><div class="ttdeci">void serialize(Archive &amp;archive)</div><div class="ttdef"><b>Definition:</b> nonlinear_camera_estimation.hpp:64</div></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div> <div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&amp;#39;s 3D model fitting functionality. </div></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div> <div class="ttc" id="structeos_1_1fitting_1_1_rendering_parameters_html"><div class="ttname"><a href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a></div><div class="ttdoc">Represents a set of estimated model parameters (rotation, translation) and camera parameters (viewing...</div><div class="ttdef"><b>Definition:</b> nonlinear_camera_estimation.hpp:102</div></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div> <div class="ttc" id="namespaceeos_1_1fitting_html_a63fce336daef96cde45f61701c4a3cf4"><div class="ttname"><a href="namespaceeos_1_1fitting.html#a63fce336daef96cde45f61701c4a3cf4">eos::fitting::CameraType</a></div><div class="ttdeci">CameraType</div><div class="ttdoc">Type of a camera (projection). </div><div class="ttdef"><b>Definition:</b> nonlinear_camera_estimation.hpp:75</div></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div> <div class="ttc" id="namespaceeos_1_1fitting_html_a198aa8a0c4d90a51bb1b422cfc6a87c4"><div class="ttname"><a href="namespaceeos_1_1fitting.html#a198aa8a0c4d90a51bb1b422cfc6a87c4">eos::fitting::get_4x4_modelview_matrix</a></div><div class="ttdeci">glm::mat4x4 get_4x4_modelview_matrix(fitting::RenderingParameters params)</div><div class="ttdoc">Creates a 4x4 model-view matrix from given fitting parameters. </div><div class="ttdef"><b>Definition:</b> nonlinear_camera_estimation.hpp:182</div></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div> <div class="ttc" id="structeos_1_1fitting_1_1_rendering_parameters_html_a5d9a13513843bc122a58ebae9801fada"><div class="ttname"><a href="structeos_1_1fitting_1_1_rendering_parameters.html#a5d9a13513843bc122a58ebae9801fada">eos::fitting::RenderingParameters::serialize</a></div><div class="ttdeci">void serialize(Archive &amp;archive)</div><div class="ttdef"><b>Definition:</b> nonlinear_camera_estimation.hpp:125</div></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div> <div class="ttc" id="structeos_1_1fitting_1_1_frustum_html"><div class="ttname"><a href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a></div><div class="ttdoc">A class representing a camera viewing frustum. At the moment used as orthographic camera only...</div><div class="ttdef"><b>Definition:</b> nonlinear_camera_estimation.hpp:50</div></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef NONLINEARCAMERAESTIMATION_HPP_</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define NONLINEARCAMERAESTIMATION_HPP_</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;eos/fitting/detail/nonlinear_camera_estimation_detail.hpp&quot;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;glm/gtc/matrix_transform.hpp&quot;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &quot;Eigen/Geometry&quot;</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &quot;unsupported/Eigen/NonLinearOptimization&quot;</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="preprocessor">#include &lt;cassert&gt;</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; <span class="keyword">namespace </span>fitting {</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;</div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="structeos_1_1fitting_1_1_frustum.html"> 44</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structeos_1_1fitting_1_1_frustum.html">Frustum</a></div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;{</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <span class="keywordtype">float</span> l, r, b, t;</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <span class="comment">// optional&lt;float&gt; n, f;</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;};</div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;</div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html"> 67</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">OrthographicRenderingParameters</a></div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;{</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="keywordtype">float</span> r_x; <span class="comment">// Pitch.</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="keywordtype">float</span> r_y; <span class="comment">// Yaw. Positive means subject is looking left (we see her right cheek).</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="keywordtype">float</span> r_z; <span class="comment">// Roll. Positive means the subject&#39;s right eye is further down than the other one (he tilts his head to the right).</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="keywordtype">float</span> t_x;</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keywordtype">float</span> t_y;</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <a class="code" href="structeos_1_1fitting_1_1_frustum.html">Frustum</a> frustum;</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;};</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;</div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#a93f7464a6c6dee7b3885638014ec009a"> 82</a></span>&#160;cv::Mat <a class="code" href="namespaceeos_1_1fitting.html#a93f7464a6c6dee7b3885638014ec009a">to_mat</a>(<span class="keyword">const</span> glm::mat4x4&amp; glm_matrix)</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;{</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="comment">// glm stores its matrices in col-major order in memory, OpenCV in row-major order.</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="comment">// Hence we transpose the glm matrix to flip the memory layout, and then point OpenCV</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="comment">// to that location.</span></div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="keyword">auto</span> glm_matrix_t = glm::transpose(glm_matrix);</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; cv::Mat opencv_mat(4, 4, CV_32FC1, &amp;glm_matrix_t[0]);</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="comment">// we need to clone because the underlying data of the original goes out of scope</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="keywordflow">return</span> opencv_mat.clone();</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160;};</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;</div>
<div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#a503a126cfe1bbd6a7c8b7a786a8e73b8"> 111</a></span>&#160;glm::mat4x4 <a class="code" href="namespaceeos_1_1fitting.html#a503a126cfe1bbd6a7c8b7a786a8e73b8">get_4x4_modelview_matrix</a>(<a class="code" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">fitting::OrthographicRenderingParameters</a> params)</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;{</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="comment">// rotation order: RPY * P</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <span class="keyword">auto</span> rot_mtx_x = glm::rotate(glm::mat4(1.0f), params.r_x, glm::vec3{ 1.0f, 0.0f, 0.0f });</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keyword">auto</span> rot_mtx_y = glm::rotate(glm::mat4(1.0f), params.r_y, glm::vec3{ 0.0f, 1.0f, 0.0f });</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="keyword">auto</span> rot_mtx_z = glm::rotate(glm::mat4(1.0f), params.r_z, glm::vec3{ 0.0f, 0.0f, 1.0f });</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="keyword">auto</span> t_mtx = glm::translate(glm::mat4(1.0f), glm::vec3{ params.t_x, params.t_y, 0.0f });</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="keyword">auto</span> modelview = t_mtx * rot_mtx_z * rot_mtx_x * rot_mtx_y;</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="keywordflow">return</span> modelview;</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;};</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;</div>
<div class="line"><a name="l00129"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#af600978a071bc5dc0443cfe41ae613bf"> 129</a></span>&#160;cv::Mat <a class="code" href="namespaceeos_1_1fitting.html#af600978a071bc5dc0443cfe41ae613bf">get_3x4_affine_camera_matrix</a>(<a class="code" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">fitting::OrthographicRenderingParameters</a> params, <span class="keywordtype">int</span> width, <span class="keywordtype">int</span> height)</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;{</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="keyword">auto</span> view_model = <a class="code" href="namespaceeos_1_1fitting.html#a93f7464a6c6dee7b3885638014ec009a">to_mat</a>(<a class="code" href="namespaceeos_1_1fitting.html#a503a126cfe1bbd6a7c8b7a786a8e73b8">get_4x4_modelview_matrix</a>(params));</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="keyword">auto</span> ortho_projection = <a class="code" href="namespaceeos_1_1fitting.html#a93f7464a6c6dee7b3885638014ec009a">to_mat</a>(glm::ortho(params.frustum.l, params.frustum.r, params.frustum.b, params.frustum.t));</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; cv::Mat mvp = ortho_projection * view_model;</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; glm::vec4 viewport(0, height, width, -height); <span class="comment">// flips y, origin top-left, like in OpenCV</span></div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <span class="comment">// equivalent to what glm::project&#39;s viewport does, but we don&#39;t change z and w:</span></div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; cv::Mat viewport_mat = (cv::Mat_&lt;float&gt;(4, 4) &lt;&lt; viewport[2] / 2.0f, 0.0f, 0.0f, viewport[2] / 2.0f + viewport[0],</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; 0.0f, viewport[3] / 2.0f, 0.0f, viewport[3] / 2.0f + viewport[1],</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; 0.0f, 0.0f, 1.0f, 0.0f,</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; 0.0f, 0.0f, 0.0f, 1.0f);</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; cv::Mat full_projection_4x4 = viewport_mat * mvp;</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; cv::Mat full_projection_3x4 = full_projection_4x4.rowRange(0, 3); <span class="comment">// we take the first 3 rows, but then set the last one to [0 0 0 1]</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; full_projection_3x4.at&lt;<span class="keywordtype">float</span>&gt;(2, 0) = 0.0f;</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; full_projection_3x4.at&lt;<span class="keywordtype">float</span>&gt;(2, 1) = 0.0f;</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; full_projection_3x4.at&lt;<span class="keywordtype">float</span>&gt;(2, 2) = 0.0f;</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; full_projection_3x4.at&lt;<span class="keywordtype">float</span>&gt;(2, 3) = 1.0f;</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; <span class="keywordflow">return</span> full_projection_3x4;</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160;};</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;</div>
<div class="line"><a name="l00158"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#a4e713b5555396806a9b26817184eacd0"> 158</a></span>&#160;glm::vec4 <a class="code" href="namespaceeos_1_1fitting.html#a4e713b5555396806a9b26817184eacd0">get_opencv_viewport</a>(<span class="keywordtype">int</span> width, <span class="keywordtype">int</span> height)</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;{</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <span class="keywordflow">return</span> glm::vec4(0, height, width, -height);</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;};</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;</div>
<div class="line"><a name="l00188"></a><span class="lineno"><a class="line" href="namespaceeos_1_1fitting.html#aebab65b3f9f46758b1363a347e6de852"> 188</a></span>&#160;<a class="code" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">OrthographicRenderingParameters</a> <a class="code" href="namespaceeos_1_1fitting.html#aebab65b3f9f46758b1363a347e6de852">estimate_orthographic_camera</a>(std::vector&lt;cv::Vec2f&gt; image_points, std::vector&lt;cv::Vec4f&gt; model_points, <span class="keywordtype">int</span> width, <span class="keywordtype">int</span> height)</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160;{</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; <span class="keyword">using</span> cv::Mat;</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; assert(image_points.size() == model_points.size());</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; assert(image_points.size() &gt;= 6); <span class="comment">// Number of correspondence points given needs to be equal to or larger than 6</span></div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160;</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> aspect = <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(width) / height;</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160;</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; <span class="comment">// Set up the initial parameter vector and the cost function:</span></div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; <span class="keywordtype">int</span> num_params = 6;</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; Eigen::VectorXd parameters; <span class="comment">// [rot_x_pitch, rot_y_yaw, rot_z_roll, t_x, t_y, frustum_scale]</span></div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; parameters.setConstant(num_params, 0.0); <span class="comment">// Set all 6 values to zero (except frustum_scale, see next line)</span></div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; parameters[5] = 110.0; <span class="comment">// This is just a rough hand-chosen scaling estimate - we could do a lot better. But it works.</span></div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; detail::OrthographicParameterProjection cost_function(image_points, model_points, width, height);</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160;</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; <span class="comment">// Note: we have analytical derivatives, so we should use them!</span></div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; Eigen::NumericalDiff&lt;detail::OrthographicParameterProjection&gt; cost_function_with_derivative(cost_function, 0.0001);</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <span class="comment">// I had to change the default value of epsfcn, it works well around 0.0001. It couldn&#39;t produce the derivative with the default, I guess the changes in the gradient were too small.</span></div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160;</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; Eigen::LevenbergMarquardt&lt;Eigen::NumericalDiff&lt;detail::OrthographicParameterProjection&gt;&gt; lm(cost_function_with_derivative);</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; <span class="keyword">auto</span> info = lm.minimize(parameters); <span class="comment">// we could or should use the return value</span></div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; <span class="comment">// &#39;parameters&#39; contains the solution now.</span></div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160;</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; <a class="code" href="structeos_1_1fitting_1_1_frustum.html">Frustum</a> camera_frustum{ -1.0f * aspect * <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(parameters[5]), 1.0f * aspect * static_cast&lt;float&gt;(parameters[5]), -1.0f * <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(parameters[5]), 1.0f * static_cast&lt;float&gt;(parameters[5]) };</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; <span class="keywordflow">return</span> <a class="code" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">OrthographicRenderingParameters</a>{ <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(parameters[0]), static_cast&lt;float&gt;(parameters[1]), <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(parameters[2]), static_cast&lt;float&gt;(parameters[3]), <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(parameters[4]), camera_frustum };</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160;};</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160;</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; } <span class="comment">/* namespace fitting */</span></div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160;} <span class="comment">/* namespace eos */</span></div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160;</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* NONLINEARCAMERAESTIMATION_HPP_ */</span><span class="preprocessor"></span></div>
<div class="ttc" id="namespaceeos_1_1fitting_html_a93f7464a6c6dee7b3885638014ec009a"><div class="ttname"><a href="namespaceeos_1_1fitting.html#a93f7464a6c6dee7b3885638014ec009a">eos::fitting::to_mat</a></div><div class="ttdeci">cv::Mat to_mat(const glm::mat4x4 &amp;glm_matrix)</div><div class="ttdoc">Converts a glm::mat4x4 to a cv::Mat. </div><div class="ttdef"><b>Definition:</b> nonlinear_camera_estimation.hpp:82</div></div>
<div class="ttc" id="namespaceeos_1_1fitting_html_a4e713b5555396806a9b26817184eacd0"><div class="ttname"><a href="namespaceeos_1_1fitting.html#a4e713b5555396806a9b26817184eacd0">eos::fitting::get_opencv_viewport</a></div><div class="ttdeci">glm::vec4 get_opencv_viewport(int width, int height)</div><div class="ttdoc">Returns a glm/OpenGL compatible viewport vector that flips y and has the origin on the top-left...</div><div class="ttdef"><b>Definition:</b> nonlinear_camera_estimation.hpp:158</div></div>
<div class="ttc" id="namespaceeos_1_1fitting_html_aebab65b3f9f46758b1363a347e6de852"><div class="ttname"><a href="namespaceeos_1_1fitting.html#aebab65b3f9f46758b1363a347e6de852">eos::fitting::estimate_orthographic_camera</a></div><div class="ttdeci">OrthographicRenderingParameters estimate_orthographic_camera(std::vector&lt; cv::Vec2f &gt; image_points, std::vector&lt; cv::Vec4f &gt; model_points, int width, int height)</div><div class="ttdoc">This algorithm estimates the rotation angles and translation of the model, as well as the viewing fru...</div><div class="ttdef"><b>Definition:</b> nonlinear_camera_estimation.hpp:188</div></div>
<div class="ttc" id="namespaceeos_1_1fitting_html_a503a126cfe1bbd6a7c8b7a786a8e73b8"><div class="ttname"><a href="namespaceeos_1_1fitting.html#a503a126cfe1bbd6a7c8b7a786a8e73b8">eos::fitting::get_4x4_modelview_matrix</a></div><div class="ttdeci">glm::mat4x4 get_4x4_modelview_matrix(fitting::OrthographicRenderingParameters params)</div><div class="ttdoc">Creates a 4x4 model-view matrix from given fitting parameters. </div><div class="ttdef"><b>Definition:</b> nonlinear_camera_estimation.hpp:111</div></div>
<div class="ttc" id="namespaceeos_1_1fitting_html_af600978a071bc5dc0443cfe41ae613bf"><div class="ttname"><a href="namespaceeos_1_1fitting.html#af600978a071bc5dc0443cfe41ae613bf">eos::fitting::get_3x4_affine_camera_matrix</a></div><div class="ttdeci">cv::Mat get_3x4_affine_camera_matrix(fitting::OrthographicRenderingParameters params, int width, int height)</div><div class="ttdoc">Creates a 3x4 affine camera matrix from given fitting parameters. The matrix transforms points direct...</div><div class="ttdef"><b>Definition:</b> nonlinear_camera_estimation.hpp:129</div></div>
<div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&#39;s 3D model fitting functionality. </div></div>
<div class="ttc" id="structeos_1_1fitting_1_1_orthographic_rendering_parameters_html"><div class="ttname"><a href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">eos::fitting::OrthographicRenderingParameters</a></div><div class="ttdoc">Represents a set of estimated model parameters (rotation, translation) and camera parameters (viewing...</div><div class="ttdef"><b>Definition:</b> nonlinear_camera_estimation.hpp:67</div></div>
<div class="ttc" id="structeos_1_1fitting_1_1_frustum_html"><div class="ttname"><a href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a></div><div class="ttdoc">A class representing a camera viewing frustum. At the moment used as orthographic camera only...</div><div class="ttdef"><b>Definition:</b> nonlinear_camera_estimation.hpp:44</div></div>
</div><!-- fragment --></div><!-- contents --> </div><!-- fragment --></div><!-- contents -->
<!-- start footer part --> <!-- start footer part -->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/render/render.hpp Source File</title> <title>eos: include/eos/render/render.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div id="nav-path" class="navpath"> <div id="nav-path" class="navpath">
<ul> <ul>
<li class="navelem"><a class="el" href="dir_ce53d3124a8ddb93985ce6ec479297f4.html">include</a></li><li class="navelem"><a class="el" href="dir_c7ebde285fcef06dba0b090642612638.html">eos</a></li><li class="navelem"><a class="el" href="dir_fab380b22e1724065a4c65606be96940.html">render</a></li> </ul> <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_9294a830dcc230dfe8b5c804d7e8b91a.html">render</a></li> </ul>
</div> </div>
</div><!-- top --> </div><!-- top -->
<div class="header"> <div class="header">
...@@ -95,180 +95,19 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -95,180 +95,19 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="title">render.hpp</div> </div> <div class="title">render.hpp</div> </div>
</div><!--header--> </div><!--header-->
<div class="contents"> <div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div> <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/render/render.hpp</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2014, 2015 Patrik Huber</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef RENDER_HPP_</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define RENDER_HPP_</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;eos/render/detail/render_detail.hpp&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &quot;eos/render/utils.hpp&quot;</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &quot;boost/optional.hpp&quot;</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#include &lt;array&gt;</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor">#include &lt;memory&gt;</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; <span class="keyword">namespace </span><a class="code" href="namespaceeos_1_1render.html#a097a630659b6c06a4596ca138f66ec94">render</a> {</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;</div><div class="line"><a name="l00125"></a><span class="lineno"><a class="line" href="namespaceeos_1_1render.html#a097a630659b6c06a4596ca138f66ec94"> 125</a></span>&#160;std::pair&lt;cv::Mat, cv::Mat&gt; <a class="code" href="namespaceeos_1_1render.html#a097a630659b6c06a4596ca138f66ec94">render</a>(<a class="code" href="structeos_1_1render_1_1_mesh.html">Mesh</a> mesh, cv::Mat model_view_matrix, cv::Mat projection_matrix, <span class="keywordtype">int</span> viewport_width, <span class="keywordtype">int</span> viewport_height, <span class="keyword">const</span> boost::optional&lt;Texture&gt;&amp; texture = boost::none, <span class="keywordtype">bool</span> enable_backface_culling = <span class="keyword">false</span>, <span class="keywordtype">bool</span> enable_near_clipping = <span class="keyword">true</span>, <span class="keywordtype">bool</span> enable_far_clipping = <span class="keyword">true</span>)</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;{</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <span class="comment">// Some internal documentation / old todos or notes:</span></div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="comment">// maybe change and pass depthBuffer as an optional arg (&amp;?), because usually we never need it outside the renderer. Or maybe even a getDepthBuffer().</span></div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <span class="comment">// modelViewMatrix goes to eye-space (camera space), projection does ortho or perspective proj.</span></div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="comment">// bool enable_texturing = false; Maybe re-add later, not sure</span></div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="comment">// take a cv::Mat texture instead and convert to Texture internally? no, we don&#39;t want to recreate mipmap levels on each render() call.</span></div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; assert(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size() == mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.size() || mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.empty()); <span class="comment">// The number of vertices has to be equal for both shape and colour, or, alternatively, it has to be a shape-only model.</span></div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; assert(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size() == mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>.size() || mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>.empty()); <span class="comment">// same for the texcoords</span></div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="comment">// another assert: If cv::Mat texture != empty, then we need texcoords?</span></div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <span class="keyword">using</span> cv::Mat;</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; <span class="keyword">using</span> std::vector;</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; Mat colourbuffer = Mat::zeros(viewport_height, viewport_width, CV_8UC4); <span class="comment">// make sure it&#39;s CV_8UC4?</span></div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; Mat depthbuffer = std::numeric_limits&lt;float&gt;::max() * Mat::ones(viewport_height, viewport_width, CV_64FC1);</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="comment">// Vertex shader:</span></div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <span class="comment">//processedVertex = shade(Vertex); // processedVertex : pos, col, tex, texweight</span></div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <span class="comment">// Assemble the vertices, project to clip space, and store as detail::Vertex (the internal representation):</span></div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; vector&lt;detail::Vertex&gt; clipspace_vertices;</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; clipspace_vertices.reserve(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size());</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size(); ++i) { <span class="comment">// &quot;previously&quot;: mesh.vertex</span></div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; Mat clipspace_coords = projection_matrix * model_view_matrix * Mat(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i]);</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; cv::Vec3f vertex_colour;</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <span class="keywordflow">if</span> (mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.empty()) {</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; vertex_colour = cv::Vec3f(0.5f, 0.5f, 0.5f);</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; }</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <span class="keywordflow">else</span> {</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; vertex_colour = mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>[i];</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; }</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; clipspace_vertices.push_back(detail::Vertex(clipspace_coords, vertex_colour, mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[i]));</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; }</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <span class="comment">// All vertices are in clip-space now.</span></div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <span class="comment">// Prepare the rasterisation stage.</span></div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; <span class="comment">// For every vertex/tri:</span></div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; vector&lt;detail::TriangleToRasterize&gt; triangles_to_raster;</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; tri_indices : mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">tvi</a>) {</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <span class="comment">// Todo: Split this whole stuff up. Make a &quot;clip&quot; function, ... rename &quot;processProspective..&quot;.. what is &quot;process&quot;... get rid of &quot;continue;&quot;-stuff by moving stuff inside process...</span></div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; <span class="comment">// classify vertices visibility with respect to the planes of the view frustum</span></div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <span class="comment">// we&#39;re in clip-coords (NDC), so just check if outside [-1, 1] x ...</span></div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; <span class="comment">// Actually we&#39;re in clip-coords and it&#39;s not the same as NDC. We&#39;re only in NDC after the division by w.</span></div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <span class="comment">// We should do the clipping in clip-coords though. See http://www.songho.ca/opengl/gl_projectionmatrix.html for more details.</span></div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <span class="comment">// However, when comparing against w_c below, we might run into the trouble of the sign again in the affine case.</span></div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <span class="comment">// &#39;w&#39; is always positive, as it is -z_camspace, and all z_camspace are negative.</span></div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> visibility_bits[3];</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> k = 0; k &lt; 3; k++)</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; {</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; visibility_bits[k] = 0;</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="keywordtype">float</span> x_cc = clipspace_vertices[tri_indices[k]].position[0];</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <span class="keywordtype">float</span> y_cc = clipspace_vertices[tri_indices[k]].position[1];</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; <span class="keywordtype">float</span> z_cc = clipspace_vertices[tri_indices[k]].position[2];</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="keywordtype">float</span> w_cc = clipspace_vertices[tri_indices[k]].position[3];</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <span class="keywordflow">if</span> (x_cc &lt; -w_cc) <span class="comment">// true if outside of view frustum. False if on or inside the plane.</span></div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; visibility_bits[k] |= 1; <span class="comment">// set bit if outside of frustum</span></div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; <span class="keywordflow">if</span> (x_cc &gt; w_cc)</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; visibility_bits[k] |= 2;</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <span class="keywordflow">if</span> (y_cc &lt; -w_cc)</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; visibility_bits[k] |= 4;</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <span class="keywordflow">if</span> (y_cc &gt; w_cc)</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; visibility_bits[k] |= 8;</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; <span class="keywordflow">if</span> (enable_near_clipping &amp;&amp; z_cc &lt; -w_cc) <span class="comment">// near plane frustum clipping</span></div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; visibility_bits[k] |= 16;</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; <span class="keywordflow">if</span> (enable_far_clipping &amp;&amp; z_cc &gt; w_cc) <span class="comment">// far plane frustum clipping</span></div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; visibility_bits[k] |= 32;</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; } <span class="comment">// if all bits are 0, then it&#39;s inside the frustum</span></div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; <span class="comment">// all vertices are not visible - reject the triangle.</span></div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; <span class="keywordflow">if</span> ((visibility_bits[0] &amp; visibility_bits[1] &amp; visibility_bits[2]) &gt; 0)</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; {</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; }</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; <span class="comment">// all vertices are visible - pass the whole triangle to the rasterizer. = All bits of all 3 triangles are 0.</span></div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; <span class="keywordflow">if</span> ((visibility_bits[0] | visibility_bits[1] | visibility_bits[2]) == 0)</div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; {</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; boost::optional&lt;detail::TriangleToRasterize&gt; t = detail::process_prospective_tri(clipspace_vertices[tri_indices[0]], clipspace_vertices[tri_indices[1]], clipspace_vertices[tri_indices[2]], viewport_width, viewport_height, enable_backface_culling);</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <span class="keywordflow">if</span> (t) {</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; triangles_to_raster.push_back(*t);</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; }</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; }</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; <span class="comment">// at this moment the triangle is known to be intersecting one of the view frustum&#39;s planes</span></div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; std::vector&lt;detail::Vertex&gt; vertices;</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; vertices.push_back(clipspace_vertices[tri_indices[0]]);</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; vertices.push_back(clipspace_vertices[tri_indices[1]]);</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; vertices.push_back(clipspace_vertices[tri_indices[2]]);</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; <span class="comment">// split the triangle if it intersects the near plane:</span></div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; <span class="keywordflow">if</span> (enable_near_clipping)</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; {</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; vertices = detail::clip_polygon_to_plane_in_4d(vertices, cv::Vec4f(0.0f, 0.0f, -1.0f, -1.0f)); <span class="comment">// &quot;Normal&quot; (or &quot;4D hyperplane&quot;) of the near-plane. I tested it and it works like this but I&#39;m a little bit unsure because Songho says the normal of the near-plane is (0,0,-1,1) (maybe I have to switch around the &lt; 0 checks in the function?)</span></div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; }</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160;</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; <span class="comment">// triangulation of the polygon formed of vertices array</span></div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; <span class="keywordflow">if</span> (vertices.size() &gt;= 3)</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; {</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> k = 0; k &lt; vertices.size() - 2; k++)</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; {</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; boost::optional&lt;detail::TriangleToRasterize&gt; t = detail::process_prospective_tri(vertices[0], vertices[1 + k], vertices[2 + k], viewport_width, viewport_height, enable_backface_culling);</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; <span class="keywordflow">if</span> (t) {</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; triangles_to_raster.push_back(*t);</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; }</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; }</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; }</div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; }</div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160;</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; <span class="comment">// Fragment/pixel shader: Colour the pixel values</span></div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; tri : triangles_to_raster) {</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; detail::raster_triangle(tri, colourbuffer, depthbuffer, texture, enable_far_clipping);</div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; }</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; <span class="keywordflow">return</span> std::make_pair(colourbuffer, depthbuffer);</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160;};</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160;</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; } <span class="comment">/* namespace render */</span></div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160;} <span class="comment">/* namespace eos */</span></div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160;</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* RENDER_HPP_ */</span><span class="preprocessor"></span></div><div class="ttc" id="namespaceeos_1_1render_html_a097a630659b6c06a4596ca138f66ec94"><div class="ttname"><a href="namespaceeos_1_1render.html#a097a630659b6c06a4596ca138f66ec94">eos::render::render</a></div><div class="ttdeci">std::pair&lt; cv::Mat, cv::Mat &gt; render(Mesh mesh, cv::Mat model_view_matrix, cv::Mat projection_matrix, int viewport_width, int viewport_height, const boost::optional&lt; Texture &gt; &amp;texture=boost::none, bool enable_backface_culling=false, bool enable_near_clipping=true, bool enable_far_clipping=true)</div><div class="ttdef"><b>Definition:</b> render.hpp:125</div></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div> <div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&amp;#39;s 3D model fitting functionality. </div></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html_a305d17e6453f6be320331e00e8c8816e"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">eos::render::Mesh::vertices</a></div><div class="ttdeci">std::vector&lt; cv::Vec4f &gt; vertices</div><div class="ttdoc">3D vertex positions. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:47</div></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/render/render.hpp</span></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html_ae3b0e946a77b4f434b382b315ea7c24b"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">eos::render::Mesh::colors</a></div><div class="ttdeci">std::vector&lt; cv::Vec3f &gt; colors</div><div class="ttdoc">Colour information for each vertex. Expected to be in RGB order. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:48</div></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html">eos::render::Mesh</a></div><div class="ttdoc">This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordin...</div><div class="ttdef"><b>Definition:</b> Mesh.hpp:45</div></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2014, 2015 Patrik Huber</span></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html_ab6fb80c460656bf7830a526f0692681b"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">eos::render::Mesh::tvi</a></div><div class="ttdeci">std::vector&lt; std::array&lt; int, 3 &gt; &gt; tvi</div><div class="ttdoc">Triangle vertex indices. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:51</div></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html_a64fddf0a7200e7f66b0426773542eea4"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">eos::render::Mesh::texcoords</a></div><div class="ttdeci">std::vector&lt; cv::Vec2f &gt; texcoords</div><div class="ttdoc">Texture coordinates for each vertex. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:49</div></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef RENDER_HPP_</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define RENDER_HPP_</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;eos/render/detail/render_detail.hpp&quot;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &quot;eos/render/utils.hpp&quot;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#ifdef WIN32</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor"> #define BOOST_ALL_DYN_LINK // Link against the dynamic boost lib. Seems to be necessary because we use /MD, i.e. link to the dynamic CRT.</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor"> #define BOOST_ALL_NO_LIB // Don&#39;t use the automatic library linking by boost with VS2010 (#pragma ...). Instead, we specify everything in cmake.</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor">#include &quot;boost/optional.hpp&quot;</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="preprocessor">#include &lt;array&gt;</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="preprocessor">#include &lt;memory&gt;</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <span class="keyword">namespace </span><a class="code" href="namespaceeos_1_1render.html#a7628a42875570658bea6ffb4f46723e5">render</a> {</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;</div>
<div class="line"><a name="l00129"></a><span class="lineno"><a class="line" href="namespaceeos_1_1render.html#a7628a42875570658bea6ffb4f46723e5"> 129</a></span>&#160;std::pair&lt;cv::Mat, cv::Mat&gt; <a class="code" href="namespaceeos_1_1render.html#a7628a42875570658bea6ffb4f46723e5">render</a>(<a class="code" href="structeos_1_1render_1_1_mesh.html">Mesh</a> mesh, cv::Mat model_view_matrix, cv::Mat projection_matrix, <span class="keywordtype">int</span> viewport_width, <span class="keywordtype">int</span> viewport_height, <span class="keyword">const</span> <a class="code" href="classeos_1_1render_1_1_texture.html">Texture</a>&amp; texture, <span class="keywordtype">bool</span> enable_backface_culling = <span class="keyword">false</span>, <span class="keywordtype">bool</span> enable_near_clipping = <span class="keyword">true</span>, <span class="keywordtype">bool</span> enable_far_clipping = <span class="keyword">true</span>)</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;{</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="comment">// Some internal documentation / old todos or notes:</span></div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="comment">// maybe change and pass depthBuffer as an optional arg (&amp;?), because usually we never need it outside the renderer. Or maybe even a getDepthBuffer().</span></div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="comment">// modelViewMatrix goes to eye-space (camera space), projection does ortho or perspective proj.</span></div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <span class="comment">// bool enable_texturing = false; Maybe re-add later, not sure</span></div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="comment">// take a cv::Mat texture instead and convert to Texture internally? no, we don&#39;t want to recreate mipmap levels on each render() call.</span></div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; assert(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size() == mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.size() || mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.empty()); <span class="comment">// The number of vertices has to be equal for both shape and colour, or, alternatively, it has to be a shape-only model.</span></div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; assert(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size() == mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>.size() || mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>.empty()); <span class="comment">// same for the texcoords</span></div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; <span class="comment">// another assert: If cv::Mat texture != empty, then we need texcoords?</span></div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <span class="keyword">using</span> cv::Mat;</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <span class="keyword">using</span> std::vector;</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; Mat colourbuffer = Mat::zeros(viewport_height, viewport_width, CV_8UC4); <span class="comment">// make sure it&#39;s CV_8UC4?</span></div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; Mat depthbuffer = std::numeric_limits&lt;float&gt;::max() * Mat::ones(viewport_height, viewport_width, CV_64FC1);</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="comment">// Vertex shader:</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <span class="comment">//processedVertex = shade(Vertex); // processedVertex : pos, col, tex, texweight</span></div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; <span class="comment">// Assemble the vertices, project to clip space, and store as detail::Vertex (the internal representation):</span></div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; vector&lt;detail::Vertex&gt; clipspace_vertices;</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; clipspace_vertices.reserve(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size());</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size(); ++i) { <span class="comment">// &quot;previously&quot;: mesh.vertex</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; Mat clipspace_coords = projection_matrix * model_view_matrix * Mat(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i]);</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; cv::Vec3f vertex_colour;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; <span class="keywordflow">if</span> (mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.empty()) {</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; vertex_colour = cv::Vec3f(0.5f, 0.5f, 0.5f);</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; }</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; vertex_colour = mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>[i];</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; }</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; clipspace_vertices.push_back(detail::Vertex(clipspace_coords, vertex_colour, mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[i]));</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; }</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160;</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <span class="comment">// All vertices are in clip-space now.</span></div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <span class="comment">// Prepare the rasterisation stage.</span></div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; <span class="comment">// For every vertex/tri:</span></div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; vector&lt;detail::TriangleToRasterize&gt; triangles_to_raster;</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; tri_indices : mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">tvi</a>) {</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <span class="comment">// Todo: Split this whole stuff up. Make a &quot;clip&quot; function, ... rename &quot;processProspective..&quot;.. what is &quot;process&quot;... get rid of &quot;continue;&quot;-stuff by moving stuff inside process...</span></div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <span class="comment">// classify vertices visibility with respect to the planes of the view frustum</span></div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <span class="comment">// we&#39;re in clip-coords (NDC), so just check if outside [-1, 1] x ...</span></div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; <span class="comment">// Actually we&#39;re in clip-coords and it&#39;s not the same as NDC. We&#39;re only in NDC after the division by w.</span></div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <span class="comment">// We should do the clipping in clip-coords though. See http://www.songho.ca/opengl/gl_projectionmatrix.html for more details.</span></div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <span class="comment">// However, when comparing against w_c below, we might run into the trouble of the sign again in the affine case.</span></div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="comment">// &#39;w&#39; is always positive, as it is -z_camspace, and all z_camspace are negative.</span></div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> visibility_bits[3];</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> k = 0; k &lt; 3; k++)</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; {</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; visibility_bits[k] = 0;</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <span class="keywordtype">float</span> x_cc = clipspace_vertices[tri_indices[k]].position[0];</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="keywordtype">float</span> y_cc = clipspace_vertices[tri_indices[k]].position[1];</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; <span class="keywordtype">float</span> z_cc = clipspace_vertices[tri_indices[k]].position[2];</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="keywordtype">float</span> w_cc = clipspace_vertices[tri_indices[k]].position[3];</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <span class="keywordflow">if</span> (x_cc &lt; -w_cc) <span class="comment">// true if outside of view frustum. False if on or inside the plane.</span></div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; visibility_bits[k] |= 1; <span class="comment">// set bit if outside of frustum</span></div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <span class="keywordflow">if</span> (x_cc &gt; w_cc)</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; visibility_bits[k] |= 2;</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; <span class="keywordflow">if</span> (y_cc &lt; -w_cc)</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; visibility_bits[k] |= 4;</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; <span class="keywordflow">if</span> (y_cc &gt; w_cc)</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; visibility_bits[k] |= 8;</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <span class="keywordflow">if</span> (enable_near_clipping &amp;&amp; z_cc &lt; -w_cc) <span class="comment">// near plane frustum clipping</span></div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; visibility_bits[k] |= 16;</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; <span class="keywordflow">if</span> (enable_far_clipping &amp;&amp; z_cc &gt; w_cc) <span class="comment">// far plane frustum clipping</span></div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; visibility_bits[k] |= 32;</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; } <span class="comment">// if all bits are 0, then it&#39;s inside the frustum</span></div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; <span class="comment">// all vertices are not visible - reject the triangle.</span></div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; <span class="keywordflow">if</span> ((visibility_bits[0] &amp; visibility_bits[1] &amp; visibility_bits[2]) &gt; 0)</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; {</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; }</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <span class="comment">// all vertices are visible - pass the whole triangle to the rasterizer. = All bits of all 3 triangles are 0.</span></div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; <span class="keywordflow">if</span> ((visibility_bits[0] | visibility_bits[1] | visibility_bits[2]) == 0)</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; {</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; boost::optional&lt;detail::TriangleToRasterize&gt; t = detail::process_prospective_tri(clipspace_vertices[tri_indices[0]], clipspace_vertices[tri_indices[1]], clipspace_vertices[tri_indices[2]], viewport_width, viewport_height, enable_backface_culling);</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; <span class="keywordflow">if</span> (t) {</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; triangles_to_raster.push_back(*t);</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; }</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; }</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; <span class="comment">// at this moment the triangle is known to be intersecting one of the view frustum&#39;s planes</span></div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; std::vector&lt;detail::Vertex&gt; vertices;</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; vertices.push_back(clipspace_vertices[tri_indices[0]]);</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; vertices.push_back(clipspace_vertices[tri_indices[1]]);</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; vertices.push_back(clipspace_vertices[tri_indices[2]]);</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; <span class="comment">// split the triangle if it intersects the near plane:</span></div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; <span class="keywordflow">if</span> (enable_near_clipping)</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; {</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; vertices = detail::clip_polygon_to_plane_in_4d(vertices, cv::Vec4f(0.0f, 0.0f, -1.0f, -1.0f)); <span class="comment">// &quot;Normal&quot; (or &quot;4D hyperplane&quot;) of the near-plane. I tested it and it works like this but I&#39;m a little bit unsure because Songho says the normal of the near-plane is (0,0,-1,1) (maybe I have to switch around the &lt; 0 checks in the function?)</span></div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; }</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160;</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <span class="comment">// triangulation of the polygon formed of vertices array</span></div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; <span class="keywordflow">if</span> (vertices.size() &gt;= 3)</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; {</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> k = 0; k &lt; vertices.size() - 2; k++)</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; {</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; boost::optional&lt;detail::TriangleToRasterize&gt; t = detail::process_prospective_tri(vertices[0], vertices[1 + k], vertices[2 + k], viewport_width, viewport_height, enable_backface_culling);</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <span class="keywordflow">if</span> (t) {</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; triangles_to_raster.push_back(*t);</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; }</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; }</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; }</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; }</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160;</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; <span class="comment">// Fragment/pixel shader: Colour the pixel values</span></div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; <span class="comment">// for every tri:</span></div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; tri : triangles_to_raster) {</div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; detail::raster_triangle(tri, colourbuffer, depthbuffer, texture, enable_far_clipping);</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; }</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; <span class="keywordflow">return</span> std::make_pair(colourbuffer, depthbuffer);</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160;};</div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160;</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; } <span class="comment">/* namespace render */</span></div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160;} <span class="comment">/* namespace eos */</span></div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160;</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* RENDER_HPP_ */</span><span class="preprocessor"></span></div>
<div class="ttc" id="classeos_1_1render_1_1_texture_html"><div class="ttname"><a href="classeos_1_1render_1_1_texture.html">eos::render::Texture</a></div><div class="ttdef"><b>Definition:</b> utils.hpp:150</div></div>
<div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&#39;s 3D model fitting functionality. </div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html_a305d17e6453f6be320331e00e8c8816e"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">eos::render::Mesh::vertices</a></div><div class="ttdeci">std::vector&lt; cv::Vec4f &gt; vertices</div><div class="ttdoc">3D vertex positions. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:51</div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html_ae3b0e946a77b4f434b382b315ea7c24b"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">eos::render::Mesh::colors</a></div><div class="ttdeci">std::vector&lt; cv::Vec3f &gt; colors</div><div class="ttdoc">Colour information for each vertex. Expected to be in RGB order. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:52</div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html">eos::render::Mesh</a></div><div class="ttdoc">This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordin...</div><div class="ttdef"><b>Definition:</b> Mesh.hpp:49</div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html_ab6fb80c460656bf7830a526f0692681b"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">eos::render::Mesh::tvi</a></div><div class="ttdeci">std::vector&lt; std::array&lt; int, 3 &gt; &gt; tvi</div><div class="ttdoc">Triangle vertex indices. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:55</div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html_a64fddf0a7200e7f66b0426773542eea4"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">eos::render::Mesh::texcoords</a></div><div class="ttdeci">std::vector&lt; cv::Vec2f &gt; texcoords</div><div class="ttdoc">Texture coordinates for each vertex. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:53</div></div>
<div class="ttc" id="namespaceeos_1_1render_html_a7628a42875570658bea6ffb4f46723e5"><div class="ttname"><a href="namespaceeos_1_1render.html#a7628a42875570658bea6ffb4f46723e5">eos::render::render</a></div><div class="ttdeci">std::pair&lt; cv::Mat, cv::Mat &gt; render(Mesh mesh, cv::Mat model_view_matrix, cv::Mat projection_matrix, int viewport_width, int viewport_height, const Texture &amp;texture, bool enable_backface_culling=false, bool enable_near_clipping=true, bool enable_far_clipping=true)</div><div class="ttdef"><b>Definition:</b> render.hpp:129</div></div>
</div><!-- fragment --></div><!-- contents --> </div><!-- fragment --></div><!-- contents -->
<!-- start footer part --> <!-- start footer part -->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/render/render_affine.hpp Source File</title> <title>eos: include/eos/render/render_affine.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div id="nav-path" class="navpath"> <div id="nav-path" class="navpath">
<ul> <ul>
<li class="navelem"><a class="el" href="dir_ce53d3124a8ddb93985ce6ec479297f4.html">include</a></li><li class="navelem"><a class="el" href="dir_c7ebde285fcef06dba0b090642612638.html">eos</a></li><li class="navelem"><a class="el" href="dir_fab380b22e1724065a4c65606be96940.html">render</a></li> </ul> <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_9294a830dcc230dfe8b5c804d7e8b91a.html">render</a></li> </ul>
</div> </div>
</div><!-- top --> </div><!-- top -->
<div class="header"> <div class="header">
...@@ -95,125 +95,20 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -95,125 +95,20 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="title">render_affine.hpp</div> </div> <div class="title">render_affine.hpp</div> </div>
</div><!--header--> </div><!--header-->
<div class="contents"> <div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div> <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/render/render_affine.hpp</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2014, 2015 Patrik Huber</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef RENDER_AFFINE_HPP_</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define RENDER_AFFINE_HPP_</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;eos/render/detail/render_detail.hpp&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &quot;eos/render/detail/render_affine_detail.hpp&quot;</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;eos/render/Mesh.hpp&quot;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &lt;utility&gt;</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; <span class="keyword">namespace </span><a class="code" href="namespaceeos_1_1render.html#a097a630659b6c06a4596ca138f66ec94">render</a> {</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;</div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="namespaceeos_1_1render.html#a1adc532475d45d16f7b0c0eddf1bc7cb"> 52</a></span>&#160;std::pair&lt;cv::Mat, cv::Mat&gt; <a class="code" href="namespaceeos_1_1render.html#a1adc532475d45d16f7b0c0eddf1bc7cb">render_affine</a>(<a class="code" href="structeos_1_1render_1_1_mesh.html">Mesh</a> mesh, cv::Mat affine_camera_matrix, <span class="keywordtype">int</span> viewport_width, <span class="keywordtype">int</span> viewport_height, <span class="keywordtype">bool</span> do_backface_culling = <span class="keyword">true</span>)</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;{</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; assert(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size() == mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.size() || mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.empty()); <span class="comment">// The number of vertices has to be equal for both shape and colour, or, alternatively, it has to be a shape-only model.</span></div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="comment">//assert(mesh.vertices.size() == mesh.texcoords.size() || mesh.texcoords.empty()); // same for the texcoords</span></div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <span class="keyword">using</span> cv::Mat;</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <span class="keyword">using</span> std::vector;</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; Mat colourbuffer = Mat::zeros(viewport_height, viewport_width, CV_8UC4);</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; Mat depthbuffer = std::numeric_limits&lt;float&gt;::max() * Mat::ones(viewport_height, viewport_width, CV_64FC1);</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; Mat affine_with_z = detail::calculate_affine_z_direction(affine_camera_matrix);</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; vector&lt;detail::Vertex&gt; projected_vertices;</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; projected_vertices.reserve(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size());</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size(); ++i) {</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; Mat vertex_screen_coords = affine_with_z * Mat(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i]);</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; cv::Vec3f vertex_colour;</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="keywordflow">if</span> (mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.empty()) {</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; vertex_colour = cv::Vec3f(0.5f, 0.5f, 0.5f);</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; }</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keywordflow">else</span> {</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; vertex_colour = mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>[i];</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; }</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; projected_vertices.push_back(detail::Vertex(vertex_screen_coords, vertex_colour, mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[i]));</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; }</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="comment">// All vertices are screen-coordinates now</span></div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; vector&lt;detail::TriangleToRasterize&gt; triangles_to_raster;</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; tri_indices : mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">tvi</a>) {</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="keywordflow">if</span> (do_backface_culling) {</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="keywordflow">if</span> (!detail::are_vertices_ccw_in_screen_space(projected_vertices[tri_indices[0]].position, projected_vertices[tri_indices[1]].position, projected_vertices[tri_indices[2]].position))</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keywordflow">continue</span>; <span class="comment">// don&#39;t render this triangle</span></div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; }</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="comment">// Get the bounding box of the triangle:</span></div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="comment">// take care: What do we do if all 3 vertices are not visible. Seems to work on a test case.</span></div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; cv::Rect bounding_box = detail::calculate_clipped_bounding_box(projected_vertices[tri_indices[0]].position, projected_vertices[tri_indices[1]].position, projected_vertices[tri_indices[2]].position, viewport_width, viewport_height);</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="keyword">auto</span> min_x = bounding_box.x;</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keyword">auto</span> max_x = bounding_box.x + bounding_box.width;</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="keyword">auto</span> min_y = bounding_box.y;</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keyword">auto</span> max_y = bounding_box.y + bounding_box.height;</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <span class="keywordflow">if</span> (max_x &lt;= min_x || max_y &lt;= min_y) <span class="comment">// Note: Can the width/height of the bbox be negative? Maybe we only need to check for equality here?</span></div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; detail::TriangleToRasterize t;</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; t.min_x = min_x;</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; t.max_x = max_x;</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; t.min_y = min_y;</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; t.max_y = max_y;</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; t.v0 = projected_vertices[tri_indices[0]];</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; t.v1 = projected_vertices[tri_indices[1]];</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; t.v2 = projected_vertices[tri_indices[2]];</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; triangles_to_raster.push_back(t);</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; }</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="comment">// Raster all triangles, i.e. colour the pixel values and write the z-buffer</span></div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp;&amp; triangle : triangles_to_raster) {</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; detail::raster_triangle_affine(triangle, colourbuffer, depthbuffer);</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; }</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <span class="keywordflow">return</span> std::make_pair(colourbuffer, depthbuffer);</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;};</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; } <span class="comment">/* namespace render */</span></div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;} <span class="comment">/* namespace eos */</span></div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* RENDER_AFFINE_HPP_ */</span><span class="preprocessor"></span></div><div class="ttc" id="namespaceeos_1_1render_html_a097a630659b6c06a4596ca138f66ec94"><div class="ttname"><a href="namespaceeos_1_1render.html#a097a630659b6c06a4596ca138f66ec94">eos::render::render</a></div><div class="ttdeci">std::pair&lt; cv::Mat, cv::Mat &gt; render(Mesh mesh, cv::Mat model_view_matrix, cv::Mat projection_matrix, int viewport_width, int viewport_height, const boost::optional&lt; Texture &gt; &amp;texture=boost::none, bool enable_backface_culling=false, bool enable_near_clipping=true, bool enable_far_clipping=true)</div><div class="ttdef"><b>Definition:</b> render.hpp:125</div></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/render/render_affine.hpp</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2014, 2015 Patrik Huber</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef RENDER_AFFINE_HPP_</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define RENDER_AFFINE_HPP_</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;eos/render/detail/render_detail.hpp&quot;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &quot;eos/render/detail/render_affine_detail.hpp&quot;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;eos/render/Mesh.hpp&quot;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;</div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &lt;utility&gt;</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; <span class="keyword">namespace </span><a class="code" href="namespaceeos_1_1render.html#a7628a42875570658bea6ffb4f46723e5">render</a> {</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;</div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="namespaceeos_1_1render.html#a1adc532475d45d16f7b0c0eddf1bc7cb"> 52</a></span>&#160;std::pair&lt;cv::Mat, cv::Mat&gt; <a class="code" href="namespaceeos_1_1render.html#a1adc532475d45d16f7b0c0eddf1bc7cb">render_affine</a>(<a class="code" href="structeos_1_1render_1_1_mesh.html">Mesh</a> mesh, cv::Mat affine_camera_matrix, <span class="keywordtype">int</span> viewport_width, <span class="keywordtype">int</span> viewport_height, <span class="keywordtype">bool</span> do_backface_culling = <span class="keyword">true</span>)</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;{</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; assert(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size() == mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.size() || mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.empty()); <span class="comment">// The number of vertices has to be equal for both shape and colour, or, alternatively, it has to be a shape-only model.</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="comment">//assert(mesh.vertices.size() == mesh.texcoords.size() || mesh.texcoords.empty()); // same for the texcoords</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <span class="keyword">using</span> cv::Mat;</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <span class="keyword">using</span> std::vector;</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; Mat colourbuffer = Mat::zeros(viewport_height, viewport_width, CV_8UC4);</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; Mat depthbuffer = std::numeric_limits&lt;float&gt;::max() * Mat::ones(viewport_height, viewport_width, CV_64FC1);</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; Mat affine_with_z = detail::calculate_affine_z_direction(affine_camera_matrix);</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; vector&lt;detail::Vertex&gt; projected_vertices;</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; projected_vertices.reserve(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size());</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>.size(); ++i) {</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; Mat vertex_screen_coords = affine_with_z * Mat(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">vertices</a>[i]);</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; cv::Vec3f vertex_colour;</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="keywordflow">if</span> (mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>.empty()) {</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; vertex_colour = cv::Vec3f(0.5f, 0.5f, 0.5f);</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; }</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; vertex_colour = mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">colors</a>[i];</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; }</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; projected_vertices.push_back(detail::Vertex(vertex_screen_coords, vertex_colour, mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[i]));</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; }</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="comment">// All vertices are screen-coordinates now</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; vector&lt;detail::TriangleToRasterize&gt; triangles_to_raster;</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; tri_indices : mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">tvi</a>) {</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="keywordflow">if</span> (do_backface_culling) {</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="keywordflow">if</span> (!detail::are_vertices_ccw_in_screen_space(projected_vertices[tri_indices[0]].position, projected_vertices[tri_indices[1]].position, projected_vertices[tri_indices[2]].position))</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keywordflow">continue</span>; <span class="comment">// don&#39;t render this triangle</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; }</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="comment">// Get the bounding box of the triangle:</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="comment">// take care: What do we do if all 3 vertices are not visible. Seems to work on a test case.</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; cv::Rect bounding_box = detail::calculate_clipped_bounding_box(projected_vertices[tri_indices[0]].position, projected_vertices[tri_indices[1]].position, projected_vertices[tri_indices[2]].position, viewport_width, viewport_height);</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="keyword">auto</span> min_x = bounding_box.x;</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keyword">auto</span> max_x = bounding_box.x + bounding_box.width;</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="keyword">auto</span> min_y = bounding_box.y;</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keyword">auto</span> max_y = bounding_box.y + bounding_box.height;</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <span class="keywordflow">if</span> (max_x &lt;= min_x || max_y &lt;= min_y) <span class="comment">// Note: Can the width/height of the bbox be negative? Maybe we only need to check for equality here?</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; detail::TriangleToRasterize t;</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; t.min_x = min_x;</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; t.max_x = max_x;</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; t.min_y = min_y;</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; t.max_y = max_y;</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; t.v0 = projected_vertices[tri_indices[0]];</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; t.v1 = projected_vertices[tri_indices[1]];</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; t.v2 = projected_vertices[tri_indices[2]];</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; triangles_to_raster.push_back(t);</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; }</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="comment">// Raster all triangles, i.e. colour the pixel values and write the z-buffer</span></div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp;&amp; triangle : triangles_to_raster) {</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; detail::raster_triangle_affine(triangle, colourbuffer, depthbuffer);</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; }</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <span class="keywordflow">return</span> std::make_pair(colourbuffer, depthbuffer);</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;};</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; } <span class="comment">/* namespace render */</span></div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;} <span class="comment">/* namespace eos */</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* RENDER_AFFINE_HPP_ */</span><span class="preprocessor"></span></div>
<div class="ttc" id="namespaceeos_1_1render_html_a1adc532475d45d16f7b0c0eddf1bc7cb"><div class="ttname"><a href="namespaceeos_1_1render.html#a1adc532475d45d16f7b0c0eddf1bc7cb">eos::render::render_affine</a></div><div class="ttdeci">std::pair&lt; cv::Mat, cv::Mat &gt; render_affine(Mesh mesh, cv::Mat affine_camera_matrix, int viewport_width, int viewport_height, bool do_backface_culling=true)</div><div class="ttdef"><b>Definition:</b> render_affine.hpp:52</div></div> <div class="ttc" id="namespaceeos_1_1render_html_a1adc532475d45d16f7b0c0eddf1bc7cb"><div class="ttname"><a href="namespaceeos_1_1render.html#a1adc532475d45d16f7b0c0eddf1bc7cb">eos::render::render_affine</a></div><div class="ttdeci">std::pair&lt; cv::Mat, cv::Mat &gt; render_affine(Mesh mesh, cv::Mat affine_camera_matrix, int viewport_width, int viewport_height, bool do_backface_culling=true)</div><div class="ttdef"><b>Definition:</b> render_affine.hpp:52</div></div>
<div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&#39;s 3D model fitting functionality. </div></div> <div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&amp;#39;s 3D model fitting functionality. </div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html_a305d17e6453f6be320331e00e8c8816e"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">eos::render::Mesh::vertices</a></div><div class="ttdeci">std::vector&lt; cv::Vec4f &gt; vertices</div><div class="ttdoc">3D vertex positions. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:51</div></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html_a305d17e6453f6be320331e00e8c8816e"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e">eos::render::Mesh::vertices</a></div><div class="ttdeci">std::vector&lt; cv::Vec4f &gt; vertices</div><div class="ttdoc">3D vertex positions. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:47</div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html_ae3b0e946a77b4f434b382b315ea7c24b"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">eos::render::Mesh::colors</a></div><div class="ttdeci">std::vector&lt; cv::Vec3f &gt; colors</div><div class="ttdoc">Colour information for each vertex. Expected to be in RGB order. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:52</div></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html_ae3b0e946a77b4f434b382b315ea7c24b"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b">eos::render::Mesh::colors</a></div><div class="ttdeci">std::vector&lt; cv::Vec3f &gt; colors</div><div class="ttdoc">Colour information for each vertex. Expected to be in RGB order. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:48</div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html">eos::render::Mesh</a></div><div class="ttdoc">This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordin...</div><div class="ttdef"><b>Definition:</b> Mesh.hpp:49</div></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html">eos::render::Mesh</a></div><div class="ttdoc">This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordin...</div><div class="ttdef"><b>Definition:</b> Mesh.hpp:45</div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html_ab6fb80c460656bf7830a526f0692681b"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">eos::render::Mesh::tvi</a></div><div class="ttdeci">std::vector&lt; std::array&lt; int, 3 &gt; &gt; tvi</div><div class="ttdoc">Triangle vertex indices. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:55</div></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html_ab6fb80c460656bf7830a526f0692681b"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">eos::render::Mesh::tvi</a></div><div class="ttdeci">std::vector&lt; std::array&lt; int, 3 &gt; &gt; tvi</div><div class="ttdoc">Triangle vertex indices. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:51</div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html_a64fddf0a7200e7f66b0426773542eea4"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">eos::render::Mesh::texcoords</a></div><div class="ttdeci">std::vector&lt; cv::Vec2f &gt; texcoords</div><div class="ttdoc">Texture coordinates for each vertex. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:53</div></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html_a64fddf0a7200e7f66b0426773542eea4"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">eos::render::Mesh::texcoords</a></div><div class="ttdeci">std::vector&lt; cv::Vec2f &gt; texcoords</div><div class="ttdoc">Texture coordinates for each vertex. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:49</div></div>
<div class="ttc" id="namespaceeos_1_1render_html_a7628a42875570658bea6ffb4f46723e5"><div class="ttname"><a href="namespaceeos_1_1render.html#a7628a42875570658bea6ffb4f46723e5">eos::render::render</a></div><div class="ttdeci">std::pair&lt; cv::Mat, cv::Mat &gt; render(Mesh mesh, cv::Mat model_view_matrix, cv::Mat projection_matrix, int viewport_width, int viewport_height, const Texture &amp;texture, bool enable_backface_culling=false, bool enable_near_clipping=true, bool enable_far_clipping=true)</div><div class="ttdef"><b>Definition:</b> render.hpp:129</div></div>
</div><!-- fragment --></div><!-- contents --> </div><!-- fragment --></div><!-- contents -->
<!-- start footer part --> <!-- start footer part -->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_0.js"></script> <script type="text/javascript" src="all_0.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['calculate_5fface_5fnormal',['calculate_face_normal',['../namespaceeos_1_1render.html#ac72cdee6eed13468a424824ddd0b3074',1,'eos::render']]], ['blendshape',['Blendshape',['../structeos_1_1morphablemodel_1_1_blendshape.html',1,'eos::morphablemodel']]]
['clip_5fto_5fscreen_5fspace',['clip_to_screen_space',['../namespaceeos_1_1render.html#a04bb2f816e97ecb7f33cf8a50328e0db',1,'eos::render']]],
['colors',['colors',['../structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b',1,'eos::render::Mesh']]],
['convert',['convert',['../classeos_1_1core_1_1_landmark_mapper.html#aa0d5463e00e3b8f074b1f81dbd9390a7',1,'eos::core::LandmarkMapper']]],
['coordinates',['coordinates',['../structeos_1_1core_1_1_landmark.html#aa3ffa0bd40290634e485e3c5ca99229c',1,'eos::core::Landmark']]],
['cv',['cv',['../namespacecv.html',1,'']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_1.js"></script> <script type="text/javascript" src="all_1.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['draw_5fsample',['draw_sample',['../classeos_1_1morphablemodel_1_1_morphable_model.html#a5fd1b15edc89e89808339859570a4c09',1,'eos::morphablemodel::MorphableModel::draw_sample(float shape_sigma=1.0f, float color_sigma=1.0f)'],['../classeos_1_1morphablemodel_1_1_morphable_model.html#a14787e8e29f390277b10f2d0e19aa587',1,'eos::morphablemodel::MorphableModel::draw_sample(std::vector&lt; float &gt; shape_coefficients, std::vector&lt; float &gt; color_coefficients)'],['../classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538',1,'eos::morphablemodel::PcaModel::draw_sample(float sigma=1.0f)'],['../classeos_1_1morphablemodel_1_1_pca_model.html#abb5f0c6f86ab0cf9b35016441d877745',1,'eos::morphablemodel::PcaModel::draw_sample(std::vector&lt; float &gt; coefficients)']]], ['calculate_5fface_5fnormal',['calculate_face_normal',['../namespaceeos_1_1render.html#ac72cdee6eed13468a424824ddd0b3074',1,'eos::render']]],
['draw_5ftexcoords',['draw_texcoords',['../namespaceeos_1_1render.html#a4edecd42a4a04ba6eb95089dd3ff256a',1,'eos::render']]] ['cameratype',['CameraType',['../namespaceeos_1_1fitting.html#a63fce336daef96cde45f61701c4a3cf4',1,'eos::fitting']]],
['clip_5fto_5fscreen_5fspace',['clip_to_screen_space',['../namespaceeos_1_1render.html#a04bb2f816e97ecb7f33cf8a50328e0db',1,'eos::render']]],
['colors',['colors',['../structeos_1_1render_1_1_mesh.html#ae3b0e946a77b4f434b382b315ea7c24b',1,'eos::render::Mesh']]],
['contourlandmarks',['ContourLandmarks',['../structeos_1_1fitting_1_1_contour_landmarks.html',1,'eos::fitting']]],
['convert',['convert',['../classeos_1_1core_1_1_landmark_mapper.html#aa0d5463e00e3b8f074b1f81dbd9390a7',1,'eos::core::LandmarkMapper']]],
['coordinates',['coordinates',['../structeos_1_1core_1_1_landmark.html#aa3ffa0bd40290634e485e3c5ca99229c',1,'eos::core::Landmark']]],
['cv',['cv',['../namespacecv.html',1,'']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_10.js"></script> <script type="text/javascript" src="all_10.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_2.js"></script> <script type="text/javascript" src="all_2.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['core',['core',['../namespaceeos_1_1core.html',1,'eos']]], ['deformation',['deformation',['../structeos_1_1morphablemodel_1_1_blendshape.html#ae5d056f2f0473ddf1c0f000714c0b709',1,'eos::morphablemodel::Blendshape']]],
['eos',['eos',['../namespaceeos.html',1,'']]], ['draw_5fsample',['draw_sample',['../classeos_1_1morphablemodel_1_1_morphable_model.html#a5fd1b15edc89e89808339859570a4c09',1,'eos::morphablemodel::MorphableModel::draw_sample(float shape_sigma=1.0f, float color_sigma=1.0f)'],['../classeos_1_1morphablemodel_1_1_morphable_model.html#a92ab3e9941de492954a1c603cf3e11c9',1,'eos::morphablemodel::MorphableModel::draw_sample(std::vector&lt; float &gt; shape_coefficients, std::vector&lt; float &gt; color_coefficients) const '],['../classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538',1,'eos::morphablemodel::PcaModel::draw_sample(float sigma=1.0f)'],['../classeos_1_1morphablemodel_1_1_pca_model.html#a1ec80573ada0d7ff6ce4e937944edeb2',1,'eos::morphablemodel::PcaModel::draw_sample(std::vector&lt; float &gt; coefficients) const ']]],
['estimate_5faffine_5fcamera',['estimate_affine_camera',['../namespaceeos_1_1fitting.html#afce5f7297094056a04ad26785c94bbd8',1,'eos::fitting']]], ['draw_5ftexcoords',['draw_texcoords',['../namespaceeos_1_1render.html#a4edecd42a4a04ba6eb95089dd3ff256a',1,'eos::render']]]
['estimate_5forthographic_5fcamera',['estimate_orthographic_camera',['../namespaceeos_1_1fitting.html#aebab65b3f9f46758b1363a347e6de852',1,'eos::fitting']]],
['extract_5ftexture',['extract_texture',['../namespaceeos_1_1render.html#aafa8c960c3b6eb080da1536cc3634577',1,'eos::render::extract_texture(Mesh mesh, cv::Mat affine_camera_matrix, cv::Mat image, cv::Mat depthbuffer, bool compute_view_angle, TextureInterpolation mapping_type, int isomap_resolution)'],['../namespaceeos_1_1render.html#ad663c29566fafc33606349a35d0bdbf1',1,'eos::render::extract_texture(Mesh mesh, cv::Mat affine_camera_matrix, cv::Mat image, bool compute_view_angle=false, TextureInterpolation mapping_type=TextureInterpolation::NearestNeighbour, int isomap_resolution=512)']]],
['fitting',['fitting',['../namespaceeos_1_1fitting.html',1,'eos']]],
['morphablemodel',['morphablemodel',['../namespaceeos_1_1morphablemodel.html',1,'eos']]],
['render',['render',['../namespaceeos_1_1render.html',1,'eos']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_3.js"></script> <script type="text/javascript" src="all_3.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['filter',['filter',['../namespaceeos_1_1core.html#aacf41dc417a1dbfc929c9cc7f2c7feeb',1,'eos::core']]], ['core',['core',['../namespaceeos_1_1core.html',1,'eos']]],
['fit_5fshape_5fto_5flandmarks_5flinear',['fit_shape_to_landmarks_linear',['../namespaceeos_1_1fitting.html#ae68794185075b5b67fddae9d359cf208',1,'eos::fitting']]], ['eos',['eos',['../namespaceeos.html',1,'']]],
['frustum',['Frustum',['../structeos_1_1fitting_1_1_frustum.html',1,'eos::fitting']]] ['estimate_5faffine_5fcamera',['estimate_affine_camera',['../namespaceeos_1_1fitting.html#afce5f7297094056a04ad26785c94bbd8',1,'eos::fitting']]],
['estimate_5forthographic_5fcamera',['estimate_orthographic_camera',['../namespaceeos_1_1fitting.html#a9f55324bfa740c6b5061518535506084',1,'eos::fitting']]],
['extract_5ftexture',['extract_texture',['../namespaceeos_1_1render.html#aafa8c960c3b6eb080da1536cc3634577',1,'eos::render::extract_texture(Mesh mesh, cv::Mat affine_camera_matrix, cv::Mat image, cv::Mat depthbuffer, bool compute_view_angle, TextureInterpolation mapping_type, int isomap_resolution)'],['../namespaceeos_1_1render.html#ad663c29566fafc33606349a35d0bdbf1',1,'eos::render::extract_texture(Mesh mesh, cv::Mat affine_camera_matrix, cv::Mat image, bool compute_view_angle=false, TextureInterpolation mapping_type=TextureInterpolation::NearestNeighbour, int isomap_resolution=512)']]],
['fitting',['fitting',['../namespaceeos_1_1fitting.html',1,'eos']]],
['eos_3a_20a_20lightweight_20header_2donly_203d_20morphable_20face_20model_20fitting_20library_20in_20modern_20c_2b_2b11_2f14_2e',['eos: A lightweight header-only 3D Morphable Face Model fitting library in modern C++11/14.',['../index.html',1,'']]],
['morphablemodel',['morphablemodel',['../namespaceeos_1_1morphablemodel.html',1,'eos']]],
['render',['render',['../namespaceeos_1_1render.html',1,'eos']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_4.js"></script> <script type="text/javascript" src="all_4.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['get_5f3x4_5faffine_5fcamera_5fmatrix',['get_3x4_affine_camera_matrix',['../namespaceeos_1_1fitting.html#af600978a071bc5dc0443cfe41ae613bf',1,'eos::fitting']]], ['filter',['filter',['../namespaceeos_1_1core.html#aacf41dc417a1dbfc929c9cc7f2c7feeb',1,'eos::core']]],
['get_5f4x4_5fmodelview_5fmatrix',['get_4x4_modelview_matrix',['../namespaceeos_1_1fitting.html#a503a126cfe1bbd6a7c8b7a786a8e73b8',1,'eos::fitting']]], ['fit_5fblendshapes_5fto_5flandmarks_5flinear',['fit_blendshapes_to_landmarks_linear',['../namespaceeos_1_1fitting.html#ac429313cbc0ed61744f1b0fa4dba672b',1,'eos::fitting']]],
['get_5fcolor_5fmodel',['get_color_model',['../classeos_1_1morphablemodel_1_1_morphable_model.html#a1fff16d5d749831fa90049199101298c',1,'eos::morphablemodel::MorphableModel']]], ['fit_5fshape',['fit_shape',['../namespaceeos_1_1fitting.html#a5ddb4f44f4576ad148a9edd85d78c1f7',1,'eos::fitting::fit_shape(cv::Mat affine_camera_matrix, eos::morphablemodel::MorphableModel morphable_model, std::vector&lt; eos::morphablemodel::Blendshape &gt; blendshapes, std::vector&lt; cv::Vec2f &gt; image_points, std::vector&lt; int &gt; vertex_indices, float lambda, boost::optional&lt; int &gt; num_coefficients_to_fit, std::vector&lt; float &gt; &amp;pca_shape_coefficients, std::vector&lt; float &gt; &amp;blendshape_coefficients)'],['../namespaceeos_1_1fitting.html#ae3bcf9f955efce788838cc055b5282b6',1,'eos::fitting::fit_shape(cv::Mat affine_camera_matrix, eos::morphablemodel::MorphableModel morphable_model, std::vector&lt; eos::morphablemodel::Blendshape &gt; blendshapes, std::vector&lt; cv::Vec2f &gt; image_points, std::vector&lt; int &gt; vertex_indices, float lambda=3.0f, boost::optional&lt; int &gt; num_coefficients_to_fit=boost::optional&lt; int &gt;())']]],
['get_5fdata_5fdimension',['get_data_dimension',['../classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d',1,'eos::morphablemodel::PcaModel']]], ['fit_5fshape_5fto_5flandmarks_5flinear',['fit_shape_to_landmarks_linear',['../namespaceeos_1_1fitting.html#ae558a318d1d0c1da35d64b7abb209fac',1,'eos::fitting']]],
['get_5feigenvalue',['get_eigenvalue',['../classeos_1_1morphablemodel_1_1_pca_model.html#a8315679e0893b1bcde4f9a9aa08a137d',1,'eos::morphablemodel::PcaModel']]], ['frustum',['Frustum',['../structeos_1_1fitting_1_1_frustum.html',1,'eos::fitting']]]
['get_5fmean',['get_mean',['../classeos_1_1morphablemodel_1_1_morphable_model.html#a43dcaaff84e217ea9643e37705136f31',1,'eos::morphablemodel::MorphableModel::get_mean()'],['../classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495',1,'eos::morphablemodel::PcaModel::get_mean()']]],
['get_5fmean_5fat_5fpoint',['get_mean_at_point',['../classeos_1_1morphablemodel_1_1_pca_model.html#a1820ad4e0b9719884811188f3c932592',1,'eos::morphablemodel::PcaModel']]],
['get_5fnormalised_5fpca_5fbasis',['get_normalised_pca_basis',['../classeos_1_1morphablemodel_1_1_pca_model.html#af0597eb2cf01c98e397773740f3a8258',1,'eos::morphablemodel::PcaModel::get_normalised_pca_basis() const '],['../classeos_1_1morphablemodel_1_1_pca_model.html#a66e4ef89182a98845a8a6804047f2b77',1,'eos::morphablemodel::PcaModel::get_normalised_pca_basis(int vertex_id) const ']]],
['get_5fnum_5fprincipal_5fcomponents',['get_num_principal_components',['../classeos_1_1morphablemodel_1_1_pca_model.html#a309148e123fc5fecd3cf10513f75b657',1,'eos::morphablemodel::PcaModel']]],
['get_5fopencv_5fviewport',['get_opencv_viewport',['../namespaceeos_1_1fitting.html#a4e713b5555396806a9b26817184eacd0',1,'eos::fitting']]],
['get_5fshape_5fmodel',['get_shape_model',['../classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11',1,'eos::morphablemodel::MorphableModel']]],
['get_5ftexture_5fcoordinates',['get_texture_coordinates',['../classeos_1_1morphablemodel_1_1_morphable_model.html#aeffacfcafaf7dff6e21b047a2a6d22ae',1,'eos::morphablemodel::MorphableModel']]],
['get_5ftriangle_5flist',['get_triangle_list',['../classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3',1,'eos::morphablemodel::PcaModel']]],
['get_5funnormalised_5fpca_5fbasis',['get_unnormalised_pca_basis',['../classeos_1_1morphablemodel_1_1_pca_model.html#a8d0f31b08aca934b7cf86dd92a1abbe2',1,'eos::morphablemodel::PcaModel::get_unnormalised_pca_basis() const '],['../classeos_1_1morphablemodel_1_1_pca_model.html#a059f3e3f68307fd97b3e4aa38e4b6d34',1,'eos::morphablemodel::PcaModel::get_unnormalised_pca_basis(int vertex_id) const ']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_5.js"></script> <script type="text/javascript" src="all_5.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['has_5fcolor_5fmodel',['has_color_model',['../classeos_1_1morphablemodel_1_1_morphable_model.html#a253ca65b7f6c6cb48d4abd7b9a7f9a83',1,'eos::morphablemodel::MorphableModel']]] ['get_5f3x4_5faffine_5fcamera_5fmatrix',['get_3x4_affine_camera_matrix',['../namespaceeos_1_1fitting.html#abebc061912b7ef0b180536b467e8dc6f',1,'eos::fitting']]],
['get_5f4x4_5fmodelview_5fmatrix',['get_4x4_modelview_matrix',['../namespaceeos_1_1fitting.html#a198aa8a0c4d90a51bb1b422cfc6a87c4',1,'eos::fitting']]],
['get_5fcolor_5fmodel',['get_color_model',['../classeos_1_1morphablemodel_1_1_morphable_model.html#a1fff16d5d749831fa90049199101298c',1,'eos::morphablemodel::MorphableModel']]],
['get_5fcontour_5fcorrespondences',['get_contour_correspondences',['../namespaceeos_1_1fitting.html#af8ce6f464c22e42b5f98e96ef7f06ab0',1,'eos::fitting']]],
['get_5fdata_5fdimension',['get_data_dimension',['../classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d',1,'eos::morphablemodel::PcaModel']]],
['get_5feigenvalue',['get_eigenvalue',['../classeos_1_1morphablemodel_1_1_pca_model.html#a8315679e0893b1bcde4f9a9aa08a137d',1,'eos::morphablemodel::PcaModel']]],
['get_5fmean',['get_mean',['../classeos_1_1morphablemodel_1_1_morphable_model.html#a43dcaaff84e217ea9643e37705136f31',1,'eos::morphablemodel::MorphableModel::get_mean()'],['../classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495',1,'eos::morphablemodel::PcaModel::get_mean()']]],
['get_5fmean_5fat_5fpoint',['get_mean_at_point',['../classeos_1_1morphablemodel_1_1_pca_model.html#a1820ad4e0b9719884811188f3c932592',1,'eos::morphablemodel::PcaModel']]],
['get_5fnearest_5fcontour_5fcorrespondences',['get_nearest_contour_correspondences',['../namespaceeos_1_1fitting.html#ade368ea637ac45c9e344dde326ffe174',1,'eos::fitting']]],
['get_5fnormalised_5fpca_5fbasis',['get_normalised_pca_basis',['../classeos_1_1morphablemodel_1_1_pca_model.html#af0597eb2cf01c98e397773740f3a8258',1,'eos::morphablemodel::PcaModel::get_normalised_pca_basis() const '],['../classeos_1_1morphablemodel_1_1_pca_model.html#a66e4ef89182a98845a8a6804047f2b77',1,'eos::morphablemodel::PcaModel::get_normalised_pca_basis(int vertex_id) const ']]],
['get_5fnum_5fprincipal_5fcomponents',['get_num_principal_components',['../classeos_1_1morphablemodel_1_1_pca_model.html#a309148e123fc5fecd3cf10513f75b657',1,'eos::morphablemodel::PcaModel']]],
['get_5fopencv_5fviewport',['get_opencv_viewport',['../namespaceeos_1_1fitting.html#a4e713b5555396806a9b26817184eacd0',1,'eos::fitting']]],
['get_5fshape_5fmodel',['get_shape_model',['../classeos_1_1morphablemodel_1_1_morphable_model.html#a990bf9c518307c811691facb8c1daa11',1,'eos::morphablemodel::MorphableModel']]],
['get_5ftexture_5fcoordinates',['get_texture_coordinates',['../classeos_1_1morphablemodel_1_1_morphable_model.html#aeffacfcafaf7dff6e21b047a2a6d22ae',1,'eos::morphablemodel::MorphableModel']]],
['get_5ftriangle_5flist',['get_triangle_list',['../classeos_1_1morphablemodel_1_1_pca_model.html#aab14825974f9512ba3b7b88afd2521b3',1,'eos::morphablemodel::PcaModel']]],
['get_5funnormalised_5fpca_5fbasis',['get_unnormalised_pca_basis',['../classeos_1_1morphablemodel_1_1_pca_model.html#a8d0f31b08aca934b7cf86dd92a1abbe2',1,'eos::morphablemodel::PcaModel::get_unnormalised_pca_basis() const '],['../classeos_1_1morphablemodel_1_1_pca_model.html#a059f3e3f68307fd97b3e4aa38e4b6d34',1,'eos::morphablemodel::PcaModel::get_unnormalised_pca_basis(int vertex_id) const ']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_6.js"></script> <script type="text/javascript" src="all_6.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['landmark',['Landmark',['../structeos_1_1core_1_1_landmark.html',1,'eos::core']]], ['has_5fcolor_5fmodel',['has_color_model',['../classeos_1_1morphablemodel_1_1_morphable_model.html#a253ca65b7f6c6cb48d4abd7b9a7f9a83',1,'eos::morphablemodel::MorphableModel']]]
['landmarkcollection',['LandmarkCollection',['../namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b',1,'eos::core']]],
['landmarkmapper',['LandmarkMapper',['../classeos_1_1core_1_1_landmark_mapper.html',1,'eos::core']]],
['landmarkmapper',['LandmarkMapper',['../classeos_1_1core_1_1_landmark_mapper.html#ab31ea1ec78c463ce54e2372fce103889',1,'eos::core::LandmarkMapper::LandmarkMapper()=default'],['../classeos_1_1core_1_1_landmark_mapper.html#a7da2756a772bd7dd7708bf20fcc95fc4',1,'eos::core::LandmarkMapper::LandmarkMapper(boost::filesystem::path filename)']]],
['load',['load',['../namespacecv.html#a7172a20ab6627a1c1967d322bdfc8756',1,'cv']]],
['load_5fisomap',['load_isomap',['../namespaceeos_1_1morphablemodel.html#afa73fdf5b394458b7e21639ae50d074c',1,'eos::morphablemodel']]],
['load_5fmodel',['load_model',['../namespaceeos_1_1morphablemodel.html#a0da6e35ec49f1ebdf55f9596540cf8f8',1,'eos::morphablemodel']]],
['load_5fscm_5fmodel',['load_scm_model',['../namespaceeos_1_1morphablemodel.html#a0d607b8838d70cd8ec41cb4bfe116f58',1,'eos::morphablemodel']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_7.js"></script> <script type="text/javascript" src="all_7.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['mesh',['Mesh',['../structeos_1_1render_1_1_mesh.html',1,'eos::render']]], ['landmark',['Landmark',['../structeos_1_1core_1_1_landmark.html',1,'eos::core']]],
['morphablemodel',['MorphableModel',['../classeos_1_1morphablemodel_1_1_morphable_model.html#a438898cd4578c1998e452de7d521f8cc',1,'eos::morphablemodel::MorphableModel']]], ['landmarkcollection',['LandmarkCollection',['../namespaceeos_1_1core.html#a6d6a8533690b5860236f55afafa14d2b',1,'eos::core']]],
['morphablemodel',['MorphableModel',['../classeos_1_1morphablemodel_1_1_morphable_model.html',1,'eos::morphablemodel']]] ['landmarkmapper',['LandmarkMapper',['../classeos_1_1core_1_1_landmark_mapper.html',1,'eos::core']]],
['landmarkmapper',['LandmarkMapper',['../classeos_1_1core_1_1_landmark_mapper.html#ab31ea1ec78c463ce54e2372fce103889',1,'eos::core::LandmarkMapper::LandmarkMapper()=default'],['../classeos_1_1core_1_1_landmark_mapper.html#a7da2756a772bd7dd7708bf20fcc95fc4',1,'eos::core::LandmarkMapper::LandmarkMapper(boost::filesystem::path filename)']]],
['load',['load',['../structeos_1_1fitting_1_1_model_contour.html#a7a53f075afaeabef19a33b2e914406ce',1,'eos::fitting::ModelContour::load()'],['../structeos_1_1fitting_1_1_contour_landmarks.html#a15bb18f801e64ceaf5e07f73a1374cdb',1,'eos::fitting::ContourLandmarks::load()'],['../namespacecv.html#a9efebfa4f4c3e7117f0effe0ef18fd61',1,'cv::load()']]],
['load_5fblendshapes',['load_blendshapes',['../namespaceeos_1_1morphablemodel.html#a408184d7cae7e40c5c8e76c2bc114811',1,'eos::morphablemodel']]],
['load_5fisomap',['load_isomap',['../namespaceeos_1_1morphablemodel.html#afa73fdf5b394458b7e21639ae50d074c',1,'eos::morphablemodel']]],
['load_5fmodel',['load_model',['../namespaceeos_1_1morphablemodel.html#a0da6e35ec49f1ebdf55f9596540cf8f8',1,'eos::morphablemodel']]],
['load_5fscm_5fmodel',['load_scm_model',['../namespaceeos_1_1morphablemodel.html#a0d607b8838d70cd8ec41cb4bfe116f58',1,'eos::morphablemodel']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_8.js"></script> <script type="text/javascript" src="all_8.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['name',['name',['../structeos_1_1core_1_1_landmark.html#a85c0f001e311e994314e900dcb284ad3',1,'eos::core::Landmark']]], ['mesh',['Mesh',['../structeos_1_1render_1_1_mesh.html',1,'eos::render']]],
['normalise_5fpca_5fbasis',['normalise_pca_basis',['../namespaceeos_1_1morphablemodel.html#a73d9baeb67f25d4604fc291a23e5e2d8',1,'eos::morphablemodel']]] ['modelcontour',['ModelContour',['../structeos_1_1fitting_1_1_model_contour.html',1,'eos::fitting']]],
['morphablemodel',['MorphableModel',['../classeos_1_1morphablemodel_1_1_morphable_model.html',1,'eos::morphablemodel']]],
['morphablemodel',['MorphableModel',['../classeos_1_1morphablemodel_1_1_morphable_model.html#a438898cd4578c1998e452de7d521f8cc',1,'eos::morphablemodel::MorphableModel']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_9.js"></script> <script type="text/javascript" src="all_9.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['orthographicrenderingparameters',['OrthographicRenderingParameters',['../structeos_1_1fitting_1_1_orthographic_rendering_parameters.html',1,'eos::fitting']]] ['name',['name',['../structeos_1_1core_1_1_landmark.html#a85c0f001e311e994314e900dcb284ad3',1,'eos::core::Landmark::name()'],['../structeos_1_1morphablemodel_1_1_blendshape.html#ab87c9b282061a3dd72a8176fffa99594',1,'eos::morphablemodel::Blendshape::name()']]],
['normalise_5fpca_5fbasis',['normalise_pca_basis',['../namespaceeos_1_1morphablemodel.html#a31a2b98e73170ae558f6c50e76524817',1,'eos::morphablemodel']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_a.js"></script> <script type="text/javascript" src="all_a.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_b.js"></script> <script type="text/javascript" src="all_b.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['render',['render',['../namespaceeos_1_1render.html#a7628a42875570658bea6ffb4f46723e5',1,'eos::render']]], ['render',['render',['../namespaceeos_1_1render.html#a097a630659b6c06a4596ca138f66ec94',1,'eos::render']]],
['render_5faffine',['render_affine',['../namespaceeos_1_1render.html#a1adc532475d45d16f7b0c0eddf1bc7cb',1,'eos::render']]] ['render_5faffine',['render_affine',['../namespaceeos_1_1render.html#a1adc532475d45d16f7b0c0eddf1bc7cb',1,'eos::render']]],
['renderingparameters',['RenderingParameters',['../structeos_1_1fitting_1_1_rendering_parameters.html',1,'eos::fitting']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_c.js"></script> <script type="text/javascript" src="all_c.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['save',['save',['../namespacecv.html#a62cc822cc258c9305ac746d3a832f9d4',1,'cv']]], ['save',['save',['../namespacecv.html#a758b4418894b35447bfd472847c1dfaf',1,'cv']]],
['save_5fcoefficients',['save_coefficients',['../namespaceeos_1_1morphablemodel.html#a2578fc03dbaa1809873578f17991e278',1,'eos::morphablemodel']]],
['save_5fmodel',['save_model',['../namespaceeos_1_1morphablemodel.html#aad09e0fd0788cb7fea41ed799c653e71',1,'eos::morphablemodel']]], ['save_5fmodel',['save_model',['../namespaceeos_1_1morphablemodel.html#aad09e0fd0788cb7fea41ed799c653e71',1,'eos::morphablemodel']]],
['save_5frendering_5fparameters',['save_rendering_parameters',['../namespaceeos_1_1fitting.html#a03b4bc35b0619e7f4bd0fccbb2d35e2c',1,'eos::fitting']]],
['screen_5fto_5fclip_5fspace',['screen_to_clip_space',['../namespaceeos_1_1render.html#a7c4b923267e9b3b09c0c588bfdd4cb85',1,'eos::render']]], ['screen_5fto_5fclip_5fspace',['screen_to_clip_space',['../namespaceeos_1_1render.html#a7c4b923267e9b3b09c0c588bfdd4cb85',1,'eos::render']]],
['serialize',['serialize',['../namespacecv.html#a51eb61cb95a3e45290a030560ac7a2cd',1,'cv']]], ['select_5fcontour',['select_contour',['../namespaceeos_1_1fitting.html#a6a307eaa4a1a9f2c5e2c33a95a6e261d',1,'eos::fitting']]],
['serialize',['serialize',['../structeos_1_1fitting_1_1_model_contour.html#a079c6e6969f79c123ceb8efc4116d9ea',1,'eos::fitting::ModelContour::serialize()'],['../structeos_1_1fitting_1_1_frustum.html#ad2927fb97762ef726696cf6296b5b9d4',1,'eos::fitting::Frustum::serialize()'],['../structeos_1_1fitting_1_1_rendering_parameters.html#a5d9a13513843bc122a58ebae9801fada',1,'eos::fitting::RenderingParameters::serialize()'],['../structeos_1_1morphablemodel_1_1_blendshape.html#aeccd060e4fa63cf3c417625d118f0602',1,'eos::morphablemodel::Blendshape::serialize()'],['../namespacecv.html#a51eb61cb95a3e45290a030560ac7a2cd',1,'cv::serialize()']]],
['size',['size',['../classeos_1_1core_1_1_landmark_mapper.html#a7e3a46e6aeb522d96066a3d73f4c92c6',1,'eos::core::LandmarkMapper']]] ['size',['size',['../classeos_1_1core_1_1_landmark_mapper.html#a7e3a46e6aeb522d96066a3d73f4c92c6',1,'eos::core::LandmarkMapper']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_d.js"></script> <script type="text/javascript" src="all_d.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_e.js"></script> <script type="text/javascript" src="all_e.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['unnormalise_5fpca_5fbasis',['unnormalise_pca_basis',['../namespaceeos_1_1morphablemodel.html#a3d9ed5fa969cbd540ebe9587540f3607',1,'eos::morphablemodel']]] ['unnormalise_5fpca_5fbasis',['unnormalise_pca_basis',['../namespaceeos_1_1morphablemodel.html#a90682d9e8a88243a1113b5a6c149799e',1,'eos::morphablemodel']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_f.js"></script> <script type="text/javascript" src="all_f.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="classes_0.js"></script> <script type="text/javascript" src="classes_0.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['frustum',['Frustum',['../structeos_1_1fitting_1_1_frustum.html',1,'eos::fitting']]] ['blendshape',['Blendshape',['../structeos_1_1morphablemodel_1_1_blendshape.html',1,'eos::morphablemodel']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="classes_1.js"></script> <script type="text/javascript" src="classes_1.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['landmark',['Landmark',['../structeos_1_1core_1_1_landmark.html',1,'eos::core']]], ['contourlandmarks',['ContourLandmarks',['../structeos_1_1fitting_1_1_contour_landmarks.html',1,'eos::fitting']]]
['landmarkmapper',['LandmarkMapper',['../classeos_1_1core_1_1_landmark_mapper.html',1,'eos::core']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="classes_2.js"></script> <script type="text/javascript" src="classes_2.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['mesh',['Mesh',['../structeos_1_1render_1_1_mesh.html',1,'eos::render']]], ['frustum',['Frustum',['../structeos_1_1fitting_1_1_frustum.html',1,'eos::fitting']]]
['morphablemodel',['MorphableModel',['../classeos_1_1morphablemodel_1_1_morphable_model.html',1,'eos::morphablemodel']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="classes_3.js"></script> <script type="text/javascript" src="classes_3.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['orthographicrenderingparameters',['OrthographicRenderingParameters',['../structeos_1_1fitting_1_1_orthographic_rendering_parameters.html',1,'eos::fitting']]] ['landmark',['Landmark',['../structeos_1_1core_1_1_landmark.html',1,'eos::core']]],
['landmarkmapper',['LandmarkMapper',['../classeos_1_1core_1_1_landmark_mapper.html',1,'eos::core']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="classes_4.js"></script> <script type="text/javascript" src="classes_4.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['pcamodel',['PcaModel',['../classeos_1_1morphablemodel_1_1_pca_model.html',1,'eos::morphablemodel']]] ['mesh',['Mesh',['../structeos_1_1render_1_1_mesh.html',1,'eos::render']]],
['modelcontour',['ModelContour',['../structeos_1_1fitting_1_1_model_contour.html',1,'eos::fitting']]],
['morphablemodel',['MorphableModel',['../classeos_1_1morphablemodel_1_1_morphable_model.html',1,'eos::morphablemodel']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="classes_5.js"></script> <script type="text/javascript" src="classes_5.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['texture',['Texture',['../classeos_1_1render_1_1_texture.html',1,'eos::render']]] ['pcamodel',['PcaModel',['../classeos_1_1morphablemodel_1_1_pca_model.html',1,'eos::morphablemodel']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="classes_6.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
var searchData=
[
['renderingparameters',['RenderingParameters',['../structeos_1_1fitting_1_1_rendering_parameters.html',1,'eos::fitting']]]
];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="classes_7.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
var searchData=
[
['texture',['Texture',['../classeos_1_1render_1_1_texture.html',1,'eos::render']]]
];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="enums_0.js"></script> <script type="text/javascript" src="enums_0.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['textureinterpolation',['TextureInterpolation',['../namespaceeos_1_1render.html#a298bda0bf8e9ee6947522b96d32ab237',1,'eos::render']]] ['cameratype',['CameraType',['../namespaceeos_1_1fitting.html#a63fce336daef96cde45f61701c4a3cf4',1,'eos::fitting']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="enums_1.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
var searchData=
[
['textureinterpolation',['TextureInterpolation',['../namespaceeos_1_1render.html#a298bda0bf8e9ee6947522b96d32ab237',1,'eos::render']]]
];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="functions_0.js"></script> <script type="text/javascript" src="functions_0.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="functions_1.js"></script> <script type="text/javascript" src="functions_1.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['draw_5fsample',['draw_sample',['../classeos_1_1morphablemodel_1_1_morphable_model.html#a5fd1b15edc89e89808339859570a4c09',1,'eos::morphablemodel::MorphableModel::draw_sample(float shape_sigma=1.0f, float color_sigma=1.0f)'],['../classeos_1_1morphablemodel_1_1_morphable_model.html#a14787e8e29f390277b10f2d0e19aa587',1,'eos::morphablemodel::MorphableModel::draw_sample(std::vector&lt; float &gt; shape_coefficients, std::vector&lt; float &gt; color_coefficients)'],['../classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538',1,'eos::morphablemodel::PcaModel::draw_sample(float sigma=1.0f)'],['../classeos_1_1morphablemodel_1_1_pca_model.html#abb5f0c6f86ab0cf9b35016441d877745',1,'eos::morphablemodel::PcaModel::draw_sample(std::vector&lt; float &gt; coefficients)']]], ['draw_5fsample',['draw_sample',['../classeos_1_1morphablemodel_1_1_morphable_model.html#a5fd1b15edc89e89808339859570a4c09',1,'eos::morphablemodel::MorphableModel::draw_sample(float shape_sigma=1.0f, float color_sigma=1.0f)'],['../classeos_1_1morphablemodel_1_1_morphable_model.html#a92ab3e9941de492954a1c603cf3e11c9',1,'eos::morphablemodel::MorphableModel::draw_sample(std::vector&lt; float &gt; shape_coefficients, std::vector&lt; float &gt; color_coefficients) const '],['../classeos_1_1morphablemodel_1_1_pca_model.html#a8dfc5fa04f9853f2e06b971b90415538',1,'eos::morphablemodel::PcaModel::draw_sample(float sigma=1.0f)'],['../classeos_1_1morphablemodel_1_1_pca_model.html#a1ec80573ada0d7ff6ce4e937944edeb2',1,'eos::morphablemodel::PcaModel::draw_sample(std::vector&lt; float &gt; coefficients) const ']]],
['draw_5ftexcoords',['draw_texcoords',['../namespaceeos_1_1render.html#a4edecd42a4a04ba6eb95089dd3ff256a',1,'eos::render']]] ['draw_5ftexcoords',['draw_texcoords',['../namespaceeos_1_1render.html#a4edecd42a4a04ba6eb95089dd3ff256a',1,'eos::render']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="functions_2.js"></script> <script type="text/javascript" src="functions_2.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['estimate_5faffine_5fcamera',['estimate_affine_camera',['../namespaceeos_1_1fitting.html#afce5f7297094056a04ad26785c94bbd8',1,'eos::fitting']]], ['estimate_5faffine_5fcamera',['estimate_affine_camera',['../namespaceeos_1_1fitting.html#afce5f7297094056a04ad26785c94bbd8',1,'eos::fitting']]],
['estimate_5forthographic_5fcamera',['estimate_orthographic_camera',['../namespaceeos_1_1fitting.html#aebab65b3f9f46758b1363a347e6de852',1,'eos::fitting']]], ['estimate_5forthographic_5fcamera',['estimate_orthographic_camera',['../namespaceeos_1_1fitting.html#a9f55324bfa740c6b5061518535506084',1,'eos::fitting']]],
['extract_5ftexture',['extract_texture',['../namespaceeos_1_1render.html#aafa8c960c3b6eb080da1536cc3634577',1,'eos::render::extract_texture(Mesh mesh, cv::Mat affine_camera_matrix, cv::Mat image, cv::Mat depthbuffer, bool compute_view_angle, TextureInterpolation mapping_type, int isomap_resolution)'],['../namespaceeos_1_1render.html#ad663c29566fafc33606349a35d0bdbf1',1,'eos::render::extract_texture(Mesh mesh, cv::Mat affine_camera_matrix, cv::Mat image, bool compute_view_angle=false, TextureInterpolation mapping_type=TextureInterpolation::NearestNeighbour, int isomap_resolution=512)']]] ['extract_5ftexture',['extract_texture',['../namespaceeos_1_1render.html#aafa8c960c3b6eb080da1536cc3634577',1,'eos::render::extract_texture(Mesh mesh, cv::Mat affine_camera_matrix, cv::Mat image, cv::Mat depthbuffer, bool compute_view_angle, TextureInterpolation mapping_type, int isomap_resolution)'],['../namespaceeos_1_1render.html#ad663c29566fafc33606349a35d0bdbf1',1,'eos::render::extract_texture(Mesh mesh, cv::Mat affine_camera_matrix, cv::Mat image, bool compute_view_angle=false, TextureInterpolation mapping_type=TextureInterpolation::NearestNeighbour, int isomap_resolution=512)']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="functions_3.js"></script> <script type="text/javascript" src="functions_3.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['filter',['filter',['../namespaceeos_1_1core.html#aacf41dc417a1dbfc929c9cc7f2c7feeb',1,'eos::core']]], ['filter',['filter',['../namespaceeos_1_1core.html#aacf41dc417a1dbfc929c9cc7f2c7feeb',1,'eos::core']]],
['fit_5fshape_5fto_5flandmarks_5flinear',['fit_shape_to_landmarks_linear',['../namespaceeos_1_1fitting.html#ae68794185075b5b67fddae9d359cf208',1,'eos::fitting']]] ['fit_5fblendshapes_5fto_5flandmarks_5flinear',['fit_blendshapes_to_landmarks_linear',['../namespaceeos_1_1fitting.html#ac429313cbc0ed61744f1b0fa4dba672b',1,'eos::fitting']]],
['fit_5fshape',['fit_shape',['../namespaceeos_1_1fitting.html#a5ddb4f44f4576ad148a9edd85d78c1f7',1,'eos::fitting::fit_shape(cv::Mat affine_camera_matrix, eos::morphablemodel::MorphableModel morphable_model, std::vector&lt; eos::morphablemodel::Blendshape &gt; blendshapes, std::vector&lt; cv::Vec2f &gt; image_points, std::vector&lt; int &gt; vertex_indices, float lambda, boost::optional&lt; int &gt; num_coefficients_to_fit, std::vector&lt; float &gt; &amp;pca_shape_coefficients, std::vector&lt; float &gt; &amp;blendshape_coefficients)'],['../namespaceeos_1_1fitting.html#ae3bcf9f955efce788838cc055b5282b6',1,'eos::fitting::fit_shape(cv::Mat affine_camera_matrix, eos::morphablemodel::MorphableModel morphable_model, std::vector&lt; eos::morphablemodel::Blendshape &gt; blendshapes, std::vector&lt; cv::Vec2f &gt; image_points, std::vector&lt; int &gt; vertex_indices, float lambda=3.0f, boost::optional&lt; int &gt; num_coefficients_to_fit=boost::optional&lt; int &gt;())']]],
['fit_5fshape_5fto_5flandmarks_5flinear',['fit_shape_to_landmarks_linear',['../namespaceeos_1_1fitting.html#ae558a318d1d0c1da35d64b7abb209fac',1,'eos::fitting']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="functions_4.js"></script> <script type="text/javascript" src="functions_4.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['get_5f3x4_5faffine_5fcamera_5fmatrix',['get_3x4_affine_camera_matrix',['../namespaceeos_1_1fitting.html#af600978a071bc5dc0443cfe41ae613bf',1,'eos::fitting']]], ['get_5f3x4_5faffine_5fcamera_5fmatrix',['get_3x4_affine_camera_matrix',['../namespaceeos_1_1fitting.html#abebc061912b7ef0b180536b467e8dc6f',1,'eos::fitting']]],
['get_5f4x4_5fmodelview_5fmatrix',['get_4x4_modelview_matrix',['../namespaceeos_1_1fitting.html#a503a126cfe1bbd6a7c8b7a786a8e73b8',1,'eos::fitting']]], ['get_5f4x4_5fmodelview_5fmatrix',['get_4x4_modelview_matrix',['../namespaceeos_1_1fitting.html#a198aa8a0c4d90a51bb1b422cfc6a87c4',1,'eos::fitting']]],
['get_5fcolor_5fmodel',['get_color_model',['../classeos_1_1morphablemodel_1_1_morphable_model.html#a1fff16d5d749831fa90049199101298c',1,'eos::morphablemodel::MorphableModel']]], ['get_5fcolor_5fmodel',['get_color_model',['../classeos_1_1morphablemodel_1_1_morphable_model.html#a1fff16d5d749831fa90049199101298c',1,'eos::morphablemodel::MorphableModel']]],
['get_5fcontour_5fcorrespondences',['get_contour_correspondences',['../namespaceeos_1_1fitting.html#af8ce6f464c22e42b5f98e96ef7f06ab0',1,'eos::fitting']]],
['get_5fdata_5fdimension',['get_data_dimension',['../classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d',1,'eos::morphablemodel::PcaModel']]], ['get_5fdata_5fdimension',['get_data_dimension',['../classeos_1_1morphablemodel_1_1_pca_model.html#acdf68d929079eab57ab4990c468a9e0d',1,'eos::morphablemodel::PcaModel']]],
['get_5feigenvalue',['get_eigenvalue',['../classeos_1_1morphablemodel_1_1_pca_model.html#a8315679e0893b1bcde4f9a9aa08a137d',1,'eos::morphablemodel::PcaModel']]], ['get_5feigenvalue',['get_eigenvalue',['../classeos_1_1morphablemodel_1_1_pca_model.html#a8315679e0893b1bcde4f9a9aa08a137d',1,'eos::morphablemodel::PcaModel']]],
['get_5fmean',['get_mean',['../classeos_1_1morphablemodel_1_1_morphable_model.html#a43dcaaff84e217ea9643e37705136f31',1,'eos::morphablemodel::MorphableModel::get_mean()'],['../classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495',1,'eos::morphablemodel::PcaModel::get_mean()']]], ['get_5fmean',['get_mean',['../classeos_1_1morphablemodel_1_1_morphable_model.html#a43dcaaff84e217ea9643e37705136f31',1,'eos::morphablemodel::MorphableModel::get_mean()'],['../classeos_1_1morphablemodel_1_1_pca_model.html#af05c96c2a5d3936503b961a9b4238495',1,'eos::morphablemodel::PcaModel::get_mean()']]],
['get_5fmean_5fat_5fpoint',['get_mean_at_point',['../classeos_1_1morphablemodel_1_1_pca_model.html#a1820ad4e0b9719884811188f3c932592',1,'eos::morphablemodel::PcaModel']]], ['get_5fmean_5fat_5fpoint',['get_mean_at_point',['../classeos_1_1morphablemodel_1_1_pca_model.html#a1820ad4e0b9719884811188f3c932592',1,'eos::morphablemodel::PcaModel']]],
['get_5fnearest_5fcontour_5fcorrespondences',['get_nearest_contour_correspondences',['../namespaceeos_1_1fitting.html#ade368ea637ac45c9e344dde326ffe174',1,'eos::fitting']]],
['get_5fnormalised_5fpca_5fbasis',['get_normalised_pca_basis',['../classeos_1_1morphablemodel_1_1_pca_model.html#af0597eb2cf01c98e397773740f3a8258',1,'eos::morphablemodel::PcaModel::get_normalised_pca_basis() const '],['../classeos_1_1morphablemodel_1_1_pca_model.html#a66e4ef89182a98845a8a6804047f2b77',1,'eos::morphablemodel::PcaModel::get_normalised_pca_basis(int vertex_id) const ']]], ['get_5fnormalised_5fpca_5fbasis',['get_normalised_pca_basis',['../classeos_1_1morphablemodel_1_1_pca_model.html#af0597eb2cf01c98e397773740f3a8258',1,'eos::morphablemodel::PcaModel::get_normalised_pca_basis() const '],['../classeos_1_1morphablemodel_1_1_pca_model.html#a66e4ef89182a98845a8a6804047f2b77',1,'eos::morphablemodel::PcaModel::get_normalised_pca_basis(int vertex_id) const ']]],
['get_5fnum_5fprincipal_5fcomponents',['get_num_principal_components',['../classeos_1_1morphablemodel_1_1_pca_model.html#a309148e123fc5fecd3cf10513f75b657',1,'eos::morphablemodel::PcaModel']]], ['get_5fnum_5fprincipal_5fcomponents',['get_num_principal_components',['../classeos_1_1morphablemodel_1_1_pca_model.html#a309148e123fc5fecd3cf10513f75b657',1,'eos::morphablemodel::PcaModel']]],
['get_5fopencv_5fviewport',['get_opencv_viewport',['../namespaceeos_1_1fitting.html#a4e713b5555396806a9b26817184eacd0',1,'eos::fitting']]], ['get_5fopencv_5fviewport',['get_opencv_viewport',['../namespaceeos_1_1fitting.html#a4e713b5555396806a9b26817184eacd0',1,'eos::fitting']]],
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="functions_5.js"></script> <script type="text/javascript" src="functions_5.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="functions_6.js"></script> <script type="text/javascript" src="functions_6.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['landmarkmapper',['LandmarkMapper',['../classeos_1_1core_1_1_landmark_mapper.html#ab31ea1ec78c463ce54e2372fce103889',1,'eos::core::LandmarkMapper::LandmarkMapper()=default'],['../classeos_1_1core_1_1_landmark_mapper.html#a7da2756a772bd7dd7708bf20fcc95fc4',1,'eos::core::LandmarkMapper::LandmarkMapper(boost::filesystem::path filename)']]], ['landmarkmapper',['LandmarkMapper',['../classeos_1_1core_1_1_landmark_mapper.html#ab31ea1ec78c463ce54e2372fce103889',1,'eos::core::LandmarkMapper::LandmarkMapper()=default'],['../classeos_1_1core_1_1_landmark_mapper.html#a7da2756a772bd7dd7708bf20fcc95fc4',1,'eos::core::LandmarkMapper::LandmarkMapper(boost::filesystem::path filename)']]],
['load',['load',['../namespacecv.html#a7172a20ab6627a1c1967d322bdfc8756',1,'cv']]], ['load',['load',['../structeos_1_1fitting_1_1_model_contour.html#a7a53f075afaeabef19a33b2e914406ce',1,'eos::fitting::ModelContour::load()'],['../structeos_1_1fitting_1_1_contour_landmarks.html#a15bb18f801e64ceaf5e07f73a1374cdb',1,'eos::fitting::ContourLandmarks::load()'],['../namespacecv.html#a9efebfa4f4c3e7117f0effe0ef18fd61',1,'cv::load()']]],
['load_5fblendshapes',['load_blendshapes',['../namespaceeos_1_1morphablemodel.html#a408184d7cae7e40c5c8e76c2bc114811',1,'eos::morphablemodel']]],
['load_5fisomap',['load_isomap',['../namespaceeos_1_1morphablemodel.html#afa73fdf5b394458b7e21639ae50d074c',1,'eos::morphablemodel']]], ['load_5fisomap',['load_isomap',['../namespaceeos_1_1morphablemodel.html#afa73fdf5b394458b7e21639ae50d074c',1,'eos::morphablemodel']]],
['load_5fmodel',['load_model',['../namespaceeos_1_1morphablemodel.html#a0da6e35ec49f1ebdf55f9596540cf8f8',1,'eos::morphablemodel']]], ['load_5fmodel',['load_model',['../namespaceeos_1_1morphablemodel.html#a0da6e35ec49f1ebdf55f9596540cf8f8',1,'eos::morphablemodel']]],
['load_5fscm_5fmodel',['load_scm_model',['../namespaceeos_1_1morphablemodel.html#a0d607b8838d70cd8ec41cb4bfe116f58',1,'eos::morphablemodel']]] ['load_5fscm_5fmodel',['load_scm_model',['../namespaceeos_1_1morphablemodel.html#a0d607b8838d70cd8ec41cb4bfe116f58',1,'eos::morphablemodel']]]
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="functions_7.js"></script> <script type="text/javascript" src="functions_7.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="functions_8.js"></script> <script type="text/javascript" src="functions_8.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['normalise_5fpca_5fbasis',['normalise_pca_basis',['../namespaceeos_1_1morphablemodel.html#a73d9baeb67f25d4604fc291a23e5e2d8',1,'eos::morphablemodel']]] ['normalise_5fpca_5fbasis',['normalise_pca_basis',['../namespaceeos_1_1morphablemodel.html#a31a2b98e73170ae558f6c50e76524817',1,'eos::morphablemodel']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="functions_9.js"></script> <script type="text/javascript" src="functions_9.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="functions_a.js"></script> <script type="text/javascript" src="functions_a.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['render',['render',['../namespaceeos_1_1render.html#a7628a42875570658bea6ffb4f46723e5',1,'eos::render']]], ['render',['render',['../namespaceeos_1_1render.html#a097a630659b6c06a4596ca138f66ec94',1,'eos::render']]],
['render_5faffine',['render_affine',['../namespaceeos_1_1render.html#a1adc532475d45d16f7b0c0eddf1bc7cb',1,'eos::render']]] ['render_5faffine',['render_affine',['../namespaceeos_1_1render.html#a1adc532475d45d16f7b0c0eddf1bc7cb',1,'eos::render']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="functions_b.js"></script> <script type="text/javascript" src="functions_b.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['save',['save',['../namespacecv.html#a62cc822cc258c9305ac746d3a832f9d4',1,'cv']]], ['save',['save',['../namespacecv.html#a758b4418894b35447bfd472847c1dfaf',1,'cv']]],
['save_5fcoefficients',['save_coefficients',['../namespaceeos_1_1morphablemodel.html#a2578fc03dbaa1809873578f17991e278',1,'eos::morphablemodel']]],
['save_5fmodel',['save_model',['../namespaceeos_1_1morphablemodel.html#aad09e0fd0788cb7fea41ed799c653e71',1,'eos::morphablemodel']]], ['save_5fmodel',['save_model',['../namespaceeos_1_1morphablemodel.html#aad09e0fd0788cb7fea41ed799c653e71',1,'eos::morphablemodel']]],
['save_5frendering_5fparameters',['save_rendering_parameters',['../namespaceeos_1_1fitting.html#a03b4bc35b0619e7f4bd0fccbb2d35e2c',1,'eos::fitting']]],
['screen_5fto_5fclip_5fspace',['screen_to_clip_space',['../namespaceeos_1_1render.html#a7c4b923267e9b3b09c0c588bfdd4cb85',1,'eos::render']]], ['screen_5fto_5fclip_5fspace',['screen_to_clip_space',['../namespaceeos_1_1render.html#a7c4b923267e9b3b09c0c588bfdd4cb85',1,'eos::render']]],
['serialize',['serialize',['../namespacecv.html#a51eb61cb95a3e45290a030560ac7a2cd',1,'cv']]], ['select_5fcontour',['select_contour',['../namespaceeos_1_1fitting.html#a6a307eaa4a1a9f2c5e2c33a95a6e261d',1,'eos::fitting']]],
['serialize',['serialize',['../structeos_1_1fitting_1_1_model_contour.html#a079c6e6969f79c123ceb8efc4116d9ea',1,'eos::fitting::ModelContour::serialize()'],['../structeos_1_1fitting_1_1_frustum.html#ad2927fb97762ef726696cf6296b5b9d4',1,'eos::fitting::Frustum::serialize()'],['../structeos_1_1fitting_1_1_rendering_parameters.html#a5d9a13513843bc122a58ebae9801fada',1,'eos::fitting::RenderingParameters::serialize()'],['../structeos_1_1morphablemodel_1_1_blendshape.html#aeccd060e4fa63cf3c417625d118f0602',1,'eos::morphablemodel::Blendshape::serialize()'],['../namespacecv.html#a51eb61cb95a3e45290a030560ac7a2cd',1,'cv::serialize()']]],
['size',['size',['../classeos_1_1core_1_1_landmark_mapper.html#a7e3a46e6aeb522d96066a3d73f4c92c6',1,'eos::core::LandmarkMapper']]] ['size',['size',['../classeos_1_1core_1_1_landmark_mapper.html#a7e3a46e6aeb522d96066a3d73f4c92c6',1,'eos::core::LandmarkMapper']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="functions_c.js"></script> <script type="text/javascript" src="functions_c.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="functions_d.js"></script> <script type="text/javascript" src="functions_d.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['unnormalise_5fpca_5fbasis',['unnormalise_pca_basis',['../namespaceeos_1_1morphablemodel.html#a3d9ed5fa969cbd540ebe9587540f3607',1,'eos::morphablemodel']]] ['unnormalise_5fpca_5fbasis',['unnormalise_pca_basis',['../namespaceeos_1_1morphablemodel.html#a90682d9e8a88243a1113b5a6c149799e',1,'eos::morphablemodel']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="functions_e.js"></script> <script type="text/javascript" src="functions_e.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="namespaces_0.js"></script> <script type="text/javascript" src="namespaces_0.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="namespaces_1.js"></script> <script type="text/javascript" src="namespaces_1.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="pages_0.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
var searchData=
[
['eos_3a_20a_20lightweight_20header_2donly_203d_20morphable_20face_20model_20fitting_20library_20in_20modern_20c_2b_2b11_2f14_2e',['eos: A lightweight header-only 3D Morphable Face Model fitting library in modern C++11/14.',['../index.html',1,'']]]
];
var indexSectionsWithContent = var indexSectionsWithContent =
{ {
0: "cdefghlmnoprstuvw", 0: "bcdefghlmnprstuvw",
1: "flmopt", 1: "bcflmprt",
2: "ce", 2: "ce",
3: "cdefghlmnprstuw", 3: "cdefghlmnprstuw",
4: "cntv", 4: "cdntv",
5: "l", 5: "l",
6: "t" 6: "ct",
7: "e"
}; };
var indexSectionNames = var indexSectionNames =
...@@ -17,7 +18,8 @@ var indexSectionNames = ...@@ -17,7 +18,8 @@ var indexSectionNames =
3: "functions", 3: "functions",
4: "variables", 4: "variables",
5: "typedefs", 5: "typedefs",
6: "enums" 6: "enums",
7: "pages"
}; };
var indexSectionLabels = var indexSectionLabels =
...@@ -28,6 +30,7 @@ var indexSectionLabels = ...@@ -28,6 +30,7 @@ var indexSectionLabels =
3: "Functions", 3: "Functions",
4: "Variables", 4: "Variables",
5: "Typedefs", 5: "Typedefs",
6: "Enumerations" 6: "Enumerations",
7: "Pages"
}; };
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="typedefs_0.js"></script> <script type="text/javascript" src="typedefs_0.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="variables_0.js"></script> <script type="text/javascript" src="variables_0.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="variables_1.js"></script> <script type="text/javascript" src="variables_1.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['name',['name',['../structeos_1_1core_1_1_landmark.html#a85c0f001e311e994314e900dcb284ad3',1,'eos::core::Landmark']]] ['deformation',['deformation',['../structeos_1_1morphablemodel_1_1_blendshape.html#ae5d056f2f0473ddf1c0f000714c0b709',1,'eos::morphablemodel::Blendshape']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="variables_2.js"></script> <script type="text/javascript" src="variables_2.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['tci',['tci',['../structeos_1_1render_1_1_mesh.html#a81c47a35a1b0a6a6cb440cfbb67b8c28',1,'eos::render::Mesh']]], ['name',['name',['../structeos_1_1core_1_1_landmark.html#a85c0f001e311e994314e900dcb284ad3',1,'eos::core::Landmark::name()'],['../structeos_1_1morphablemodel_1_1_blendshape.html#ab87c9b282061a3dd72a8176fffa99594',1,'eos::morphablemodel::Blendshape::name()']]]
['texcoords',['texcoords',['../structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4',1,'eos::render::Mesh']]],
['tvi',['tvi',['../structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b',1,'eos::render::Mesh']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title> <html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/> <link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="variables_3.js"></script> <script type="text/javascript" src="variables_3.js"></script>
<script type="text/javascript" src="search.js"></script> <script type="text/javascript" src="search.js"></script>
......
var searchData= var searchData=
[ [
['vertices',['vertices',['../structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e',1,'eos::render::Mesh']]] ['tci',['tci',['../structeos_1_1render_1_1_mesh.html#a81c47a35a1b0a6a6cb440cfbb67b8c28',1,'eos::render::Mesh']]],
['texcoords',['texcoords',['../structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4',1,'eos::render::Mesh']]],
['tvi',['tvi',['../structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b',1,'eos::render::Mesh']]]
]; ];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="variables_4.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
var searchData=
[
['vertices',['vertices',['../structeos_1_1render_1_1_mesh.html#a305d17e6453f6be320331e00e8c8816e',1,'eos::render::Mesh']]]
];
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: Member List</title> <title>eos: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -107,7 +107,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -107,7 +107,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: eos::core::Landmark&lt; LandmarkType &gt; Struct Template Reference</title> <title>eos: eos::core::Landmark&lt; LandmarkType &gt; Struct Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -130,7 +130,7 @@ struct eos::core::Landmark&lt; LandmarkType &gt;</h3> ...@@ -130,7 +130,7 @@ struct eos::core::Landmark&lt; LandmarkType &gt;</h3>
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/fitting Directory Reference</title> <title>eos: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="dynsections.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -46,7 +46,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -46,7 +46,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<ul class="tablist"> <ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li> <li><a href="files.html"><span>Files</span></a></li>
<li> <li>
<div id="MSearchBox" class="MSearchBoxInactive"> <div id="MSearchBox" class="MSearchBoxInactive">
...@@ -66,6 +66,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -66,6 +66,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</li> </li>
</ul> </ul>
</div> </div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options --> <!-- window showing the filter options -->
<div id="MSearchSelectWindow" <div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()" onmouseover="return searchBox.OnSearchSelectShow()"
...@@ -82,30 +89,26 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -82,30 +89,26 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div id="nav-path" class="navpath"> <div id="nav-path" class="navpath">
<ul> <ul>
<li class="navelem"><a class="el" href="dir_ce53d3124a8ddb93985ce6ec479297f4.html">include</a></li><li class="navelem"><a class="el" href="dir_c7ebde285fcef06dba0b090642612638.html">eos</a></li><li class="navelem"><a class="el" href="dir_349d8dd52ed72e674b9a830f9a7a4dcc.html">fitting</a></li> </ul> <li class="navelem"><a class="el" href="namespaceeos.html">eos</a></li><li class="navelem"><a class="el" href="namespaceeos_1_1fitting.html">fitting</a></li><li class="navelem"><a class="el" href="structeos_1_1fitting_1_1_contour_landmarks.html">ContourLandmarks</a></li> </ul>
</div> </div>
</div><!-- top --> </div><!-- top -->
<div class="header"> <div class="header">
<div class="headertitle"> <div class="headertitle">
<div class="title">fitting Directory Reference</div> </div> <div class="title">eos::fitting::ContourLandmarks Member List</div> </div>
</div><!--header--> </div><!--header-->
<div class="contents"> <div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a> <p>This is the complete list of members for <a class="el" href="structeos_1_1fitting_1_1_contour_landmarks.html">eos::fitting::ContourLandmarks</a>, including all inherited members.</p>
Files</h2></td></tr> <table class="directory">
<tr class="memitem:affine__camera__estimation_8hpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>affine_camera_estimation.hpp</b> <a href="affine__camera__estimation_8hpp_source.html">[code]</a></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>left_contour</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_contour_landmarks.html">eos::fitting::ContourLandmarks</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_contour_landmarks.html">eos::fitting::ContourLandmarks</a></td><td class="entry"></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_contour_landmarks.html#a15bb18f801e64ceaf5e07f73a1374cdb">load</a>(std::string filename)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_contour_landmarks.html">eos::fitting::ContourLandmarks</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr>
<tr class="memitem:linear__shape__fitting_8hpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>linear_shape_fitting.hpp</b> <a href="linear__shape__fitting_8hpp_source.html">[code]</a></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>right_contour</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_contour_landmarks.html">eos::fitting::ContourLandmarks</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_contour_landmarks.html">eos::fitting::ContourLandmarks</a></td><td class="entry"></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> </table></div><!-- contents -->
<tr class="memitem:nonlinear__camera__estimation_8hpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>nonlinear_camera_estimation.hpp</b> <a href="nonlinear__camera__estimation_8hpp_source.html">[code]</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
<!-- start footer part --> <!-- start footer part -->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: eos::fitting::ContourLandmarks Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos
&#160;<span id="projectnumber">0.7.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespaceeos.html">eos</a></li><li class="navelem"><a class="el" href="namespaceeos_1_1fitting.html">fitting</a></li><li class="navelem"><a class="el" href="structeos_1_1fitting_1_1_contour_landmarks.html">ContourLandmarks</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="structeos_1_1fitting_1_1_contour_landmarks-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">eos::fitting::ContourLandmarks Struct Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Defines which 2D landmarks comprise the right and left face contour.
<a href="structeos_1_1fitting_1_1_contour_landmarks.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="contour__correspondence_8hpp_source.html">contour_correspondence.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a15bb18f801e64ceaf5e07f73a1374cdb"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="structeos_1_1fitting_1_1_contour_landmarks.html">ContourLandmarks</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1fitting_1_1_contour_landmarks.html#a15bb18f801e64ceaf5e07f73a1374cdb">load</a> (std::string filename)</td></tr>
<tr class="separator:a15bb18f801e64ceaf5e07f73a1374cdb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a7c6e7800311784f200a682cddf3975dd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7c6e7800311784f200a682cddf3975dd"></a>
std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>right_contour</b></td></tr>
<tr class="separator:a7c6e7800311784f200a682cddf3975dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad4895901846d95ad892046390863e705"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad4895901846d95ad892046390863e705"></a>
std::vector&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>left_contour</b></td></tr>
<tr class="separator:ad4895901846d95ad892046390863e705"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Defines which 2D landmarks comprise the right and left face contour. </p>
<p>This class holds 2D image contour landmark information. More specifically, it defines which 2D landmark IDs correspond to the right contour and which to the left. These definitions are loaded from a file, for example from the "contour_landmarks" part of share/ibug2did.txt.</p>
<p>Note: Better names could be ContourDefinition or ImageContourLandmarks, to disambiguate 3D and 2D landmarks? </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a15bb18f801e64ceaf5e07f73a1374cdb"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="structeos_1_1fitting_1_1_contour_landmarks.html">ContourLandmarks</a> eos::fitting::ContourLandmarks::load </td>
<td>(</td>
<td class="paramtype">std::string&#160;</td>
<td class="paramname"><em>filename</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Helper method to load contour landmarks from a text file with landmark mappings, like ibug2did.txt.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">filename</td><td>Filename to a landmark-mapping file. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A <a class="el" href="structeos_1_1fitting_1_1_contour_landmarks.html" title="Defines which 2D landmarks comprise the right and left face contour. ">ContourLandmarks</a> instance with loaded 2D contour landmarks. </dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">std::runtime_error</td><td>When the file given in <code>filename</code> fails to be opened (most likely because the file doesn't exist). </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>include/eos/fitting/<a class="el" href="contour__correspondence_8hpp_source.html">contour_correspondence.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: Member List</title> <title>eos: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -101,15 +101,19 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -101,15 +101,19 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<p>This is the complete list of members for <a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a>, including all inherited members.</p> <p>This is the complete list of members for <a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a>, including all inherited members.</p>
<table class="directory"> <table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>b</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>b</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>cereal::access</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a></td><td class="entry"><span class="mlabel">friend</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>f</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>l</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>l</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>r</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>n</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>r</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_frustum.html#ad2927fb97762ef726696cf6296b5b9d4">serialize</a>(Archive &amp;archive)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>t</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>t</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_frustum.html">eos::fitting::Frustum</a></td><td class="entry"></td></tr>
</table></div><!-- contents --> </table></div><!-- contents -->
<!-- start footer part --> <!-- start footer part -->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: eos::fitting::Frustum Struct Reference</title> <title>eos: eos::fitting::Frustum Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -94,7 +94,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -94,7 +94,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</div><!-- top --> </div><!-- top -->
<div class="header"> <div class="header">
<div class="summary"> <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124; <a href="#pub-attribs">Public Attributes</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="structeos_1_1fitting_1_1_frustum-members.html">List of all members</a> </div> <a href="structeos_1_1fitting_1_1_frustum-members.html">List of all members</a> </div>
<div class="headertitle"> <div class="headertitle">
<div class="title">eos::fitting::Frustum Struct Reference</div> </div> <div class="title">eos::fitting::Frustum Struct Reference</div> </div>
...@@ -106,6 +108,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -106,6 +108,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<p><code>#include &lt;<a class="el" href="nonlinear__camera__estimation_8hpp_source.html">nonlinear_camera_estimation.hpp</a>&gt;</code></p> <p><code>#include &lt;<a class="el" href="nonlinear__camera__estimation_8hpp_source.html">nonlinear_camera_estimation.hpp</a>&gt;</code></p>
<table class="memberdecls"> <table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ad2927fb97762ef726696cf6296b5b9d4"><td class="memTemplParams" colspan="2">template&lt;class Archive &gt; </td></tr>
<tr class="memitem:ad2927fb97762ef726696cf6296b5b9d4"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structeos_1_1fitting_1_1_frustum.html#ad2927fb97762ef726696cf6296b5b9d4">serialize</a> (Archive &amp;archive)</td></tr>
<tr class="separator:ad2927fb97762ef726696cf6296b5b9d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr> Public Attributes</h2></td></tr>
<tr class="memitem:a91187e9a49672711d7f23bd4f4a8c738"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a91187e9a49672711d7f23bd4f4a8c738"></a> <tr class="memitem:a91187e9a49672711d7f23bd4f4a8c738"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a91187e9a49672711d7f23bd4f4a8c738"></a>
...@@ -120,10 +128,56 @@ float&#160;</td><td class="memItemRight" valign="bottom"><b>b</b></td></tr> ...@@ -120,10 +128,56 @@ float&#160;</td><td class="memItemRight" valign="bottom"><b>b</b></td></tr>
<tr class="memitem:a6af2a4dd568ec950ce05129071a92e28"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6af2a4dd568ec950ce05129071a92e28"></a> <tr class="memitem:a6af2a4dd568ec950ce05129071a92e28"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6af2a4dd568ec950ce05129071a92e28"></a>
float&#160;</td><td class="memItemRight" valign="bottom"><b>t</b></td></tr> float&#160;</td><td class="memItemRight" valign="bottom"><b>t</b></td></tr>
<tr class="separator:a6af2a4dd568ec950ce05129071a92e28"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a6af2a4dd568ec950ce05129071a92e28"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8392bd430abb17ed4c48361974841ad"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa8392bd430abb17ed4c48361974841ad"></a>
boost::optional&lt; float &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>n</b></td></tr>
<tr class="separator:aa8392bd430abb17ed4c48361974841ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1237827333a45484835ccdb34f8eef0b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1237827333a45484835ccdb34f8eef0b"></a>
boost::optional&lt; float &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>f</b></td></tr>
<tr class="separator:a1237827333a45484835ccdb34f8eef0b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:ab2f44cbb59a08132f4c843e5225bba0e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab2f44cbb59a08132f4c843e5225bba0e"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>cereal::access</b></td></tr>
<tr class="separator:ab2f44cbb59a08132f4c843e5225bba0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table> </table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A class representing a camera viewing frustum. At the moment used as orthographic camera only. </p> <div class="textblock"><p>A class representing a camera viewing frustum. At the moment used as orthographic camera only. </p>
</div><hr/>The documentation for this struct was generated from the following file:<ul> </div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ad2927fb97762ef726696cf6296b5b9d4"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Archive &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void eos::fitting::Frustum::serialize </td>
<td>(</td>
<td class="paramtype">Archive &amp;&#160;</td>
<td class="paramname"><em>archive</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Serialises this class using cereal.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">archive</td><td>The archive to serialise to (or to serialise from). </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>include/eos/fitting/<a class="el" href="nonlinear__camera__estimation_8hpp_source.html">nonlinear_camera_estimation.hpp</a></li> <li>include/eos/fitting/<a class="el" href="nonlinear__camera__estimation_8hpp_source.html">nonlinear_camera_estimation.hpp</a></li>
</ul> </ul>
</div><!-- contents --> </div><!-- contents -->
...@@ -131,7 +185,7 @@ float&#160;</td><td class="memItemRight" valign="bottom"><b>t</b></td></tr> ...@@ -131,7 +185,7 @@ float&#160;</td><td class="memItemRight" valign="bottom"><b>t</b></td></tr>
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: Member List</title> <title>eos: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -89,29 +89,28 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -89,29 +89,28 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div id="nav-path" class="navpath"> <div id="nav-path" class="navpath">
<ul> <ul>
<li class="navelem"><a class="el" href="namespaceeos.html">eos</a></li><li class="navelem"><a class="el" href="namespaceeos_1_1fitting.html">fitting</a></li><li class="navelem"><a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">OrthographicRenderingParameters</a></li> </ul> <li class="navelem"><a class="el" href="namespaceeos.html">eos</a></li><li class="navelem"><a class="el" href="namespaceeos_1_1fitting.html">fitting</a></li><li class="navelem"><a class="el" href="structeos_1_1fitting_1_1_model_contour.html">ModelContour</a></li> </ul>
</div> </div>
</div><!-- top --> </div><!-- top -->
<div class="header"> <div class="header">
<div class="headertitle"> <div class="headertitle">
<div class="title">eos::fitting::OrthographicRenderingParameters Member List</div> </div> <div class="title">eos::fitting::ModelContour Member List</div> </div>
</div><!--header--> </div><!--header-->
<div class="contents"> <div class="contents">
<p>This is the complete list of members for <a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">eos::fitting::OrthographicRenderingParameters</a>, including all inherited members.</p> <p>This is the complete list of members for <a class="el" href="structeos_1_1fitting_1_1_model_contour.html">eos::fitting::ModelContour</a>, including all inherited members.</p>
<table class="directory"> <table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>frustum</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">eos::fitting::OrthographicRenderingParameters</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">eos::fitting::OrthographicRenderingParameters</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>cereal::access</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_model_contour.html">eos::fitting::ModelContour</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_model_contour.html">eos::fitting::ModelContour</a></td><td class="entry"><span class="mlabel">friend</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>r_x</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">eos::fitting::OrthographicRenderingParameters</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">eos::fitting::OrthographicRenderingParameters</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>left_contour</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_model_contour.html">eos::fitting::ModelContour</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_model_contour.html">eos::fitting::ModelContour</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>r_y</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">eos::fitting::OrthographicRenderingParameters</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">eos::fitting::OrthographicRenderingParameters</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_model_contour.html#a7a53f075afaeabef19a33b2e914406ce">load</a>(std::string filename)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_model_contour.html">eos::fitting::ModelContour</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>r_z</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">eos::fitting::OrthographicRenderingParameters</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">eos::fitting::OrthographicRenderingParameters</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>right_contour</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_model_contour.html">eos::fitting::ModelContour</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_model_contour.html">eos::fitting::ModelContour</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>t_x</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">eos::fitting::OrthographicRenderingParameters</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">eos::fitting::OrthographicRenderingParameters</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_model_contour.html#a079c6e6969f79c123ceb8efc4116d9ea">serialize</a>(Archive &amp;archive)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_model_contour.html">eos::fitting::ModelContour</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>t_y</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">eos::fitting::OrthographicRenderingParameters</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">eos::fitting::OrthographicRenderingParameters</a></td><td class="entry"></td></tr>
</table></div><!-- contents --> </table></div><!-- contents -->
<!-- start footer part --> <!-- start footer part -->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: eos::fitting::ModelContour Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos
&#160;<span id="projectnumber">0.7.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespaceeos.html">eos</a></li><li class="navelem"><a class="el" href="namespaceeos_1_1fitting.html">fitting</a></li><li class="navelem"><a class="el" href="structeos_1_1fitting_1_1_model_contour.html">ModelContour</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="structeos_1_1fitting_1_1_model_contour-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">eos::fitting::ModelContour Struct Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Definition of the vertex indices that define the right and left model contour.
<a href="structeos_1_1fitting_1_1_model_contour.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="contour__correspondence_8hpp_source.html">contour_correspondence.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a079c6e6969f79c123ceb8efc4116d9ea"><td class="memTemplParams" colspan="2">template&lt;class Archive &gt; </td></tr>
<tr class="memitem:a079c6e6969f79c123ceb8efc4116d9ea"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structeos_1_1fitting_1_1_model_contour.html#a079c6e6969f79c123ceb8efc4116d9ea">serialize</a> (Archive &amp;archive)</td></tr>
<tr class="separator:a079c6e6969f79c123ceb8efc4116d9ea"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a7a53f075afaeabef19a33b2e914406ce"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="structeos_1_1fitting_1_1_model_contour.html">ModelContour</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1fitting_1_1_model_contour.html#a7a53f075afaeabef19a33b2e914406ce">load</a> (std::string filename)</td></tr>
<tr class="separator:a7a53f075afaeabef19a33b2e914406ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:aa3da72cfb1c1682909a53da398d7f889"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa3da72cfb1c1682909a53da398d7f889"></a>
std::vector&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>right_contour</b></td></tr>
<tr class="separator:aa3da72cfb1c1682909a53da398d7f889"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8e5b31c98e01060e9b4cf2265810c44c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8e5b31c98e01060e9b4cf2265810c44c"></a>
std::vector&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>left_contour</b></td></tr>
<tr class="separator:a8e5b31c98e01060e9b4cf2265810c44c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:ab2f44cbb59a08132f4c843e5225bba0e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab2f44cbb59a08132f4c843e5225bba0e"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>cereal::access</b></td></tr>
<tr class="separator:ab2f44cbb59a08132f4c843e5225bba0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Definition of the vertex indices that define the right and left model contour. </p>
<p>This class holds definitions for the contour (outline) on the right and left side of the reference 3D face model. These can be found in the file share/model_contours.json. The Surrey model's boundaries are conveniently approximately located near the actual 2D image contour, for the front-facing contour.</p>
<p>Note: We should extend that to the 1724 model to get a few more points, this should improve the contour fitting. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a7a53f075afaeabef19a33b2e914406ce"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="structeos_1_1fitting_1_1_model_contour.html">ModelContour</a> eos::fitting::ModelContour::load </td>
<td>(</td>
<td class="paramtype">std::string&#160;</td>
<td class="paramname"><em>filename</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Helper method to load a <a class="el" href="structeos_1_1fitting_1_1_model_contour.html" title="Definition of the vertex indices that define the right and left model contour. ">ModelContour</a> from a json file from the hard drive.</p>
<p>Eventually, it might be included in the MorphableModel class.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">filename</td><td>Filename to a model. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The loaded <a class="el" href="structeos_1_1fitting_1_1_model_contour.html" title="Definition of the vertex indices that define the right and left model contour. ">ModelContour</a>. </dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">std::runtime_error</td><td>When the file given in <code>filename</code> fails to be opened (most likely because the file doesn't exist). </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a079c6e6969f79c123ceb8efc4116d9ea"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Archive &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void eos::fitting::ModelContour::serialize </td>
<td>(</td>
<td class="paramtype">Archive &amp;&#160;</td>
<td class="paramname"><em>archive</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Serialises this class using cereal.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">archive</td><td>The archive to serialise to (or to serialise from). </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>include/eos/fitting/<a class="el" href="contour__correspondence_8hpp_source.html">contour_correspondence.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos
&#160;<span id="projectnumber">0.7.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespaceeos.html">eos</a></li><li class="navelem"><a class="el" href="namespaceeos_1_1fitting.html">fitting</a></li><li class="navelem"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">RenderingParameters</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">eos::fitting::RenderingParameters Member List</div> </div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a>, including all inherited members.</p>
<table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>camera_type</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>cereal::access</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a></td><td class="entry"><span class="mlabel">friend</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>focal_length</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>frustum</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>r_x</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>r_y</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>r_z</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>screen_height</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>screen_width</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html#a5d9a13513843bc122a58ebae9801fada">serialize</a>(Archive &amp;archive)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>t_x</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>t_y</b> (defined in <a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a>)</td><td class="entry"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">eos::fitting::RenderingParameters</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: eos::fitting::OrthographicRenderingParameters Struct Reference</title> <title>eos: eos::fitting::RenderingParameters Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="dynsections.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -89,51 +89,112 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -89,51 +89,112 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div id="nav-path" class="navpath"> <div id="nav-path" class="navpath">
<ul> <ul>
<li class="navelem"><a class="el" href="namespaceeos.html">eos</a></li><li class="navelem"><a class="el" href="namespaceeos_1_1fitting.html">fitting</a></li><li class="navelem"><a class="el" href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html">OrthographicRenderingParameters</a></li> </ul> <li class="navelem"><a class="el" href="namespaceeos.html">eos</a></li><li class="navelem"><a class="el" href="namespaceeos_1_1fitting.html">fitting</a></li><li class="navelem"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html">RenderingParameters</a></li> </ul>
</div> </div>
</div><!-- top --> </div><!-- top -->
<div class="header"> <div class="header">
<div class="summary"> <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124; <a href="#pub-attribs">Public Attributes</a> &#124;
<a href="structeos_1_1fitting_1_1_orthographic_rendering_parameters-members.html">List of all members</a> </div> <a href="#friends">Friends</a> &#124;
<a href="structeos_1_1fitting_1_1_rendering_parameters-members.html">List of all members</a> </div>
<div class="headertitle"> <div class="headertitle">
<div class="title">eos::fitting::OrthographicRenderingParameters Struct Reference</div> </div> <div class="title">eos::fitting::RenderingParameters Struct Reference</div> </div>
</div><!--header--> </div><!--header-->
<div class="contents"> <div class="contents">
<p>Represents a set of estimated model parameters (rotation, translation) and camera parameters (viewing frustum). <p>Represents a set of estimated model parameters (rotation, translation) and camera parameters (viewing frustum).
<a href="structeos_1_1fitting_1_1_orthographic_rendering_parameters.html#details">More...</a></p> <a href="structeos_1_1fitting_1_1_rendering_parameters.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="nonlinear__camera__estimation_8hpp_source.html">nonlinear_camera_estimation.hpp</a>&gt;</code></p> <p><code>#include &lt;<a class="el" href="nonlinear__camera__estimation_8hpp_source.html">nonlinear_camera_estimation.hpp</a>&gt;</code></p>
<table class="memberdecls"> <table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a5d9a13513843bc122a58ebae9801fada"><td class="memTemplParams" colspan="2">template&lt;class Archive &gt; </td></tr>
<tr class="memitem:a5d9a13513843bc122a58ebae9801fada"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structeos_1_1fitting_1_1_rendering_parameters.html#a5d9a13513843bc122a58ebae9801fada">serialize</a> (Archive &amp;archive)</td></tr>
<tr class="separator:a5d9a13513843bc122a58ebae9801fada"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr> Public Attributes</h2></td></tr>
<tr class="memitem:afffe9dd0da1723c91f7d977f92280300"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afffe9dd0da1723c91f7d977f92280300"></a> <tr class="memitem:a648a7f98bb13854f3f743555eb04dc1c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a648a7f98bb13854f3f743555eb04dc1c"></a>
<a class="el" href="namespaceeos_1_1fitting.html#a63fce336daef96cde45f61701c4a3cf4">CameraType</a>&#160;</td><td class="memItemRight" valign="bottom"><b>camera_type</b></td></tr>
<tr class="separator:a648a7f98bb13854f3f743555eb04dc1c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a62c3c29794e43c4fa7bfafd7d8a49a0b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a62c3c29794e43c4fa7bfafd7d8a49a0b"></a>
<a class="el" href="structeos_1_1fitting_1_1_frustum.html">Frustum</a>&#160;</td><td class="memItemRight" valign="bottom"><b>frustum</b></td></tr>
<tr class="separator:a62c3c29794e43c4fa7bfafd7d8a49a0b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac3dc3cc45459949830c0611a8a23556c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac3dc3cc45459949830c0611a8a23556c"></a>
float&#160;</td><td class="memItemRight" valign="bottom"><b>r_x</b></td></tr> float&#160;</td><td class="memItemRight" valign="bottom"><b>r_x</b></td></tr>
<tr class="separator:afffe9dd0da1723c91f7d977f92280300"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:ac3dc3cc45459949830c0611a8a23556c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a56c72b4cae779e20fdf5767bca14f549"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a56c72b4cae779e20fdf5767bca14f549"></a> <tr class="memitem:a883b3a61526006d57ba6b63dc6edc09c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a883b3a61526006d57ba6b63dc6edc09c"></a>
float&#160;</td><td class="memItemRight" valign="bottom"><b>r_y</b></td></tr> float&#160;</td><td class="memItemRight" valign="bottom"><b>r_y</b></td></tr>
<tr class="separator:a56c72b4cae779e20fdf5767bca14f549"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a883b3a61526006d57ba6b63dc6edc09c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae2b93d0df572cdb24864e77242deff84"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae2b93d0df572cdb24864e77242deff84"></a> <tr class="memitem:a1c82c9cb2e135f780bc6afa2fef18444"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1c82c9cb2e135f780bc6afa2fef18444"></a>
float&#160;</td><td class="memItemRight" valign="bottom"><b>r_z</b></td></tr> float&#160;</td><td class="memItemRight" valign="bottom"><b>r_z</b></td></tr>
<tr class="separator:ae2b93d0df572cdb24864e77242deff84"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a1c82c9cb2e135f780bc6afa2fef18444"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acd2fd09cecf0b601c779c031dccd263c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acd2fd09cecf0b601c779c031dccd263c"></a> <tr class="memitem:a34436d3a715d819f9dac38f0aad5f426"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a34436d3a715d819f9dac38f0aad5f426"></a>
float&#160;</td><td class="memItemRight" valign="bottom"><b>t_x</b></td></tr> float&#160;</td><td class="memItemRight" valign="bottom"><b>t_x</b></td></tr>
<tr class="separator:acd2fd09cecf0b601c779c031dccd263c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a34436d3a715d819f9dac38f0aad5f426"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa13470874f9c1246c1e14f788da6c228"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa13470874f9c1246c1e14f788da6c228"></a> <tr class="memitem:a945e622ff15f67217d14f3b9b6628066"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a945e622ff15f67217d14f3b9b6628066"></a>
float&#160;</td><td class="memItemRight" valign="bottom"><b>t_y</b></td></tr> float&#160;</td><td class="memItemRight" valign="bottom"><b>t_y</b></td></tr>
<tr class="separator:aa13470874f9c1246c1e14f788da6c228"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a945e622ff15f67217d14f3b9b6628066"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9196501da2716cbcf9e2cfcf04f1eae1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9196501da2716cbcf9e2cfcf04f1eae1"></a> <tr class="memitem:a62d9c87bcf25a70a356282c3fd3cc40f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a62d9c87bcf25a70a356282c3fd3cc40f"></a>
<a class="el" href="structeos_1_1fitting_1_1_frustum.html">Frustum</a>&#160;</td><td class="memItemRight" valign="bottom"><b>frustum</b></td></tr> int&#160;</td><td class="memItemRight" valign="bottom"><b>screen_width</b></td></tr>
<tr class="separator:a9196501da2716cbcf9e2cfcf04f1eae1"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a62d9c87bcf25a70a356282c3fd3cc40f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ace70c9e50b3837c08dc3bf35d2748836"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ace70c9e50b3837c08dc3bf35d2748836"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>screen_height</b></td></tr>
<tr class="separator:ace70c9e50b3837c08dc3bf35d2748836"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9ddcfb7508904fb6311837edd3fd71a8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9ddcfb7508904fb6311837edd3fd71a8"></a>
boost::optional&lt; float &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>focal_length</b></td></tr>
<tr class="separator:a9ddcfb7508904fb6311837edd3fd71a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:ab2f44cbb59a08132f4c843e5225bba0e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab2f44cbb59a08132f4c843e5225bba0e"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>cereal::access</b></td></tr>
<tr class="separator:ab2f44cbb59a08132f4c843e5225bba0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table> </table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Represents a set of estimated model parameters (rotation, translation) and camera parameters (viewing frustum). </p> <div class="textblock"><p>Represents a set of estimated model parameters (rotation, translation) and camera parameters (viewing frustum). </p>
<p>The estimated rotation and translation transform the model from model-space to camera-space, and, if one wishes to use OpenGL, can be used to build the model-view matrix. The parameters are the inverse of the camera position in 3D space.</p> <p>The estimated rotation and translation transform the model from model-space to camera-space, and, if one wishes to use OpenGL, can be used to build the model-view matrix. The parameters are the inverse of the camera position in 3D space.</p>
<p>The camera frustum describes the size of the viewing plane of the camera, and can be used to build an OpenGL-conformant orthographic projection matrix.</p> <p>The camera frustum describes the size of the viewing plane of the camera, and can be used to build an OpenGL-conformant orthographic projection matrix.</p>
<p>Together, these parameters fully describe the imaging process of a given model instance (under an orthographic projection).</p> <p>Together, these parameters fully describe the imaging process of a given model instance (under an orthographic projection).</p>
<p>The rotation values are given in radians and estimated using the RPY convention. Yaw is applied first to the model, then pitch, then roll (R * P * Y * vertex). </p> <p>The rotation values are given in radians and estimated using the RPY convention. Yaw is applied first to the model, then pitch, then roll (R * P * Y * vertex).</p>
</div><hr/>The documentation for this struct was generated from the following file:<ul> <p>Todo: This class may need a major overhaul so it supports all our fitting algorithms, some of them which use quaternions, others estimate the angles, as well as work with both orthographic and perspective projection. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a5d9a13513843bc122a58ebae9801fada"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Archive &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void eos::fitting::RenderingParameters::serialize </td>
<td>(</td>
<td class="paramtype">Archive &amp;&#160;</td>
<td class="paramname"><em>archive</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Serialises this class using cereal.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">archive</td><td>The archive to serialise to (or to serialise from). </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>include/eos/fitting/<a class="el" href="nonlinear__camera__estimation_8hpp_source.html">nonlinear_camera_estimation.hpp</a></li> <li>include/eos/fitting/<a class="el" href="nonlinear__camera__estimation_8hpp_source.html">nonlinear_camera_estimation.hpp</a></li>
</ul> </ul>
</div><!-- contents --> </div><!-- contents -->
...@@ -141,7 +202,7 @@ float&#160;</td><td class="memItemRight" valign="bottom"><b>t_y</b></td></tr> ...@@ -141,7 +202,7 @@ float&#160;</td><td class="memItemRight" valign="bottom"><b>t_y</b></td></tr>
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos
&#160;<span id="projectnumber">0.7.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespaceeos.html">eos</a></li><li class="navelem"><a class="el" href="namespaceeos_1_1morphablemodel.html">morphablemodel</a></li><li class="navelem"><a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html">Blendshape</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">eos::morphablemodel::Blendshape Member List</div> </div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html">eos::morphablemodel::Blendshape</a>, including all inherited members.</p>
<table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>cereal::access</b> (defined in <a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html">eos::morphablemodel::Blendshape</a>)</td><td class="entry"><a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html">eos::morphablemodel::Blendshape</a></td><td class="entry"><span class="mlabel">friend</span></td></tr>
<tr><td class="entry"><a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html#ae5d056f2f0473ddf1c0f000714c0b709">deformation</a></td><td class="entry"><a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html">eos::morphablemodel::Blendshape</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html#ab87c9b282061a3dd72a8176fffa99594">name</a></td><td class="entry"><a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html">eos::morphablemodel::Blendshape</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html#aeccd060e4fa63cf3c417625d118f0602">serialize</a>(Archive &amp;archive)</td><td class="entry"><a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html">eos::morphablemodel::Blendshape</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: eos::morphablemodel::Blendshape Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos
&#160;<span id="projectnumber">0.7.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespaceeos.html">eos</a></li><li class="navelem"><a class="el" href="namespaceeos_1_1morphablemodel.html">morphablemodel</a></li><li class="navelem"><a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html">Blendshape</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="structeos_1_1morphablemodel_1_1_blendshape-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">eos::morphablemodel::Blendshape Struct Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>A class representing a 3D blendshape.
<a href="structeos_1_1morphablemodel_1_1_blendshape.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="_blendshape_8hpp_source.html">Blendshape.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aeccd060e4fa63cf3c417625d118f0602"><td class="memTemplParams" colspan="2">template&lt;class Archive &gt; </td></tr>
<tr class="memitem:aeccd060e4fa63cf3c417625d118f0602"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html#aeccd060e4fa63cf3c417625d118f0602">serialize</a> (Archive &amp;archive)</td></tr>
<tr class="separator:aeccd060e4fa63cf3c417625d118f0602"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:ab87c9b282061a3dd72a8176fffa99594"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab87c9b282061a3dd72a8176fffa99594"></a>
std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html#ab87c9b282061a3dd72a8176fffa99594">name</a></td></tr>
<tr class="memdesc:ab87c9b282061a3dd72a8176fffa99594"><td class="mdescLeft">&#160;</td><td class="mdescRight">Name of the blendshape. <br /></td></tr>
<tr class="separator:ab87c9b282061a3dd72a8176fffa99594"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae5d056f2f0473ddf1c0f000714c0b709"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae5d056f2f0473ddf1c0f000714c0b709"></a>
cv::Mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1morphablemodel_1_1_blendshape.html#ae5d056f2f0473ddf1c0f000714c0b709">deformation</a></td></tr>
<tr class="memdesc:ae5d056f2f0473ddf1c0f000714c0b709"><td class="mdescLeft">&#160;</td><td class="mdescRight">A 3m x 1 col-vector (xyzxyz...)', where m is the number of model-vertices. Has the same format as PcaModel::mean. <br /></td></tr>
<tr class="separator:ae5d056f2f0473ddf1c0f000714c0b709"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:ab2f44cbb59a08132f4c843e5225bba0e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab2f44cbb59a08132f4c843e5225bba0e"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>cereal::access</b></td></tr>
<tr class="separator:ab2f44cbb59a08132f4c843e5225bba0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A class representing a 3D blendshape. </p>
<p>A blendshape is a vector of offsets that transform the vertices of a given mesh or shape instance. Usually, a blendshape is associated with a deformation like a particular facial expression or a phoneme. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="aeccd060e4fa63cf3c417625d118f0602"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Archive &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void eos::morphablemodel::Blendshape::serialize </td>
<td>(</td>
<td class="paramtype">Archive &amp;&#160;</td>
<td class="paramname"><em>archive</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Serialises this class using cereal.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">archive</td><td>The archive to serialise to (or to serialise from). </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>include/eos/morphablemodel/<a class="el" href="_blendshape_8hpp_source.html">Blendshape.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: Member List</title> <title>eos: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -110,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -110,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: eos::render::Mesh Struct Reference</title> <title>eos: eos::render::Mesh Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -118,7 +118,7 @@ std::vector&lt; cv::Vec3f &gt;&#160;</td><td class="memItemRight" valign="bottom ...@@ -118,7 +118,7 @@ std::vector&lt; cv::Vec3f &gt;&#160;</td><td class="memItemRight" valign="bottom
<tr class="separator:ae3b0e946a77b4f434b382b315ea7c24b"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:ae3b0e946a77b4f434b382b315ea7c24b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a64fddf0a7200e7f66b0426773542eea4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a64fddf0a7200e7f66b0426773542eea4"></a> <tr class="memitem:a64fddf0a7200e7f66b0426773542eea4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a64fddf0a7200e7f66b0426773542eea4"></a>
std::vector&lt; cv::Vec2f &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a></td></tr> std::vector&lt; cv::Vec2f &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a></td></tr>
<tr class="memdesc:a64fddf0a7200e7f66b0426773542eea4"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classeos_1_1render_1_1_texture.html">Texture</a> coordinates for each vertex. <br /></td></tr> <tr class="memdesc:a64fddf0a7200e7f66b0426773542eea4"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classeos_1_1render_1_1_texture.html" title="Represents a texture for rendering. ">Texture</a> coordinates for each vertex. <br /></td></tr>
<tr class="separator:a64fddf0a7200e7f66b0426773542eea4"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:a64fddf0a7200e7f66b0426773542eea4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab6fb80c460656bf7830a526f0692681b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab6fb80c460656bf7830a526f0692681b"></a> <tr class="memitem:ab6fb80c460656bf7830a526f0692681b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab6fb80c460656bf7830a526f0692681b"></a>
std::vector&lt; std::array&lt; int, 3 &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">tvi</a></td></tr> std::vector&lt; std::array&lt; int, 3 &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">tvi</a></td></tr>
...@@ -140,7 +140,7 @@ std::vector&lt; std::array&lt; int, 3 &gt; &gt;&#160;</td><td class="memItemRigh ...@@ -140,7 +140,7 @@ std::vector&lt; std::array&lt; int, 3 &gt; &gt;&#160;</td><td class="memItemRigh
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/> <meta name="generator" content="Doxygen 1.8.11"/>
<title>eos: include/eos/render/utils.hpp Source File</title> <title>eos: include/eos/render/utils.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.js"></script>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extensions: ["tex2jax.js"], extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"], jax: ["input/TeX","output/HTML-CSS"],
}); });
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script> </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr style="height: 56px;"> <tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;"> <td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">eos <div id="projectname">eos
&#160;<span id="projectnumber">0.6.0</span> &#160;<span id="projectnumber">0.7.1</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<!-- end header part --> <!-- end header part -->
<!-- Generated by Doxygen 1.8.10 --> <!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript"> <script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search'); var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script> </script>
...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div id="nav-path" class="navpath"> <div id="nav-path" class="navpath">
<ul> <ul>
<li class="navelem"><a class="el" href="dir_ce53d3124a8ddb93985ce6ec479297f4.html">include</a></li><li class="navelem"><a class="el" href="dir_c7ebde285fcef06dba0b090642612638.html">eos</a></li><li class="navelem"><a class="el" href="dir_fab380b22e1724065a4c65606be96940.html">render</a></li> </ul> <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e79aa3c25fec6efdf09be840e7449540.html">eos</a></li><li class="navelem"><a class="el" href="dir_9294a830dcc230dfe8b5c804d7e8b91a.html">render</a></li> </ul>
</div> </div>
</div><!-- top --> </div><!-- top -->
<div class="header"> <div class="header">
...@@ -95,194 +95,22 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); ...@@ -95,194 +95,22 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="title">utils.hpp</div> </div> <div class="title">utils.hpp</div> </div>
</div><!--header--> </div><!--header-->
<div class="contents"> <div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div> <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/render/utils.hpp</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2014, 2015 Patrik Huber</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef RENDER_UTILS_HPP_</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define RENDER_UTILS_HPP_</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;eos/render/Mesh.hpp&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &quot;opencv2/imgproc/imgproc.hpp&quot;</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; <span class="keyword">namespace </span><a class="code" href="namespaceeos_1_1render.html#a097a630659b6c06a4596ca138f66ec94">render</a> {</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="namespaceeos_1_1render.html#a04bb2f816e97ecb7f33cf8a50328e0db"> 50</a></span>&#160;<span class="keyword">inline</span> cv::Vec2f <a class="code" href="namespaceeos_1_1render.html#a04bb2f816e97ecb7f33cf8a50328e0db">clip_to_screen_space</a>(<span class="keyword">const</span> cv::Vec2f&amp; clip_coordinates, <span class="keywordtype">int</span> screen_width, <span class="keywordtype">int</span> screen_height)</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;{</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="comment">// Window transform:</span></div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> x_ss = (clip_coordinates[0] + 1.0f) * (screen_width / 2.0f);</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> y_ss = screen_height - (clip_coordinates[1] + 1.0f) * (screen_height / 2.0f); <span class="comment">// also flip y; Qt: Origin top-left. OpenGL: bottom-left.</span></div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="keywordflow">return</span> cv::Vec2f(x_ss, y_ss);</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; <span class="comment">/* Note: What we do here is equivalent to</span></div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="comment"> x_w = (x * vW/2) + vW/2;</span></div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="comment"> However, Shirley says we should do:</span></div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;<span class="comment"> x_w = (x * vW/2) + (vW-1)/2;</span></div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;<span class="comment"> (analogous for y)</span></div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;<span class="comment"> Todo: Check the consequences.</span></div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;};</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;</div><div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="namespaceeos_1_1render.html#a7c4b923267e9b3b09c0c588bfdd4cb85"> 76</a></span>&#160;<span class="keyword">inline</span> cv::Vec2f <a class="code" href="namespaceeos_1_1render.html#a7c4b923267e9b3b09c0c588bfdd4cb85">screen_to_clip_space</a>(<span class="keyword">const</span> cv::Vec2f&amp; screen_coordinates, <span class="keywordtype">int</span> screen_width, <span class="keywordtype">int</span> screen_height)</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;{</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> x_cs = screen_coordinates[0] / (screen_width / 2.0f) - 1.0f;</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keywordtype">float</span> y_cs = screen_coordinates[1] / (screen_height / 2.0f) - 1.0f;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; y_cs *= -1.0f;</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="keywordflow">return</span> cv::Vec2f(x_cs, y_cs);</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;};</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="namespaceeos_1_1render.html#ac72cdee6eed13468a424824ddd0b3074"> 95</a></span>&#160;cv::Vec3f <a class="code" href="namespaceeos_1_1render.html#ac72cdee6eed13468a424824ddd0b3074">calculate_face_normal</a>(<span class="keyword">const</span> cv::Vec3f&amp; v0, <span class="keyword">const</span> cv::Vec3f&amp; v1, <span class="keyword">const</span> cv::Vec3f&amp; v2)</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;{</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; cv::Vec3f n = (v1 - v0).cross(v2 - v0); <span class="comment">// v0-to-v1 x v0-to-v2</span></div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; n /= cv::norm(n);</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keywordflow">return</span> n;</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;};</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;</div><div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="namespaceeos_1_1render.html#a4edecd42a4a04ba6eb95089dd3ff256a"> 111</a></span>&#160;cv::Mat <a class="code" href="namespaceeos_1_1render.html#a4edecd42a4a04ba6eb95089dd3ff256a">draw_texcoords</a>(<a class="code" href="structeos_1_1render_1_1_mesh.html">Mesh</a> mesh, cv::Mat image = cv::Mat())</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;{</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="keyword">using</span> cv::Point2f;</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <span class="keyword">using</span> cv::Scalar;</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keywordflow">if</span> (image.empty())</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; {</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; image = cv::Mat(512, 512, CV_8UC4, Scalar(0.0f, 0.0f, 0.0f, 255.0f));</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; }</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; triIdx : mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">tvi</a>) {</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; cv::line(image, Point2f(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[0]][0] * image.cols, mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[0]][1] * image.rows), Point2f(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[1]][0] * image.cols, mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[1]][1] * image.rows), Scalar(255.0f, 0.0f, 0.0f));</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; cv::line(image, Point2f(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[1]][0] * image.cols, mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[1]][1] * image.rows), Point2f(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[2]][0] * image.cols, mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[2]][1] * image.rows), Scalar(255.0f, 0.0f, 0.0f));</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; cv::line(image, Point2f(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[2]][0] * image.cols, mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[2]][1] * image.rows), Point2f(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[0]][0] * image.cols, mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[0]][1] * image.rows), Scalar(255.0f, 0.0f, 0.0f));</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; }</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; <span class="keywordflow">return</span> image;</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;};</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;<span class="comment">// TODO: Should go to detail:: namespace, or texturing/utils or whatever.</span></div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> get_max_possible_mipmaps_num(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> width, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> height)</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;{</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> mipmapsNum = 1;</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> size = std::max(width, height);</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <span class="keywordflow">if</span> (size == 1)</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="keywordflow">return</span> 1;</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <span class="keywordflow">do</span> {</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; size &gt;&gt;= 1;</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; mipmapsNum++;</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; } <span class="keywordflow">while</span> (size != 1);</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <span class="keywordflow">return</span> mipmapsNum;</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;};</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160;<span class="keyword">inline</span> <span class="keywordtype">bool</span> is_power_of_two(<span class="keywordtype">int</span> x)</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;{</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="keywordflow">return</span> !(x &amp; (x - 1));</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;};</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;</div><div class="line"><a name="l00156"></a><span class="lineno"><a class="line" href="classeos_1_1render_1_1_texture.html"> 156</a></span>&#160;<span class="keyword">class </span><a class="code" href="classeos_1_1render_1_1_texture.html">Texture</a></div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;{</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; std::vector&lt;cv::Mat&gt; mipmaps; <span class="comment">// make Texture a friend class of renderer, then move this to private?</span></div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> widthLog, heightLog; <span class="comment">// log2 of width and height of the base mip-level</span></div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;<span class="comment">//private:</span></div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <span class="comment">//std::string filename;</span></div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> mipmaps_num;</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160;};</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160;</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160;<span class="comment">// throws: ocv exc, runtime_ex</span></div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160;<a class="code" href="classeos_1_1render_1_1_texture.html">Texture</a> create_mipmapped_texture(cv::Mat image, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> mipmapsNum = 0) {</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; assert(image.type() == CV_8UC3 || image.type() == CV_8UC4);</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160;</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <a class="code" href="classeos_1_1render_1_1_texture.html">Texture</a> texture;</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160;</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; texture.mipmaps_num = (mipmapsNum == 0 ? get_max_possible_mipmaps_num(image.cols, image.rows) : mipmapsNum);</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <span class="comment">/*if (mipmapsNum == 0)</span></div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160;<span class="comment"> {</span></div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160;<span class="comment"> uchar mmn = render::utils::MatrixUtils::getMaxPossibleMipmapsNum(image.cols, image.rows);</span></div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160;<span class="comment"> this-&gt;mipmapsNum = mmn;</span></div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160;<span class="comment"> } else</span></div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160;<span class="comment"> {</span></div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160;<span class="comment"> this-&gt;mipmapsNum = mipmapsNum;</span></div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160;<span class="comment"> }*/</span></div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="keywordflow">if</span> (texture.mipmaps_num &gt; 1)</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; {</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <span class="keywordflow">if</span> (!is_power_of_two(image.cols) || !is_power_of_two(image.rows))</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; {</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">&quot;Error: Couldn&#39;t generate mipmaps, width or height not power of two.&quot;</span>);</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; }</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; }</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; <span class="keywordflow">if</span> (image.type() == CV_8UC3)</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; {</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; image.convertTo(image, CV_8UC4); <span class="comment">// Most often, the input img is CV_8UC3. Img is BGR. Add an alpha channel</span></div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; cv::cvtColor(image, image, CV_BGR2BGRA);</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; }</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160;</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; <span class="keywordtype">int</span> currWidth = image.cols;</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; <span class="keywordtype">int</span> currHeight = image.rows;</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; std::vector&lt;cv::Mat&gt; mipmaps;</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; texture.mipmaps_num; i++)</div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; {</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; <span class="keywordflow">if</span> (i == 0) {</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; mipmaps.push_back(image);</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; }</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; <span class="keywordflow">else</span> {</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; cv::Mat currMipMap(currHeight, currWidth, CV_8UC4);</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; cv::resize(mipmaps[i - 1], currMipMap, currMipMap.size());</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; mipmaps.push_back(currMipMap);</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; }</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160;</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; <span class="keywordflow">if</span> (currWidth &gt; 1)</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; currWidth &gt;&gt;= 1;</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; <span class="keywordflow">if</span> (currHeight &gt; 1)</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; currHeight &gt;&gt;= 1;</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; }</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; texture.mipmaps = mipmaps;</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; texture.widthLog = (uchar)(std::log(mipmaps[0].cols) / CV_LOG2 + 0.0001f); <span class="comment">// std::epsilon or something? or why 0.0001f here?</span></div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; texture.heightLog = (uchar)(std::log(mipmaps[0].rows) / CV_LOG2 + 0.0001f); <span class="comment">// Changed std::logf to std::log because it doesnt compile in linux (gcc 4.8). CHECK THAT</span></div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; <span class="keywordflow">return</span> texture;</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160;};</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160;</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; } <span class="comment">/* namespace render */</span></div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160;} <span class="comment">/* namespace eos */</span></div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160;</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* RENDER_UTILS_HPP_ */</span><span class="preprocessor"></span></div><div class="ttc" id="namespaceeos_1_1render_html_ac72cdee6eed13468a424824ddd0b3074"><div class="ttname"><a href="namespaceeos_1_1render.html#ac72cdee6eed13468a424824ddd0b3074">eos::render::calculate_face_normal</a></div><div class="ttdeci">cv::Vec3f calculate_face_normal(const cv::Vec3f &amp;v0, const cv::Vec3f &amp;v1, const cv::Vec3f &amp;v2)</div><div class="ttdef"><b>Definition:</b> utils.hpp:95</div></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Eos - A 3D Morphable Model fitting library written in modern C++11/14.</span></div> <div class="ttc" id="classeos_1_1render_1_1_texture_html"><div class="ttname"><a href="classeos_1_1render_1_1_texture.html">eos::render::Texture</a></div><div class="ttdoc">Represents a texture for rendering. </div><div class="ttdef"><b>Definition:</b> utils.hpp:156</div></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div> <div class="ttc" id="namespaceeos_1_1render_html_a097a630659b6c06a4596ca138f66ec94"><div class="ttname"><a href="namespaceeos_1_1render.html#a097a630659b6c06a4596ca138f66ec94">eos::render::render</a></div><div class="ttdeci">std::pair&lt; cv::Mat, cv::Mat &gt; render(Mesh mesh, cv::Mat model_view_matrix, cv::Mat projection_matrix, int viewport_width, int viewport_height, const boost::optional&lt; Texture &gt; &amp;texture=boost::none, bool enable_backface_culling=false, bool enable_near_clipping=true, bool enable_far_clipping=true)</div><div class="ttdef"><b>Definition:</b> render.hpp:125</div></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * File: include/eos/render/utils.hpp</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright 2014, 2015 Patrik Huber</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * limitations under the License.</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef RENDER_UTILS_HPP_</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define RENDER_UTILS_HPP_</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;eos/render/Mesh.hpp&quot;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;opencv2/core/core.hpp&quot;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &quot;opencv2/imgproc/imgproc.hpp&quot;</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeos.html">eos</a> {</div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; <span class="keyword">namespace </span><a class="code" href="namespaceeos_1_1render.html#a7628a42875570658bea6ffb4f46723e5">render</a> {</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="namespaceeos_1_1render.html#a04bb2f816e97ecb7f33cf8a50328e0db"> 50</a></span>&#160;<span class="keyword">inline</span> cv::Vec2f <a class="code" href="namespaceeos_1_1render.html#a04bb2f816e97ecb7f33cf8a50328e0db">clip_to_screen_space</a>(<span class="keyword">const</span> cv::Vec2f&amp; clip_coordinates, <span class="keywordtype">int</span> screen_width, <span class="keywordtype">int</span> screen_height)</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;{</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="comment">// Window transform:</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> x_ss = (clip_coordinates[0] + 1.0f) * (screen_width / 2.0f);</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> y_ss = screen_height - (clip_coordinates[1] + 1.0f) * (screen_height / 2.0f); <span class="comment">// also flip y; Qt: Origin top-left. OpenGL: bottom-left.</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="keywordflow">return</span> cv::Vec2f(x_ss, y_ss);</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; <span class="comment">/* Note: What we do here is equivalent to</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="comment"> x_w = (x * vW/2) + vW/2;</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="comment"> However, Shirley says we should do:</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;<span class="comment"> x_w = (x * vW/2) + (vW-1)/2;</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;<span class="comment"> (analogous for y)</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;<span class="comment"> Todo: Check the consequences.</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;};</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;</div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="namespaceeos_1_1render.html#a7c4b923267e9b3b09c0c588bfdd4cb85"> 76</a></span>&#160;<span class="keyword">inline</span> cv::Vec2f <a class="code" href="namespaceeos_1_1render.html#a7c4b923267e9b3b09c0c588bfdd4cb85">screen_to_clip_space</a>(<span class="keyword">const</span> cv::Vec2f&amp; screen_coordinates, <span class="keywordtype">int</span> screen_width, <span class="keywordtype">int</span> screen_height)</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;{</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> x_cs = screen_coordinates[0] / (screen_width / 2.0f) - 1.0f;</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keywordtype">float</span> y_cs = screen_coordinates[1] / (screen_height / 2.0f) - 1.0f;</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; y_cs *= -1.0f;</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="keywordflow">return</span> cv::Vec2f(x_cs, y_cs);</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;};</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;</div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="namespaceeos_1_1render.html#ac72cdee6eed13468a424824ddd0b3074"> 95</a></span>&#160;cv::Vec3f <a class="code" href="namespaceeos_1_1render.html#ac72cdee6eed13468a424824ddd0b3074">calculate_face_normal</a>(<span class="keyword">const</span> cv::Vec3f&amp; v0, <span class="keyword">const</span> cv::Vec3f&amp; v1, <span class="keyword">const</span> cv::Vec3f&amp; v2)</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;{</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; cv::Vec3f n = (v1 - v0).cross(v2 - v0); <span class="comment">// v0-to-v1 x v0-to-v2</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; n /= cv::norm(n);</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keywordflow">return</span> n;</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;};</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;</div>
<div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="namespaceeos_1_1render.html#a4edecd42a4a04ba6eb95089dd3ff256a"> 111</a></span>&#160;cv::Mat <a class="code" href="namespaceeos_1_1render.html#a4edecd42a4a04ba6eb95089dd3ff256a">draw_texcoords</a>(<a class="code" href="structeos_1_1render_1_1_mesh.html">Mesh</a> mesh, cv::Mat image = cv::Mat())</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;{</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="keyword">using</span> cv::Point2f;</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <span class="keyword">using</span> cv::Scalar;</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keywordflow">if</span> (image.empty())</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; {</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; image = cv::Mat(512, 512, CV_8UC4, Scalar(0.0f, 0.0f, 0.0f, 255.0f));</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; }</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; triIdx : mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">tvi</a>) {</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; cv::line(image, Point2f(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[0]][0] * image.cols, mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[0]][1] * image.rows), Point2f(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[1]][0] * image.cols, mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[1]][1] * image.rows), Scalar(255.0f, 0.0f, 0.0f));</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; cv::line(image, Point2f(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[1]][0] * image.cols, mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[1]][1] * image.rows), Point2f(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[2]][0] * image.cols, mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[2]][1] * image.rows), Scalar(255.0f, 0.0f, 0.0f));</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; cv::line(image, Point2f(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[2]][0] * image.cols, mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[2]][1] * image.rows), Point2f(mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[0]][0] * image.cols, mesh.<a class="code" href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">texcoords</a>[triIdx[0]][1] * image.rows), Scalar(255.0f, 0.0f, 0.0f));</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; }</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; <span class="keywordflow">return</span> image;</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;};</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;<span class="comment">// TODO: Should go to detail:: namespace, or texturing/utils or whatever.</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> get_max_possible_mipmaps_num(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> width, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> height)</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;{</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> mipmapsNum = 1;</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> size = std::max(width, height);</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <span class="keywordflow">if</span> (size == 1)</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="keywordflow">return</span> 1;</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <span class="keywordflow">do</span> {</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; size &gt;&gt;= 1;</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; mipmapsNum++;</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; } <span class="keywordflow">while</span> (size != 1);</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <span class="keywordflow">return</span> mipmapsNum;</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;};</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160;<span class="keyword">inline</span> <span class="keywordtype">bool</span> is_power_of_two(<span class="keywordtype">int</span> x)</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;{</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="keywordflow">return</span> !(x &amp; (x - 1));</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;};</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;</div>
<div class="line"><a name="l00150"></a><span class="lineno"><a class="line" href="classeos_1_1render_1_1_texture.html"> 150</a></span>&#160;<span class="keyword">class </span><a class="code" href="classeos_1_1render_1_1_texture.html">Texture</a></div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;{</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="comment">// Todo: This whole class needs a major overhaul and documentation.</span></div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; std::vector&lt;cv::Mat&gt; mipmaps; <span class="comment">// make Texture a friend class of renderer, then move this to private?</span></div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> widthLog, heightLog; <span class="comment">// log2 of width and height of the base mip-level</span></div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160;<span class="comment">//private:</span></div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; <span class="comment">//std::string filename;</span></div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> mipmaps_num;</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;};</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160;<span class="comment">// throws: ocv exc, runtime_ex</span></div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160;<a class="code" href="classeos_1_1render_1_1_texture.html">Texture</a> create_mipmapped_texture(cv::Mat image, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> mipmapsNum = 0) {</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; assert(image.type() == CV_8UC3 || image.type() == CV_8UC4);</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160;</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <a class="code" href="classeos_1_1render_1_1_texture.html">Texture</a> texture;</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160;</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; texture.mipmaps_num = (mipmapsNum == 0 ? get_max_possible_mipmaps_num(image.cols, image.rows) : mipmapsNum);</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <span class="comment">/*if (mipmapsNum == 0)</span></div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160;<span class="comment"> {</span></div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160;<span class="comment"> uchar mmn = render::utils::MatrixUtils::getMaxPossibleMipmapsNum(image.cols, image.rows);</span></div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160;<span class="comment"> this-&gt;mipmapsNum = mmn;</span></div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160;<span class="comment"> } else</span></div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160;<span class="comment"> {</span></div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160;<span class="comment"> this-&gt;mipmapsNum = mipmapsNum;</span></div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160;<span class="comment"> }*/</span></div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160;</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="keywordflow">if</span> (texture.mipmaps_num &gt; 1)</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; {</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="keywordflow">if</span> (!is_power_of_two(image.cols) || !is_power_of_two(image.rows))</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; {</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">&quot;Error: Couldn&#39;t generate mipmaps, width or height not power of two.&quot;</span>);</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; }</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; }</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <span class="keywordflow">if</span> (image.type() == CV_8UC3)</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; {</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; image.convertTo(image, CV_8UC4); <span class="comment">// Most often, the input img is CV_8UC3. Img is BGR. Add an alpha channel</span></div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; cv::cvtColor(image, image, CV_BGR2BGRA);</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; }</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160;</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <span class="keywordtype">int</span> currWidth = image.cols;</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; <span class="keywordtype">int</span> currHeight = image.rows;</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; std::vector&lt;cv::Mat&gt; mipmaps;</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; texture.mipmaps_num; i++)</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; {</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; <span class="keywordflow">if</span> (i == 0) {</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; mipmaps.push_back(image);</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; }</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; cv::Mat currMipMap(currHeight, currWidth, CV_8UC4);</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; cv::resize(mipmaps[i - 1], currMipMap, currMipMap.size());</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; mipmaps.push_back(currMipMap);</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; }</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160;</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; <span class="keywordflow">if</span> (currWidth &gt; 1)</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; currWidth &gt;&gt;= 1;</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; <span class="keywordflow">if</span> (currHeight &gt; 1)</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; currHeight &gt;&gt;= 1;</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; }</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; texture.mipmaps = mipmaps;</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; texture.widthLog = (uchar)(std::log(mipmaps[0].cols) / CV_LOG2 + 0.0001f); <span class="comment">// std::epsilon or something? or why 0.0001f here?</span></div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; texture.heightLog = (uchar)(std::log(mipmaps[0].rows) / CV_LOG2 + 0.0001f); <span class="comment">// Changed std::logf to std::log because it doesnt compile in linux (gcc 4.8). CHECK THAT</span></div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; <span class="keywordflow">return</span> texture;</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160;};</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160;</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; } <span class="comment">/* namespace render */</span></div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160;} <span class="comment">/* namespace eos */</span></div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160;</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* RENDER_UTILS_HPP_ */</span><span class="preprocessor"></span></div>
<div class="ttc" id="namespaceeos_1_1render_html_ac72cdee6eed13468a424824ddd0b3074"><div class="ttname"><a href="namespaceeos_1_1render.html#ac72cdee6eed13468a424824ddd0b3074">eos::render::calculate_face_normal</a></div><div class="ttdeci">cv::Vec3f calculate_face_normal(const cv::Vec3f &amp;v0, const cv::Vec3f &amp;v1, const cv::Vec3f &amp;v2)</div><div class="ttdef"><b>Definition:</b> utils.hpp:95</div></div>
<div class="ttc" id="classeos_1_1render_1_1_texture_html"><div class="ttname"><a href="classeos_1_1render_1_1_texture.html">eos::render::Texture</a></div><div class="ttdef"><b>Definition:</b> utils.hpp:150</div></div>
<div class="ttc" id="namespaceeos_1_1render_html_a4edecd42a4a04ba6eb95089dd3ff256a"><div class="ttname"><a href="namespaceeos_1_1render.html#a4edecd42a4a04ba6eb95089dd3ff256a">eos::render::draw_texcoords</a></div><div class="ttdeci">cv::Mat draw_texcoords(Mesh mesh, cv::Mat image=cv::Mat())</div><div class="ttdef"><b>Definition:</b> utils.hpp:111</div></div> <div class="ttc" id="namespaceeos_1_1render_html_a4edecd42a4a04ba6eb95089dd3ff256a"><div class="ttname"><a href="namespaceeos_1_1render.html#a4edecd42a4a04ba6eb95089dd3ff256a">eos::render::draw_texcoords</a></div><div class="ttdeci">cv::Mat draw_texcoords(Mesh mesh, cv::Mat image=cv::Mat())</div><div class="ttdef"><b>Definition:</b> utils.hpp:111</div></div>
<div class="ttc" id="namespaceeos_1_1render_html_a7c4b923267e9b3b09c0c588bfdd4cb85"><div class="ttname"><a href="namespaceeos_1_1render.html#a7c4b923267e9b3b09c0c588bfdd4cb85">eos::render::screen_to_clip_space</a></div><div class="ttdeci">cv::Vec2f screen_to_clip_space(const cv::Vec2f &amp;screen_coordinates, int screen_width, int screen_height)</div><div class="ttdef"><b>Definition:</b> utils.hpp:76</div></div> <div class="ttc" id="namespaceeos_1_1render_html_a7c4b923267e9b3b09c0c588bfdd4cb85"><div class="ttname"><a href="namespaceeos_1_1render.html#a7c4b923267e9b3b09c0c588bfdd4cb85">eos::render::screen_to_clip_space</a></div><div class="ttdeci">cv::Vec2f screen_to_clip_space(const cv::Vec2f &amp;screen_coordinates, int screen_width, int screen_height)</div><div class="ttdef"><b>Definition:</b> utils.hpp:76</div></div>
<div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&#39;s 3D model fitting functionality. </div></div> <div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdoc">Namespace containing all of eos&amp;#39;s 3D model fitting functionality. </div></div>
<div class="ttc" id="namespaceeos_1_1render_html_a04bb2f816e97ecb7f33cf8a50328e0db"><div class="ttname"><a href="namespaceeos_1_1render.html#a04bb2f816e97ecb7f33cf8a50328e0db">eos::render::clip_to_screen_space</a></div><div class="ttdeci">cv::Vec2f clip_to_screen_space(const cv::Vec2f &amp;clip_coordinates, int screen_width, int screen_height)</div><div class="ttdef"><b>Definition:</b> utils.hpp:50</div></div> <div class="ttc" id="namespaceeos_1_1render_html_a04bb2f816e97ecb7f33cf8a50328e0db"><div class="ttname"><a href="namespaceeos_1_1render.html#a04bb2f816e97ecb7f33cf8a50328e0db">eos::render::clip_to_screen_space</a></div><div class="ttdeci">cv::Vec2f clip_to_screen_space(const cv::Vec2f &amp;clip_coordinates, int screen_width, int screen_height)</div><div class="ttdef"><b>Definition:</b> utils.hpp:50</div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html">eos::render::Mesh</a></div><div class="ttdoc">This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordin...</div><div class="ttdef"><b>Definition:</b> Mesh.hpp:49</div></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html">eos::render::Mesh</a></div><div class="ttdoc">This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordin...</div><div class="ttdef"><b>Definition:</b> Mesh.hpp:45</div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html_ab6fb80c460656bf7830a526f0692681b"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">eos::render::Mesh::tvi</a></div><div class="ttdeci">std::vector&lt; std::array&lt; int, 3 &gt; &gt; tvi</div><div class="ttdoc">Triangle vertex indices. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:55</div></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html_ab6fb80c460656bf7830a526f0692681b"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#ab6fb80c460656bf7830a526f0692681b">eos::render::Mesh::tvi</a></div><div class="ttdeci">std::vector&lt; std::array&lt; int, 3 &gt; &gt; tvi</div><div class="ttdoc">Triangle vertex indices. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:51</div></div>
<div class="ttc" id="structeos_1_1render_1_1_mesh_html_a64fddf0a7200e7f66b0426773542eea4"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">eos::render::Mesh::texcoords</a></div><div class="ttdeci">std::vector&lt; cv::Vec2f &gt; texcoords</div><div class="ttdoc">Texture coordinates for each vertex. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:53</div></div> <div class="ttc" id="structeos_1_1render_1_1_mesh_html_a64fddf0a7200e7f66b0426773542eea4"><div class="ttname"><a href="structeos_1_1render_1_1_mesh.html#a64fddf0a7200e7f66b0426773542eea4">eos::render::Mesh::texcoords</a></div><div class="ttdeci">std::vector&lt; cv::Vec2f &gt; texcoords</div><div class="ttdoc">Texture coordinates for each vertex. </div><div class="ttdef"><b>Definition:</b> Mesh.hpp:49</div></div>
<div class="ttc" id="namespaceeos_1_1render_html_a7628a42875570658bea6ffb4f46723e5"><div class="ttname"><a href="namespaceeos_1_1render.html#a7628a42875570658bea6ffb4f46723e5">eos::render::render</a></div><div class="ttdeci">std::pair&lt; cv::Mat, cv::Mat &gt; render(Mesh mesh, cv::Mat model_view_matrix, cv::Mat projection_matrix, int viewport_width, int viewport_height, const Texture &amp;texture, bool enable_backface_culling=false, bool enable_near_clipping=true, bool enable_far_clipping=true)</div><div class="ttdef"><b>Definition:</b> render.hpp:129</div></div>
</div><!-- fragment --></div><!-- contents --> </div><!-- fragment --></div><!-- contents -->
<!-- start footer part --> <!-- start footer part -->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html"> Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/> <img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10 </a> 1.8.11
</small></address> </small></address>
</body> </body>
</html> </html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment