Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 4bc66056a634db26a1f4d0845dc41ca6 > files > 2650

mrpt-doc-0.9.5-0.1.20110925svn2670.fc16.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>TCamera.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<div align="left"><a href="http://www.mrpt.org/">Main MRPT website</a> &gt; <b>C++ reference</b> </div>
<div align="right">
<a href="index.html"><img border="0" src="mrpt_logo.png" alt="MRPT logo"></a>
</div>
<!-- Generated by Doxygen 1.7.5 -->
<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="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</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">
          <div class="left">
            <form id="FSearchBox" action="search.php" method="get">
              <img id="MSearchSelect" src="search/mag.png" alt=""/>
              <input type="text" id="MSearchField" name="query" value="Search" size="20" accesskey="S" 
                     onfocus="searchBox.OnSearchFieldFocus(true)" 
                     onblur="searchBox.OnSearchFieldFocus(false)"/>
            </form>
          </div><div class="right"></div>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">TCamera.h</div>  </div>
</div>
<div class="contents">
<a href="_t_camera_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* +---------------------------------------------------------------------------+</span>
<a name="l00002"></a>00002 <span class="comment">   |          The Mobile Robot Programming Toolkit (MRPT) C++ library          |</span>
<a name="l00003"></a>00003 <span class="comment">   |                                                                           |</span>
<a name="l00004"></a>00004 <span class="comment">   |                       http://www.mrpt.org/                                |</span>
<a name="l00005"></a>00005 <span class="comment">   |                                                                           |</span>
<a name="l00006"></a>00006 <span class="comment">   |   Copyright (C) 2005-2011  University of Malaga                           |</span>
<a name="l00007"></a>00007 <span class="comment">   |                                                                           |</span>
<a name="l00008"></a>00008 <span class="comment">   |    This software was written by the Machine Perception and Intelligent    |</span>
<a name="l00009"></a>00009 <span class="comment">   |      Robotics Lab, University of Malaga (Spain).                          |</span>
<a name="l00010"></a>00010 <span class="comment">   |    Contact: Jose-Luis Blanco  &lt;jlblanco@ctima.uma.es&gt;                     |</span>
<a name="l00011"></a>00011 <span class="comment">   |                                                                           |</span>
<a name="l00012"></a>00012 <span class="comment">   |  This file is part of the MRPT project.                                   |</span>
<a name="l00013"></a>00013 <span class="comment">   |                                                                           |</span>
<a name="l00014"></a>00014 <span class="comment">   |     MRPT is free software: you can redistribute it and/or modify          |</span>
<a name="l00015"></a>00015 <span class="comment">   |     it under the terms of the GNU General Public License as published by  |</span>
<a name="l00016"></a>00016 <span class="comment">   |     the Free Software Foundation, either version 3 of the License, or     |</span>
<a name="l00017"></a>00017 <span class="comment">   |     (at your option) any later version.                                   |</span>
<a name="l00018"></a>00018 <span class="comment">   |                                                                           |</span>
<a name="l00019"></a>00019 <span class="comment">   |   MRPT is distributed in the hope that it will be useful,                 |</span>
<a name="l00020"></a>00020 <span class="comment">   |     but WITHOUT ANY WARRANTY; without even the implied warranty of        |</span>
<a name="l00021"></a>00021 <span class="comment">   |     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         |</span>
<a name="l00022"></a>00022 <span class="comment">   |     GNU General Public License for more details.                          |</span>
<a name="l00023"></a>00023 <span class="comment">   |                                                                           |</span>
<a name="l00024"></a>00024 <span class="comment">   |     You should have received a copy of the GNU General Public License     |</span>
<a name="l00025"></a>00025 <span class="comment">   |     along with MRPT.  If not, see &lt;http://www.gnu.org/licenses/&gt;.         |</span>
<a name="l00026"></a>00026 <span class="comment">   |                                                                           |</span>
<a name="l00027"></a>00027 <span class="comment">   +---------------------------------------------------------------------------+ */</span>
<a name="l00028"></a>00028 <span class="preprocessor">#ifndef  TCamera_H</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define  TCamera_H</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;<a class="code" href="_c_matrix_template_numeric_8h.html">mrpt/math/CMatrixTemplateNumeric.h</a>&gt;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;<a class="code" href="_c_matrix_fixed_numeric_8h.html">mrpt/math/CMatrixFixedNumeric.h</a>&gt;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;<a class="code" href="_c_loadable_options_8h.html">mrpt/utils/CLoadableOptions.h</a>&gt;</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include &lt;<a class="code" href="_c_config_file_base_8h.html">mrpt/utils/CConfigFileBase.h</a>&gt;</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;<a class="code" href="_c_config_file_memory_8h.html">mrpt/utils/CConfigFileMemory.h</a>&gt;</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include &lt;<a class="code" href="_c_serializable_8h.html">mrpt/utils/CSerializable.h</a>&gt;</span>
<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;<a class="code" href="_c_pose3_d_quat_8h.html">mrpt/poses/CPose3DQuat.h</a>&gt;</span>
<a name="l00038"></a>00038 
<a name="l00039"></a>00039 <span class="keyword">namespace </span>mrpt
<a name="l00040"></a>00040 {
<a name="l00041"></a>00041         <span class="keyword">namespace </span>utils
<a name="l00042"></a>00042         {
<a name="l00043"></a>00043                 <span class="keyword">using namespace </span>mrpt::math;
<a name="l00044"></a>00044                 <span class="keyword">using namespace </span>mrpt::poses;
<a name="l00045"></a>00045 
<a name="l00046"></a><a class="code" href="structmrpt_1_1utils_1_1_t_camera_ptr.html#ab7ff04c613b3ff450344009bf6d687df">00046</a>                 <a class="code" href="_c_serializable_8h.html#ab89b7a3de0a1baf5a5af4454add7d0f8" title="This declaration must be inserted in all CSerializable classes definition, before the class declarati...">DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE</a>( <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html" title="Structure to hold the parameters of a pinhole camera model.">TCamera</a>, <a class="code" href="classmrpt_1_1utils_1_1_c_serializable.html" title="The virtual base class which provides a unified interface for all persistent objects in MRPT...">mrpt::utils::CSerializable</a> )
<a name="l00047"></a>00047 
<a name="l00048"></a>00048                 <span class="comment">/** Structure to hold the parameters of a pinhole camera model.</span>
<a name="l00049"></a>00049 <span class="comment">                  *  The parameters obtained for one camera resolution can be used for any other resolution by means of the method TCamera::scaleToResolution()</span>
<a name="l00050"></a>00050 <span class="comment">                  *</span>
<a name="l00051"></a>00051 <span class="comment">                  * \sa mrpt::vision::CCamModel, the application &lt;a href=&quot;http://www.mrpt.org/Application:camera-calib-gui&quot; &gt;camera-calib-gui&lt;/a&gt; for calibrating a camera</span>
<a name="l00052"></a>00052 <span class="comment">                 * \ingroup mrpt_base_grp</span>
<a name="l00053"></a>00053 <span class="comment">                 */</span>
<a name="l00054"></a>00054                 class <a class="code" href="base_2include_2mrpt_2base_2link__pragmas_8h.html#a6045fa0129b1a3d6c8bf895470e66574">BASE_IMPEXP</a> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html" title="Structure to hold the parameters of a pinhole camera model.">TCamera</a> : public mrpt::utils::<a class="code" href="classmrpt_1_1utils_1_1_c_serializable.html" title="The virtual base class which provides a unified interface for all persistent objects in MRPT...">CSerializable</a>
<a name="l00055"></a>00055                 {
<a name="l00056"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#aa78d533ae7e0dba2a38c41a984b936e4">00056</a>                         <a class="code" href="_c_serializable_8h.html#a72ab55bf7ae009c89b75715cfa21e84d" title="This declaration must be inserted in all CSerializable classes definition, within the class declarati...">DEFINE_SERIALIZABLE</a>( <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html" title="Structure to hold the parameters of a pinhole camera model.">TCamera</a> )
<a name="l00057"></a>00057 
<a name="l00058"></a>00058                 public:
<a name="l00059"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#ace8a6176f56cd237d21ef5d80fb38207">00059</a>                         <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html" title="Structure to hold the parameters of a pinhole camera model.">TCamera</a>() : ncols(640), nrows(480), focalLengthMeters(0)
<a name="l00060"></a>00060                         {
<a name="l00061"></a>00061                                 intrinsicParams.set_unsafe(0,0,507.808);
<a name="l00062"></a>00062                                 intrinsicParams.set_unsafe(1,1,507.808);
<a name="l00063"></a>00063                                 intrinsicParams.set_unsafe(0,2,356.2368);
<a name="l00064"></a>00064                                 intrinsicParams.set_unsafe(1,2,252.9216);
<a name="l00065"></a>00065                                 intrinsicParams.set_unsafe(2,2,1);
<a name="l00066"></a>00066                                 <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=0;i&lt;dist.SizeAtCompileTime ;i++)
<a name="l00067"></a>00067                                         dist[i] = 0;
<a name="l00068"></a>00068                         }
<a name="l00069"></a>00069 <span class="comment"></span>
<a name="l00070"></a>00070 <span class="comment">                        /** @name Camera parameters</span>
<a name="l00071"></a>00071 <span class="comment">                            @{ */</span>
<a name="l00072"></a>00072 
<a name="l00073"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a4882544de58dafc4b12a62d6d86d8e13">00073</a>                         uint32_t                        ncols,<a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a4882544de58dafc4b12a62d6d86d8e13" title="Camera resolution.">nrows</a>;        <span class="comment">//!&lt; Camera resolution</span>
<a name="l00074"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a1960e92075ca70228300e627f2965af7">00074</a> <span class="comment"></span>                        <a class="code" href="classmrpt_1_1math_1_1_c_matrix_fixed_numeric.html">CMatrixDouble33</a>         <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a1960e92075ca70228300e627f2965af7" title="Matrix of intrinsic parameters (containing the focal length and principal point coordinates)">intrinsicParams</a>;    <span class="comment">//!&lt; Matrix of intrinsic parameters (containing the focal length and principal point coordinates)</span>
<a name="l00075"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a30aaef098fc8bb51d47415d63470a343">00075</a> <span class="comment"></span>                        <a class="code" href="classmrpt_1_1math_1_1_c_array_double.html">CArrayDouble&lt;5&gt;</a>         <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a30aaef098fc8bb51d47415d63470a343" title="[k1 k2 t1 t2 t3] -&gt; k_i: parameters of radial distortion, t_i: parameters of tangential distortion (d...">dist</a>;               <span class="comment">//!&lt; [k1 k2 t1 t2 t3] -&gt; k_i: parameters of radial distortion, t_i: parameters of tangential distortion (default=0)</span>
<a name="l00076"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a08127fe5bbd8fecf3e34cca2882f89fc">00076</a> <span class="comment"></span>                        <span class="keywordtype">double</span>                          <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a08127fe5bbd8fecf3e34cca2882f89fc" title="The focal length of the camera, in meters (can be used among &#39;intrinsicParams&#39; to determine the pixel...">focalLengthMeters</a>;  <span class="comment">//!&lt; The focal length of the camera, in meters (can be used among &#39;intrinsicParams&#39; to determine the pixel size).</span>
<a name="l00077"></a>00077 <span class="comment"></span><span class="comment"></span>
<a name="l00078"></a>00078 <span class="comment">                        /** @} */</span>
<a name="l00079"></a>00079 <span class="comment"></span>
<a name="l00080"></a>00080 <span class="comment">                        /** Rescale all the parameters for a new camera resolution (it raises an exception if the aspect ratio is modified, which is not permitted).</span>
<a name="l00081"></a>00081 <span class="comment">                          */</span>
<a name="l00082"></a>00082                         <span class="keywordtype">void</span> scaleToResolution(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> new_ncols, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> new_nrows);
<a name="l00083"></a>00083 <span class="comment"></span>
<a name="l00084"></a>00084 <span class="comment">                        /**  Save as a config block:</span>
<a name="l00085"></a>00085 <span class="comment">                          *  \code</span>
<a name="l00086"></a>00086 <span class="comment">                          *  [SECTION]</span>
<a name="l00087"></a>00087 <span class="comment">                          *  resolution = [NCOLS NROWS]</span>
<a name="l00088"></a>00088 <span class="comment">                          *  cx         = CX</span>
<a name="l00089"></a>00089 <span class="comment">                          *  cy         = CY</span>
<a name="l00090"></a>00090 <span class="comment">                          *  fx         = FX</span>
<a name="l00091"></a>00091 <span class="comment">                          *  fy         = FY</span>
<a name="l00092"></a>00092 <span class="comment">                          *  dist       = [K1 K2 T1 T2 K3]</span>
<a name="l00093"></a>00093 <span class="comment">                          *  focal_length = FOCAL_LENGTH</span>
<a name="l00094"></a>00094 <span class="comment">                          *  \endcode</span>
<a name="l00095"></a>00095 <span class="comment">                          */</span>
<a name="l00096"></a>00096                         <span class="keywordtype">void</span> saveToConfigFile( <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &amp;section, <a class="code" href="classmrpt_1_1utils_1_1_c_config_file_base.html" title="This class allows loading and storing values and vectors of different types from a configuration text...">mrpt::utils::CConfigFileBase</a> &amp;cfg ) <span class="keyword">const</span>;
<a name="l00097"></a>00097 <span class="comment"></span>
<a name="l00098"></a>00098 <span class="comment">                        /**  Load all the params from a config source, in the format used in saveToConfigFile(), that is:</span>
<a name="l00099"></a>00099 <span class="comment">                          *</span>
<a name="l00100"></a>00100 <span class="comment">                          *  \code</span>
<a name="l00101"></a>00101 <span class="comment">                          *  [SECTION]</span>
<a name="l00102"></a>00102 <span class="comment">                          *  resolution = [NCOLS NROWS]</span>
<a name="l00103"></a>00103 <span class="comment">                          *  cx         = CX</span>
<a name="l00104"></a>00104 <span class="comment">                          *  cy         = CY</span>
<a name="l00105"></a>00105 <span class="comment">                          *  fx         = FX</span>
<a name="l00106"></a>00106 <span class="comment">                          *  fy         = FY</span>
<a name="l00107"></a>00107 <span class="comment">                          *  dist       = [K1 K2 T1 T2 K3]</span>
<a name="l00108"></a>00108 <span class="comment">                          *  focal_length = FOCAL_LENGTH  [optional field]</span>
<a name="l00109"></a>00109 <span class="comment">                          *  \endcode</span>
<a name="l00110"></a>00110 <span class="comment">                          *  \exception std::exception on missing fields</span>
<a name="l00111"></a>00111 <span class="comment">                          */</span>
<a name="l00112"></a>00112                         <span class="keywordtype">void</span> loadFromConfigFile(<span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &amp;section, <span class="keyword">const</span> <a class="code" href="classmrpt_1_1utils_1_1_c_config_file_base.html" title="This class allows loading and storing values and vectors of different types from a configuration text...">mrpt::utils::CConfigFileBase</a> &amp;cfg );
<a name="l00113"></a>00113 <span class="comment"></span>
<a name="l00114"></a>00114 <span class="comment">                        /** Dumps all the parameters as a multi-line string, with the same format than \a saveToConfigFile.  \sa saveToConfigFile */</span>
<a name="l00115"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a4d32b0654cad6c024198140aa1f1dee1">00115</a>                         std<a class="code" href="classstd_1_1string.html" title="STL class.">::string</a> dumpAsText()
<a name="l00116"></a>00116                         {
<a name="l00117"></a>00117                                 mrpt<a class="code" href="classmrpt_1_1utils_1_1_c_config_file_memory.html" title="This class implements a config file-like interface over a memory-stored string list.">::utils::CConfigFileMemory</a> cfg;
<a name="l00118"></a>00118                                 saveToConfigFile(<span class="stringliteral">&quot;&quot;</span>,cfg);
<a name="l00119"></a>00119                                 <span class="keywordflow">return</span> cfg.<a class="code" href="classmrpt_1_1utils_1_1_c_config_file_memory.html#af0a01f4272aa43f790645f36af850e12" title="Return the currnet contents of the virtual &quot;config file&quot;.">getContent</a>();
<a name="l00120"></a>00120                         }
<a name="l00121"></a>00121 
<a name="l00122"></a>00122 <span class="comment"></span>
<a name="l00123"></a>00123 <span class="comment">                        /** Set the matrix of intrinsic params of the camera from the individual values of focal length and principal point coordinates (in pixels)</span>
<a name="l00124"></a>00124 <span class="comment">                          */</span>
<a name="l00125"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#af8e10f389d80abc279d3b5bf92aa273a">00125</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> setIntrinsicParamsFromValues ( <span class="keywordtype">double</span> fx, <span class="keywordtype">double</span> fy, <span class="keywordtype">double</span> cx, <span class="keywordtype">double</span> cy )
<a name="l00126"></a>00126                         {
<a name="l00127"></a>00127                                 intrinsicParams.set_unsafe( 0, 0, fx );
<a name="l00128"></a>00128                                 intrinsicParams.set_unsafe( 1, 1, fy );
<a name="l00129"></a>00129                                 intrinsicParams.set_unsafe( 0, 2, cx );
<a name="l00130"></a>00130                                 intrinsicParams.set_unsafe( 1, 2, cy );
<a name="l00131"></a>00131                         }
<a name="l00132"></a>00132 <span class="comment"></span>
<a name="l00133"></a>00133 <span class="comment">                        /** Get the vector of distortion params of the camera  */</span>
<a name="l00134"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#aa2777c4ecf4f3317a64a427f2335723d">00134</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> getDistortionParamsVector ( <a class="code" href="classmrpt_1_1math_1_1_c_matrix_fixed_numeric.html" title="A numeric matrix of compile-time fixed size.">CMatrixDouble15</a> &amp;distParVector )<span class="keyword"> const</span>
<a name="l00135"></a>00135 <span class="keyword">                        </span>{
<a name="l00136"></a>00136                                 <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=0;i&lt;5;i++)
<a name="l00137"></a>00137                                         distParVector.set_unsafe(0,i, dist[i]);
<a name="l00138"></a>00138                         }
<a name="l00139"></a>00139 <span class="comment"></span>
<a name="l00140"></a>00140 <span class="comment">                        /** Get a vector with the distortion params of the camera  */</span>
<a name="l00141"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a8a0d5b6199643375481fffd809252da9">00141</a>                         <span class="keyword">inline</span> std<a class="code" href="classstd_1_1vector.html">::vector&lt;double&gt;</a> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a8a0d5b6199643375481fffd809252da9" title="Get a vector with the distortion params of the camera.">getDistortionParamsAsVector</a> ()<span class="keyword"> const </span>{
<a name="l00142"></a>00142                                 std<a class="code" href="classstd_1_1vector.html">::vector&lt;double&gt;</a>  v(5);
<a name="l00143"></a>00143                                 <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=0;i&lt;5;i++)
<a name="l00144"></a>00144                                         v[i] = dist[i];
<a name="l00145"></a>00145                                 <span class="keywordflow">return</span> v;
<a name="l00146"></a>00146                         }
<a name="l00147"></a>00147 <span class="comment"></span>
<a name="l00148"></a>00148 <span class="comment">                        /** Set the whole vector of distortion params of the camera */</span>
<a name="l00149"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a1f40934d99e0b5cb6608f6319e9a00b6">00149</a>                         <span class="keywordtype">void</span> setDistortionParamsVector( <span class="keyword">const</span> <a class="code" href="classmrpt_1_1math_1_1_c_matrix_fixed_numeric.html" title="A numeric matrix of compile-time fixed size.">CMatrixDouble15</a> &amp;distParVector )
<a name="l00150"></a>00150                         {
<a name="l00151"></a>00151                                 <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=0;i&lt;5;i++)
<a name="l00152"></a>00152                                         dist[i] = distParVector.get_unsafe(0,i);
<a name="l00153"></a>00153                         }
<a name="l00154"></a>00154 <span class="comment"></span>
<a name="l00155"></a>00155 <span class="comment">                        /** Set the whole vector of distortion params of the camera from a 4 or 5-vector */</span>
<a name="l00156"></a>00156                         <span class="keyword">template</span> &lt;<span class="keyword">class</span> VECTORLIKE&gt;
<a name="l00157"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#afc67a701bfe3cea78fb48d818c8e64fb">00157</a>                         <span class="keywordtype">void</span> setDistortionParamsVector( <span class="keyword">const</span> VECTORLIKE &amp;distParVector )
<a name="l00158"></a>00158                         {
<a name="l00159"></a>00159                                 <a class="code" href="mrpt__macros_8h.html#a47eb5a445c2bf3d9190396510ea9683e">ASSERT_</a>(distParVector.size()==4 || distParVector.size()==5)
<a name="l00160"></a>00160                                 dist[4] = 0; <span class="comment">// Default value</span>
<a name="l00161"></a>00161                                 <span class="keywordflow">for</span> (<span class="keyword">typename</span> VECTORLIKE::Index i=0;i&lt;distParVector.size();i++)
<a name="l00162"></a>00162                                         dist[i] = distParVector[i];
<a name="l00163"></a>00163                         }
<a name="l00164"></a>00164 <span class="comment"></span>
<a name="l00165"></a>00165 <span class="comment">                        /** Set the vector of distortion params of the camera from the individual values of the distortion coefficients</span>
<a name="l00166"></a>00166 <span class="comment">                          */</span>
<a name="l00167"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#ab2ad006df5975c93b2c47e8f1c05b750">00167</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> setDistortionParamsFromValues( <span class="keywordtype">double</span> k1, <span class="keywordtype">double</span> k2, <span class="keywordtype">double</span> p1, <span class="keywordtype">double</span> p2, <span class="keywordtype">double</span> k3 = 0 )
<a name="l00168"></a>00168                         {
<a name="l00169"></a>00169                                 dist[0] = k1;
<a name="l00170"></a>00170                                 dist[1] = k2;
<a name="l00171"></a>00171                                 dist[2] = p1;
<a name="l00172"></a>00172                                 dist[3] = p2;
<a name="l00173"></a>00173                                 dist[4] = k3;
<a name="l00174"></a>00174                         }
<a name="l00175"></a>00175 <span class="comment"></span>
<a name="l00176"></a>00176 <span class="comment">                        /** Get the value of the principal point x-coordinate (in pixels). */</span>
<a name="l00177"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#abe3a3d34f75e8dd554a9bf52c9ab6626">00177</a>                         <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#abe3a3d34f75e8dd554a9bf52c9ab6626" title="Get the value of the principal point x-coordinate (in pixels).">cx</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> intrinsicParams(0,2); }<span class="comment"></span>
<a name="l00178"></a>00178 <span class="comment">                        /** Get the value of the principal point y-coordinate  (in pixels). */</span>
<a name="l00179"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#aaeba6c9dc0e4259ec9d435429c4a9e6e">00179</a>                         <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#aaeba6c9dc0e4259ec9d435429c4a9e6e" title="Get the value of the principal point y-coordinate (in pixels).">cy</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> intrinsicParams(1,2); }<span class="comment"></span>
<a name="l00180"></a>00180 <span class="comment">                        /** Get the value of the focal length x-value (in pixels). */</span>
<a name="l00181"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a7566437233d844a551e3cce5effde1ea">00181</a>                         <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a7566437233d844a551e3cce5effde1ea" title="Get the value of the focal length x-value (in pixels).">fx</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> intrinsicParams(0,0); }<span class="comment"></span>
<a name="l00182"></a>00182 <span class="comment">                        /** Get the value of the focal length y-value (in pixels). */</span>
<a name="l00183"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a75c5210381d62848b8c918a438991c55">00183</a>                         <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a75c5210381d62848b8c918a438991c55" title="Get the value of the focal length y-value (in pixels).">fy</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> intrinsicParams(1,1); }
<a name="l00184"></a>00184 <span class="comment"></span>
<a name="l00185"></a>00185 <span class="comment">                        /** Set the value of the principal point x-coordinate (in pixels). */</span>
<a name="l00186"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#abc9bf7c8d10fc3892c90a48aeff4dacf">00186</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#abc9bf7c8d10fc3892c90a48aeff4dacf" title="Set the value of the principal point x-coordinate (in pixels).">cx</a>(<span class="keywordtype">double</span> val) { intrinsicParams(0,2)=val; }<span class="comment"></span>
<a name="l00187"></a>00187 <span class="comment">                        /** Set the value of the principal point y-coordinate  (in pixels). */</span>
<a name="l00188"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a6d88b10fa473c927becc863f91a51a24">00188</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a6d88b10fa473c927becc863f91a51a24" title="Set the value of the principal point y-coordinate (in pixels).">cy</a>(<span class="keywordtype">double</span> val) { intrinsicParams(1,2)=val; }<span class="comment"></span>
<a name="l00189"></a>00189 <span class="comment">                        /** Set the value of the focal length x-value (in pixels). */</span>
<a name="l00190"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a57f62e1eb2df03e882116c3e452b26d0">00190</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a57f62e1eb2df03e882116c3e452b26d0" title="Set the value of the focal length x-value (in pixels).">fx</a>(<span class="keywordtype">double</span> val) { intrinsicParams(0,0)=val; }<span class="comment"></span>
<a name="l00191"></a>00191 <span class="comment">                        /** Set the value of the focal length y-value (in pixels). */</span>
<a name="l00192"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a19e5c713a1926173699b3e73542b2ff6">00192</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a19e5c713a1926173699b3e73542b2ff6" title="Set the value of the focal length y-value (in pixels).">fy</a>(<span class="keywordtype">double</span> val) { intrinsicParams(1,1)=val; }
<a name="l00193"></a>00193 <span class="comment"></span>
<a name="l00194"></a>00194 <span class="comment">                        /** Get the value of the k1 distortion parameter.  */</span>
<a name="l00195"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a2571bf5873d9035d9e3c027b31e80147">00195</a>                         <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a2571bf5873d9035d9e3c027b31e80147" title="Get the value of the k1 distortion parameter.">k1</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> dist[0]; }<span class="comment"></span>
<a name="l00196"></a>00196 <span class="comment">                        /** Get the value of the k2 distortion parameter.  */</span>
<a name="l00197"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a0e3bda9bf8939dff10e00d2259338abc">00197</a>                         <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a0e3bda9bf8939dff10e00d2259338abc" title="Get the value of the k2 distortion parameter.">k2</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> dist[1]; }<span class="comment"></span>
<a name="l00198"></a>00198 <span class="comment">                        /** Get the value of the p1 distortion parameter.  */</span>
<a name="l00199"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a0c962f25e53d1aa57110fa8bd3563039">00199</a>                         <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a0c962f25e53d1aa57110fa8bd3563039" title="Get the value of the p1 distortion parameter.">p1</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> dist[2]; }<span class="comment"></span>
<a name="l00200"></a>00200 <span class="comment">                        /** Get the value of the p2 distortion parameter.  */</span>
<a name="l00201"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a96611a2321aac3af3aacdd78b3db17b9">00201</a>                         <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a96611a2321aac3af3aacdd78b3db17b9" title="Get the value of the p2 distortion parameter.">p2</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> dist[3]; }<span class="comment"></span>
<a name="l00202"></a>00202 <span class="comment">                        /** Get the value of the k3 distortion parameter.  */</span>
<a name="l00203"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#aa16107a55f7791f1a92222a71d7ccbfa">00203</a>                         <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#aa16107a55f7791f1a92222a71d7ccbfa" title="Get the value of the k3 distortion parameter.">k3</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> dist[4]; }
<a name="l00204"></a>00204 <span class="comment"></span>
<a name="l00205"></a>00205 <span class="comment">                        /** Get the value of the k1 distortion parameter.  */</span>
<a name="l00206"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a72c206da9190c5b249c46b117081005b">00206</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a72c206da9190c5b249c46b117081005b" title="Get the value of the k1 distortion parameter.">k1</a>(<span class="keywordtype">double</span> val) { dist[0]=val; }<span class="comment"></span>
<a name="l00207"></a>00207 <span class="comment">                        /** Get the value of the k2 distortion parameter.  */</span>
<a name="l00208"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a35a278e2be66ad5a3bc69a19a41759c2">00208</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a35a278e2be66ad5a3bc69a19a41759c2" title="Get the value of the k2 distortion parameter.">k2</a>(<span class="keywordtype">double</span> val) { dist[1]=val; }<span class="comment"></span>
<a name="l00209"></a>00209 <span class="comment">                        /** Get the value of the p1 distortion parameter.  */</span>
<a name="l00210"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#ad2ffc4003df702322571aa030e54d72f">00210</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#ad2ffc4003df702322571aa030e54d72f" title="Get the value of the p1 distortion parameter.">p1</a>(<span class="keywordtype">double</span> val) { dist[2]=val; }<span class="comment"></span>
<a name="l00211"></a>00211 <span class="comment">                        /** Get the value of the p2 distortion parameter.  */</span>
<a name="l00212"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a088acdc669bf19d8171210bc81a7e958">00212</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a088acdc669bf19d8171210bc81a7e958" title="Get the value of the p2 distortion parameter.">p2</a>(<span class="keywordtype">double</span> val) { dist[3]=val; }<span class="comment"></span>
<a name="l00213"></a>00213 <span class="comment">                        /** Get the value of the k3 distortion parameter.  */</span>
<a name="l00214"></a><a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a7b08e8cd61428ef44e2a3da8899069f1">00214</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a7b08e8cd61428ef44e2a3da8899069f1" title="Get the value of the k3 distortion parameter.">k3</a>(<span class="keywordtype">double</span> val) { dist[4]=val; }
<a name="l00215"></a>00215                 }; <span class="comment">// end class TCamera</span>
<a name="l00216"></a>00216 
<a name="l00217"></a>00217 
<a name="l00218"></a>00218                 <span class="keywordtype">bool</span> <a class="code" href="base_2include_2mrpt_2base_2link__pragmas_8h.html#a6045fa0129b1a3d6c8bf895470e66574">BASE_IMPEXP</a> <a class="code" href="namespacemrpt_1_1utils.html#a3156999622f3787343b1c008f12c29f9">operator ==</a>(<span class="keyword">const</span> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html" title="Structure to hold the parameters of a pinhole camera model.">mrpt::utils::TCamera</a>&amp; a, <span class="keyword">const</span> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html" title="Structure to hold the parameters of a pinhole camera model.">mrpt::utils::TCamera</a>&amp; b);
<a name="l00219"></a>00219                 <span class="keywordtype">bool</span> <a class="code" href="base_2include_2mrpt_2base_2link__pragmas_8h.html#a6045fa0129b1a3d6c8bf895470e66574">BASE_IMPEXP</a> <a class="code" href="namespacemrpt_1_1utils.html#a01045d8bfa26800dd79a944b01107ce3">operator !=</a>(<span class="keyword">const</span> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html" title="Structure to hold the parameters of a pinhole camera model.">mrpt::utils::TCamera</a>&amp; a, <span class="keyword">const</span> <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html" title="Structure to hold the parameters of a pinhole camera model.">mrpt::utils::TCamera</a>&amp; b);
<a name="l00220"></a>00220 
<a name="l00221"></a>00221 
<a name="l00222"></a><a class="code" href="structmrpt_1_1utils_1_1_t_stereo_camera_ptr.html#a6350aa805161628026fbd65957338131">00222</a>                 <a class="code" href="_c_serializable_8h.html#ab89b7a3de0a1baf5a5af4454add7d0f8" title="This declaration must be inserted in all CSerializable classes definition, before the class declarati...">DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE</a>( <a class="code" href="classmrpt_1_1utils_1_1_t_stereo_camera.html" title="Structure to hold the parameters of a pinhole stereo camera model.">TStereoCamera</a>, <a class="code" href="classmrpt_1_1utils_1_1_c_serializable.html" title="The virtual base class which provides a unified interface for all persistent objects in MRPT...">mrpt::utils::CSerializable</a> )
<a name="l00223"></a>00223 
<a name="l00224"></a><a class="code" href="namespacemrpt_1_1utils.html#a365691a582e6ffbd1028e823549b7d92">00224</a>                 enum <a class="code" href="namespacemrpt_1_1utils.html#a365691a582e6ffbd1028e823549b7d92">TStereoCameraModel</a>
<a name="l00225"></a>00225                 {
<a name="l00226"></a><a class="code" href="namespacemrpt_1_1utils.html#a365691a582e6ffbd1028e823549b7d92a299c6391220e290f40cbeb602046db83">00226</a>                     <a class="code" href="namespacemrpt_1_1utils.html#a365691a582e6ffbd1028e823549b7d92a299c6391220e290f40cbeb602046db83">Bumblebee</a> = 0,
<a name="l00227"></a><a class="code" href="namespacemrpt_1_1utils.html#a365691a582e6ffbd1028e823549b7d92a6e8f3b8984bda252238e3b770389ebe3">00227</a>                     <a class="code" href="namespacemrpt_1_1utils.html#a365691a582e6ffbd1028e823549b7d92a6e8f3b8984bda252238e3b770389ebe3">Custom</a>,
<a name="l00228"></a><a class="code" href="namespacemrpt_1_1utils.html#a365691a582e6ffbd1028e823549b7d92acba73345a539f6132d6e848f2295be72">00228</a>                     <a class="code" href="namespacemrpt_1_1utils.html#a365691a582e6ffbd1028e823549b7d92acba73345a539f6132d6e848f2295be72">Uncalibrated</a>
<a name="l00229"></a>00229                 };
<a name="l00230"></a>00230 <span class="comment"></span>
<a name="l00231"></a>00231 <span class="comment">                /** Structure to hold the parameters of a pinhole stereo camera model.</span>
<a name="l00232"></a>00232 <span class="comment">                  *  The parameters obtained for one camera resolution can be used for any other resolution by means of the method TCamera::scaleToResolution()</span>
<a name="l00233"></a>00233 <span class="comment">                  *</span>
<a name="l00234"></a>00234 <span class="comment">                  * \sa mrpt::vision::CCamModel, the application &lt;a href=&quot;http://www.mrpt.org/Application:camera-calib-gui&quot; &gt;camera-calib-gui&lt;/a&gt; for calibrating a camera</span>
<a name="l00235"></a>00235 <span class="comment">                 */</span>
<a name="l00236"></a>00236         <span class="keyword">class </span><a class="code" href="base_2include_2mrpt_2base_2link__pragmas_8h.html#a6045fa0129b1a3d6c8bf895470e66574">BASE_IMPEXP</a> TStereoCamera : <span class="keyword">public</span> mrpt::utils::<a class="code" href="namespacemrpt_1_1utils.html#a9f31abb393bf84af21fecce4c4070b40">CSerializable</a>
<a name="l00237"></a>00237                 {
<a name="l00238"></a><a class="code" href="classmrpt_1_1utils_1_1_t_stereo_camera.html#a91b1d8a1a2c74b34a23bdcefe5f7b319">00238</a>             <a class="code" href="_c_serializable_8h.html#a72ab55bf7ae009c89b75715cfa21e84d" title="This declaration must be inserted in all CSerializable classes definition, within the class declarati...">DEFINE_SERIALIZABLE</a>( <a class="code" href="classmrpt_1_1utils_1_1_t_stereo_camera.html" title="Structure to hold the parameters of a pinhole stereo camera model.">TStereoCamera</a> )
<a name="l00239"></a>00239 
<a name="l00240"></a>00240         public:
<a name="l00241"></a>00241 
<a name="l00242"></a><a class="code" href="classmrpt_1_1utils_1_1_t_stereo_camera.html#aab347a6238fa6866eab91e463b9f5451">00242</a>                     <a class="code" href="namespacemrpt_1_1utils.html#a365691a582e6ffbd1028e823549b7d92">TStereoCameraModel</a>  model;
<a name="l00243"></a><a class="code" href="classmrpt_1_1utils_1_1_t_stereo_camera.html#a165a2ecc5395109501116c51641140c0">00243</a>                     <a class="code" href="classmrpt_1_1utils_1_1_t_camera.html" title="Structure to hold the parameters of a pinhole camera model.">TCamera</a>             leftCamera, rightCamera;
<a name="l00244"></a><a class="code" href="classmrpt_1_1utils_1_1_t_stereo_camera.html#a151471587972a72436e8023a8558f8e8">00244</a>                     <a class="code" href="classmrpt_1_1poses_1_1_c_pose3_d_quat.html" title="A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,qz).">CPose3DQuat</a>         rightCameraPose;
<a name="l00245"></a>00245 
<a name="l00246"></a>00246             <span class="comment">// Default constructor:</span>
<a name="l00247"></a>00247             <span class="comment">// Bumblebee with 640x480 images</span>
<a name="l00248"></a><a class="code" href="classmrpt_1_1utils_1_1_t_stereo_camera.html#afe4b915f3197bb313c201e5fd95fa52a">00248</a>                     <a class="code" href="classmrpt_1_1utils_1_1_t_stereo_camera.html" title="Structure to hold the parameters of a pinhole stereo camera model.">TStereoCamera</a>() : model( <a class="code" href="namespacemrpt_1_1utils.html#a365691a582e6ffbd1028e823549b7d92a299c6391220e290f40cbeb602046db83">Bumblebee</a> )
<a name="l00249"></a>00249                     {
<a name="l00250"></a>00250                         leftCamera.<a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a7800fcf258fe074c94f98d8ff984395f">ncols</a> = rightCamera.<a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a7800fcf258fe074c94f98d8ff984395f">ncols</a> = 640;
<a name="l00251"></a>00251                         leftCamera.<a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a4882544de58dafc4b12a62d6d86d8e13" title="Camera resolution.">nrows</a> = rightCamera.<a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a4882544de58dafc4b12a62d6d86d8e13" title="Camera resolution.">nrows</a> = 480;
<a name="l00252"></a>00252 
<a name="l00253"></a>00253                 leftCamera.<a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#af8e10f389d80abc279d3b5bf92aa273a" title="Set the matrix of intrinsic params of the camera from the individual values of focal length and princ...">setIntrinsicParamsFromValues</a>(
<a name="l00254"></a>00254                     0.81945957*leftCamera.<a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a7800fcf258fe074c94f98d8ff984395f">ncols</a>, 1.09261276*leftCamera.<a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a4882544de58dafc4b12a62d6d86d8e13" title="Camera resolution.">nrows</a>,
<a name="l00255"></a>00255                     0.499950781*leftCamera.<a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a7800fcf258fe074c94f98d8ff984395f">ncols</a>, 0.506134245*leftCamera.<a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a4882544de58dafc4b12a62d6d86d8e13" title="Camera resolution.">nrows</a> );
<a name="l00256"></a>00256                 leftCamera.<a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#ab2ad006df5975c93b2c47e8f1c05b750" title="Set the vector of distortion params of the camera from the individual values of the distortion coeffi...">setDistortionParamsFromValues</a>( -3.627383e-001, 2.099672e-001, 0, 0, -8.575903e-002 );
<a name="l00257"></a>00257 
<a name="l00258"></a>00258                 rightCamera.<a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#af8e10f389d80abc279d3b5bf92aa273a" title="Set the matrix of intrinsic params of the camera from the individual values of focal length and princ...">setIntrinsicParamsFromValues</a>(
<a name="l00259"></a>00259                             0.822166309*leftCamera.<a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a7800fcf258fe074c94f98d8ff984395f">ncols</a>, 1.096221745*leftCamera.<a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a4882544de58dafc4b12a62d6d86d8e13" title="Camera resolution.">nrows</a>,
<a name="l00260"></a>00260                             0.507065918*leftCamera.<a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a7800fcf258fe074c94f98d8ff984395f">ncols</a>, 0.524686589*leftCamera.<a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a4882544de58dafc4b12a62d6d86d8e13" title="Camera resolution.">nrows</a> );
<a name="l00261"></a>00261                 rightCamera.<a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#ab2ad006df5975c93b2c47e8f1c05b750" title="Set the vector of distortion params of the camera from the individual values of the distortion coeffi...">setDistortionParamsFromValues</a>( -3.782850e-001, 2.539438e-001, 0, 0, -1.279638e-001 );
<a name="l00262"></a>00262 
<a name="l00263"></a>00263                 leftCamera.<a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a08127fe5bbd8fecf3e34cca2882f89fc" title="The focal length of the camera, in meters (can be used among &#39;intrinsicParams&#39; to determine the pixel...">focalLengthMeters</a> = rightCamera.<a class="code" href="classmrpt_1_1utils_1_1_t_camera.html#a08127fe5bbd8fecf3e34cca2882f89fc" title="The focal length of the camera, in meters (can be used among &#39;intrinsicParams&#39; to determine the pixel...">focalLengthMeters</a> = 0.0038;      <span class="comment">// 3.8 mm</span>
<a name="l00264"></a>00264 
<a name="l00265"></a>00265                 <span class="comment">// Camera pose</span>
<a name="l00266"></a>00266                 <a class="code" href="classmrpt_1_1math_1_1_c_matrix_fixed_numeric.html">CMatrixDouble44</a> A;
<a name="l00267"></a>00267                 A.set_unsafe(0,0,9.999777e-001);    A.set_unsafe(0,1,-6.262494e-003);   A.set_unsafe(0,2,2.340592e-003);    A.set_unsafe(0,3,1.227338e-001);
<a name="l00268"></a>00268                 A.set_unsafe(1,0,6.261120e-003);    A.set_unsafe(1,1,9.999802e-001);    A.set_unsafe(1,2,5.939072e-004);    A.set_unsafe(1,3,-3.671682e-004);
<a name="l00269"></a>00269                 A.set_unsafe(2,0,-2.344265e-003);   A.set_unsafe(2,1,-5.792392e-004);   A.set_unsafe(2,2,9.999971e-001);    A.set_unsafe(2,3,-1.499571e-004);
<a name="l00270"></a>00270                 A.set_unsafe(3,0,0);                A.set_unsafe(3,1,0);                A.set_unsafe(3,2,0);                A.set_unsafe(3,3,0);
<a name="l00271"></a>00271                 rightCameraPose = <a class="code" href="namespacemrpt_1_1poses.html#a1d4ae634d5f0417a36ca15a4d928300d">CPose3DQuat</a>( A );
<a name="l00272"></a>00272                     }
<a name="l00273"></a>00273 <span class="comment"></span>
<a name="l00274"></a>00274 <span class="comment">                    /**  Save as a config block:</span>
<a name="l00275"></a>00275 <span class="comment">                          *  \code</span>
<a name="l00276"></a>00276 <span class="comment">                          *  [SECTION]</span>
<a name="l00277"></a>00277 <span class="comment">                          *  resolution = [NCOLS NROWS]</span>
<a name="l00278"></a>00278 <span class="comment">                          *  cx         = CX</span>
<a name="l00279"></a>00279 <span class="comment">                          *  cy         = CY</span>
<a name="l00280"></a>00280 <span class="comment">                          *  fx         = FX</span>
<a name="l00281"></a>00281 <span class="comment">                          *  fy         = FY</span>
<a name="l00282"></a>00282 <span class="comment">                          *  dist       = [K1 K2 T1 T2 K3]</span>
<a name="l00283"></a>00283 <span class="comment">                          *  focal_length = FOCAL_LENGTH</span>
<a name="l00284"></a>00284 <span class="comment">                          *  \endcode</span>
<a name="l00285"></a>00285 <span class="comment">                          */</span>
<a name="l00286"></a>00286                         <span class="keywordtype">void</span> saveToConfigFile( <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &amp;section, <a class="code" href="classmrpt_1_1utils_1_1_c_config_file_base.html" title="This class allows loading and storing values and vectors of different types from a configuration text...">mrpt::utils::CConfigFileBase</a> &amp;cfg ) <span class="keyword">const</span>;
<a name="l00287"></a>00287 <span class="comment"></span>
<a name="l00288"></a>00288 <span class="comment">                        /**  Load all the params from a config source, in the format used in saveToConfigFile(), that is:</span>
<a name="l00289"></a>00289 <span class="comment">                          *</span>
<a name="l00290"></a>00290 <span class="comment">                          *  \code</span>
<a name="l00291"></a>00291 <span class="comment">                          *  [SECTION]</span>
<a name="l00292"></a>00292 <span class="comment">                          *  resolution = [NCOLS NROWS]</span>
<a name="l00293"></a>00293 <span class="comment">                          *  cx         = CX</span>
<a name="l00294"></a>00294 <span class="comment">                          *  cy         = CY</span>
<a name="l00295"></a>00295 <span class="comment">                          *  fx         = FX</span>
<a name="l00296"></a>00296 <span class="comment">                          *  fy         = FY</span>
<a name="l00297"></a>00297 <span class="comment">                          *  dist       = [K1 K2 T1 T2 K3]</span>
<a name="l00298"></a>00298 <span class="comment">                          *  focal_length = FOCAL_LENGTH  [optional field]</span>
<a name="l00299"></a>00299 <span class="comment">                          *  \endcode</span>
<a name="l00300"></a>00300 <span class="comment">                          *  \exception std::exception on missing fields</span>
<a name="l00301"></a>00301 <span class="comment">                          */</span>
<a name="l00302"></a>00302                         <span class="keywordtype">void</span> loadFromConfigFile(<span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &amp;section, <span class="keyword">const</span> <a class="code" href="classmrpt_1_1utils_1_1_c_config_file_base.html" title="This class allows loading and storing values and vectors of different types from a configuration text...">mrpt::utils::CConfigFileBase</a> &amp;cfg );
<a name="l00303"></a>00303 
<a name="l00304"></a>00304                 }; <span class="comment">// end class TStereoCamera</span>
<a name="l00305"></a>00305 
<a name="l00306"></a>00306         } <span class="comment">// End of namespace</span>
<a name="l00307"></a>00307 } <span class="comment">// end of namespace</span>
<a name="l00308"></a>00308 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<br><hr><br> <table border="0" width="100%"> <tr> <td> Page generated by <a href="http://www.doxygen.org" target="_blank">Doxygen 1.7.5</a> for MRPT 0.9.5 SVN: at Sun Sep 25 17:20:18 UTC 2011</td><td></td> <td width="100"> </td> <td width="150">  </td></tr> </table>  </body></html>