<!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>mrpt::vision::CImagePyramid Class Reference</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> > <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 Page</span></a></li> <li><a href="pages.html"><span>Related 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 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"> <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="annotated.html"><span>Class List</span></a></li> <li><a href="classes.html"><span>Class Index</span></a></li> <li><a href="inherits.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacemrpt.html">mrpt</a> </li> <li class="navelem"><a class="el" href="namespacemrpt_1_1vision.html">vision</a> </li> <li class="navelem"><a class="el" href="classmrpt_1_1vision_1_1_c_image_pyramid.html">CImagePyramid</a> </li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="#pub-attribs">Public Attributes</a> </div> <div class="headertitle"> <div class="title">mrpt::vision::CImagePyramid Class Reference<div class="ingroups"><a class="el" href="group__mrpt__vision__grp.html">[mrpt-vision]</a></div></div> </div> </div> <div class="contents"> <!-- doxytag: class="mrpt::vision::CImagePyramid" --><hr/><a name="details" id="details"></a><h2>Detailed Description</h2> <div class="textblock"><p>Holds and builds a pyramid of images: starting with an image at full resolution (octave=1), it builds a number of half-resolution images: octave=2 at 1/2 , octave=3 at 1/2^2, octave=N at 1/2^(N-1). </p> <p>Color (RGB) or grayscale pyramids can be built from color input images; only grayscale pyramids can be built from grayscale images.</p> <p>The algorithm to halve the images can be either a 1:2 decimation or a smooth filter (arithmetic mean of every 4 pixels).</p> <p>Pyramids are built by invoking the method <em><a class="el" href="classmrpt_1_1vision_1_1_c_image_pyramid.html#a8e376a3553f3c94046b820dd5b92cd91" title="Fills the vector images with the different octaves built from the input image.">buildPyramid()</a></em> or <em><a class="el" href="classmrpt_1_1vision_1_1_c_image_pyramid.html#a5cf27f162ab1ba63b01f425e5e874c4a" title="Exactly like buildPyramid(), but if the input image has not to be converted from RGB to grayscale...">buildPyramidFast()</a></em> </p> <p>Example of usage: </p> <div class="fragment"><pre class="fragment"> <a class="code" href="classmrpt_1_1vision_1_1_c_image_pyramid.html#aa90178c92593e11ad522c2d0b3a8d860" title="Default constructor, does nothing.">CImagePyramid</a> pyr; CImage img = ... pyr.buildPyramid( img, 4, <span class="comment">// num. of octaves</span> <span class="keyword">true</span> <span class="comment">// smooth</span> ); pyr.images[0].saveToFile(<span class="stringliteral">"pyr0.jpg"</span>); pyr.images[1].saveToFile(<span class="stringliteral">"pyr1.jpg"</span>); ... </pre></div><dl class="note"><dt><b>Note:</b></dt><dd>Both converting to grayscale and building the octave images have SSE2-optimized implementations (if available).</dd></dl> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classmrpt_1_1utils_1_1_c_image.html" title="A class for storing images as grayscale or RGB bitmaps.">mrpt::utils::CImage</a> </dd></dl> </div> <p><code>#include <<a class="el" href="_c_image_pyramid_8h_source.html">mrpt/vision/CImagePyramid.h</a>></code></p> <p><a href="classmrpt_1_1vision_1_1_c_image_pyramid-members.html">List of all members.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1vision_1_1_c_image_pyramid.html#aa90178c92593e11ad522c2d0b3a8d860">CImagePyramid</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor, does nothing. <a href="#aa90178c92593e11ad522c2d0b3a8d860"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1vision_1_1_c_image_pyramid.html#ac42660475c73eec01ae2df0fe32cb207">~CImagePyramid</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor, frees the stored images. <a href="#ac42660475c73eec01ae2df0fe32cb207"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1vision_1_1_c_image_pyramid.html#a8e376a3553f3c94046b820dd5b92cd91">buildPyramid</a> (const <a class="el" href="classmrpt_1_1utils_1_1_c_image.html">mrpt::utils::CImage</a> &img, const size_t nOctaves, const bool smooth_halves=true, const bool convert_grayscale=false)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Fills the vector <em>images</em> with the different octaves built from the input image. <a href="#a8e376a3553f3c94046b820dd5b92cd91"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1vision_1_1_c_image_pyramid.html#a5cf27f162ab1ba63b01f425e5e874c4a">buildPyramidFast</a> (<a class="el" href="classmrpt_1_1utils_1_1_c_image.html">mrpt::utils::CImage</a> &img, const size_t nOctaves, const bool smooth_halves=true, const bool convert_grayscale=false)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Exactly like <em><a class="el" href="classmrpt_1_1vision_1_1_c_image_pyramid.html#a8e376a3553f3c94046b820dd5b92cd91" title="Fills the vector images with the different octaves built from the input image.">buildPyramid()</a></em>, but if the input image has not to be converted from RGB to grayscale, the image data buffer is *reutilized* for the 1st octave in <em>images</em>[0], emptying the input image. <a href="#a5cf27f162ab1ba63b01f425e5e874c4a"></a><br/></td></tr> <tr><td colspan="2"><h2><a name="pub-attribs"></a> Public Attributes</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classstd_1_1vector.html">std::vector</a>< <a class="el" href="classmrpt_1_1utils_1_1_c_image.html">mrpt::utils::CImage</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1vision_1_1_c_image_pyramid.html#ab65049f36f6d200df3d9e29349d00499">images</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">The individual images: <a href="#ab65049f36f6d200df3d9e29349d00499"></a><br/></td></tr> </table> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="aa90178c92593e11ad522c2d0b3a8d860"></a><!-- doxytag: member="mrpt::vision::CImagePyramid::CImagePyramid" ref="aa90178c92593e11ad522c2d0b3a8d860" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">mrpt::vision::CImagePyramid::CImagePyramid </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Default constructor, does nothing. </p> </div> </div> <a class="anchor" id="ac42660475c73eec01ae2df0fe32cb207"></a><!-- doxytag: member="mrpt::vision::CImagePyramid::~CImagePyramid" ref="ac42660475c73eec01ae2df0fe32cb207" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">mrpt::vision::CImagePyramid::~CImagePyramid </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Destructor, frees the stored images. </p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a8e376a3553f3c94046b820dd5b92cd91"></a><!-- doxytag: member="mrpt::vision::CImagePyramid::buildPyramid" ref="a8e376a3553f3c94046b820dd5b92cd91" args="(const mrpt::utils::CImage &img, const size_t nOctaves, const bool smooth_halves=true, const bool convert_grayscale=false)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mrpt::vision::CImagePyramid::buildPyramid </td> <td>(</td> <td class="paramtype">const <a class="el" href="classmrpt_1_1utils_1_1_c_image.html">mrpt::utils::CImage</a> & </td> <td class="paramname"><em>img</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const size_t </td> <td class="paramname"><em>nOctaves</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const bool </td> <td class="paramname"><em>smooth_halves</em> = <code>true</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const bool </td> <td class="paramname"><em>convert_grayscale</em> = <code>false</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Fills the vector <em>images</em> with the different octaves built from the input image. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">img</td><td>The input image. Can be either color or grayscale. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">nOctaves</td><td>Number of octaves to build. 1 means just the original image, 2 means the original plus the 1/2 image, etc. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">smooth_halves</td><td>If true, use an arithmetic mean of every 2x2 pixel block when downsampling. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">convert_grayscale</td><td>If true, the pyramid is built in grayscale even for color input images. </td></tr> </table> </dd> </dl> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classmrpt_1_1vision_1_1_c_image_pyramid.html#a5cf27f162ab1ba63b01f425e5e874c4a" title="Exactly like buildPyramid(), but if the input image has not to be converted from RGB to grayscale...">buildPyramidFast</a> </dd></dl> </div> </div> <a class="anchor" id="a5cf27f162ab1ba63b01f425e5e874c4a"></a><!-- doxytag: member="mrpt::vision::CImagePyramid::buildPyramidFast" ref="a5cf27f162ab1ba63b01f425e5e874c4a" args="(mrpt::utils::CImage &img, const size_t nOctaves, const bool smooth_halves=true, const bool convert_grayscale=false)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mrpt::vision::CImagePyramid::buildPyramidFast </td> <td>(</td> <td class="paramtype"><a class="el" href="classmrpt_1_1utils_1_1_c_image.html">mrpt::utils::CImage</a> & </td> <td class="paramname"><em>img</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const size_t </td> <td class="paramname"><em>nOctaves</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const bool </td> <td class="paramname"><em>smooth_halves</em> = <code>true</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const bool </td> <td class="paramname"><em>convert_grayscale</em> = <code>false</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Exactly like <em><a class="el" href="classmrpt_1_1vision_1_1_c_image_pyramid.html#a8e376a3553f3c94046b820dd5b92cd91" title="Fills the vector images with the different octaves built from the input image.">buildPyramid()</a></em>, but if the input image has not to be converted from RGB to grayscale, the image data buffer is *reutilized* for the 1st octave in <em>images</em>[0], emptying the input image. </p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classmrpt_1_1vision_1_1_c_image_pyramid.html#a8e376a3553f3c94046b820dd5b92cd91" title="Fills the vector images with the different octaves built from the input image.">buildPyramid</a> </dd></dl> </div> </div> <hr/><h2>Member Data Documentation</h2> <a class="anchor" id="ab65049f36f6d200df3d9e29349d00499"></a><!-- doxytag: member="mrpt::vision::CImagePyramid::images" ref="ab65049f36f6d200df3d9e29349d00499" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classstd_1_1vector.html">std::vector</a><<a class="el" href="classmrpt_1_1utils_1_1_c_image.html">mrpt::utils::CImage</a>> <a class="el" href="classmrpt_1_1vision_1_1_c_image_pyramid.html#ab65049f36f6d200df3d9e29349d00499">mrpt::vision::CImagePyramid::images</a></td> </tr> </table> </div> <div class="memdoc"> <p>The individual images: </p> <ul> <li>images[0]: 1st octave (full-size)</li> <li>images[1]: 2nd octave (1/2 size)</li> <li>images[2]: 3rd octave (1/4 size) </li> </ul> <p>Definition at line <a class="el" href="_c_image_pyramid_8h_source.html#l00098">98</a> of file <a class="el" href="_c_image_pyramid_8h_source.html">CImagePyramid.h</a>.</p> </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>