structcimg__library_1_1_c_img_stats.html
来自「this a image processing program」· HTML 代码 · 共 340 行 · 第 1/2 页
HTML
340 行
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f0d5eb5af7b3da35f3ad085dff317238"></a><!-- doxytag: member="cimg_library::CImgStats::vmin" ref="f0d5eb5af7b3da35f3ad085dff317238" args="" -->int </td><td class="memItemRight" valign="bottom"><a class="el" href="structcimg__library_1_1_c_img_stats.html#f0d5eb5af7b3da35f3ad085dff317238">vmin</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">V-coordinate of the pixel with minimum value. <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c6c70d6b1a2b259d6baf7e52ac4f1baa"></a><!-- doxytag: member="cimg_library::CImgStats::lmin" ref="c6c70d6b1a2b259d6baf7e52ac4f1baa" args="" -->int </td><td class="memItemRight" valign="bottom"><a class="el" href="structcimg__library_1_1_c_img_stats.html#c6c70d6b1a2b259d6baf7e52ac4f1baa">lmin</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Image number (for a list) containing the minimum pixel. <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3bd9aad0bd6c391604e7a27d57c21d3f"></a><!-- doxytag: member="cimg_library::CImgStats::xmax" ref="3bd9aad0bd6c391604e7a27d57c21d3f" args="" -->int </td><td class="memItemRight" valign="bottom"><a class="el" href="structcimg__library_1_1_c_img_stats.html#3bd9aad0bd6c391604e7a27d57c21d3f">xmax</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">X-coordinate of the pixel with maximum value. <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="740732a581a525ffdac6d4124d517d0e"></a><!-- doxytag: member="cimg_library::CImgStats::ymax" ref="740732a581a525ffdac6d4124d517d0e" args="" -->int </td><td class="memItemRight" valign="bottom"><a class="el" href="structcimg__library_1_1_c_img_stats.html#740732a581a525ffdac6d4124d517d0e">ymax</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Y-coordinate of the pixel with maximum value. <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9b14f3d0b4c2abbedae7a21a858d29fb"></a><!-- doxytag: member="cimg_library::CImgStats::zmax" ref="9b14f3d0b4c2abbedae7a21a858d29fb" args="" -->int </td><td class="memItemRight" valign="bottom"><a class="el" href="structcimg__library_1_1_c_img_stats.html#9b14f3d0b4c2abbedae7a21a858d29fb">zmax</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Z-coordinate of the pixel with maximum value. <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="eb4eb9ad2dc148d828a7f6e270aa0f09"></a><!-- doxytag: member="cimg_library::CImgStats::vmax" ref="eb4eb9ad2dc148d828a7f6e270aa0f09" args="" -->int </td><td class="memItemRight" valign="bottom"><a class="el" href="structcimg__library_1_1_c_img_stats.html#eb4eb9ad2dc148d828a7f6e270aa0f09">vmax</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">V-coordinate of the pixel with maximum value. <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="880eb260d9da52a83b315907eef5a40f"></a><!-- doxytag: member="cimg_library::CImgStats::lmax" ref="880eb260d9da52a83b315907eef5a40f" args="" -->int </td><td class="memItemRight" valign="bottom"><a class="el" href="structcimg__library_1_1_c_img_stats.html#880eb260d9da52a83b315907eef5a40f">lmax</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Image number (for a list) containing the maximum pixel. <br></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>Class used to compute basic statistics on pixel values of a <a class="el" href="structcimg__library_1_1_c_img.html">CImg</a> image. <p>Constructing a <a class="el" href="structcimg__library_1_1_c_img_stats.html">CImgStats</a> instance from an image CImg<T> or a list CImgList<T> will compute the minimum, maximum and average pixel values of the input object. Optionally, the variance of the pixel values can be computed. Coordinates of the pixels whose values are minimum and maximum are also stored. The example below shows how to use <a class="el" href="structcimg__library_1_1_c_img_stats.html">CImgStats</a> objects to retrieve simple statistics of an image : <div class="fragment"><pre class="fragment"> <span class="keyword">const</span> CImg<float> img(<span class="stringliteral">"my_image.jpg"</span>); <span class="comment">// Read JPEG image file.</span> <span class="keyword">const</span> <a class="code" href="structcimg__library_1_1_c_img_stats.html#71333f97c5fdbd6b4d01b5c9f8b8d0e7">CImgStats</a> stats(img); <span class="comment">// Compute basic statistics on the image.</span> stats.print(<span class="stringliteral">"My statistics"</span>); <span class="comment">// Display statistics.</span> std::printf(<span class="stringliteral">"Max-Min = %lf"</span>,stats.max-stats.min); <span class="comment">// Compute the difference between extremum values.</span></pre></div><p>Note that statistics are computed by considering the set of <em>scalar</em> values of the image pixels. No vector-valued statistics are computed. <p><hr><h2>Constructor & Destructor Documentation</h2><a class="anchor" name="591e07cc43b5ba0373b94be5ac70da76"></a><!-- doxytag: member="cimg_library::CImgStats::CImgStats" ref="591e07cc43b5ba0373b94be5ac70da76" args="(const CImg< T > &img, const bool compute_variance=true)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="structcimg__library_1_1_c_img_stats.html">CImgStats</a> </td> <td>(</td> <td class="paramtype">const <a class="el" href="structcimg__library_1_1_c_img.html">CImg</a>< T > & </td> <td class="paramname"> <em>img</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const bool </td> <td class="paramname"> <em>compute_variance</em> = <code>true</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Constructor that computes statistics of an input image <code>img</code>. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>img</em> </td><td>The input image. </td></tr> <tr><td valign="top"></td><td valign="top"><em>compute_variance</em> </td><td>If true, the <code>variance</code> field is computed, else it is set to 0. </td></tr> </table></dl></div></div><p><a class="anchor" name="2e2504241cda0c418def3d7c696d8488"></a><!-- doxytag: member="cimg_library::CImgStats::CImgStats" ref="2e2504241cda0c418def3d7c696d8488" args="(const CImgList< T > &list, const bool compute_variance=true)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="structcimg__library_1_1_c_img_stats.html">CImgStats</a> </td> <td>(</td> <td class="paramtype">const <a class="el" href="structcimg__library_1_1_c_img_list.html">CImgList</a>< T > & </td> <td class="paramname"> <em>list</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const bool </td> <td class="paramname"> <em>compute_variance</em> = <code>true</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Constructor that computes statistics of an input image list <code>list</code>. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>list</em> </td><td>The input list of images. </td></tr> <tr><td valign="top"></td><td valign="top"><em>compute_variance</em> </td><td>If true, the <code>variance</code> field is computed, else it is set to 0. </td></tr> </table></dl></div></div><p><hr><h2>Member Function Documentation</h2><a class="anchor" name="3f08ce8418b9ee7911b72d812ce15af2"></a><!-- doxytag: member="cimg_library::CImgStats::print" ref="3f08ce8418b9ee7911b72d812ce15af2" args="(const char *title=0) const " --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="structcimg__library_1_1_c_img_stats.html">CImgStats</a>& print </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"> <em>title</em> = <code>0</code> </td> <td> ) </td> <td width="100%"> const</td> </tr> </table></div><div class="memdoc"><p>Print the current statistics. <p>Printing is done on the standart error output. </div></div><p><!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en"><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>The CImg Library - C++ Template Image Processing Library</title> <meta content="David Tschumperle" name="author"> <link rel="shortcut icon" type="image/x-icon" href="http://cimg.sourceforge.net/favicon.ico" /> <link rel="icon" type="image/png" href="favicon.png" /> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head> <body bgcolor="#ffffff" fgcolor="#000000" alink="#ff0000" link="#0000ee" vlink="#551a8b"> <hr noshade="noshade" size="1" width="100%"> <a href="http://sourceforge.net"> <img src="http://sourceforge.net/sflogo.php?group_id=96492&type=3" border="0" height="37" width="125"></a><!-- Start of StatCounter Code --><script type="text/javascript" language="javascript"><!-- var sc_project=895001; var sc_invisible=1; var sc_partition=7; var sc_security="5ea85181"; //--></script><script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><a href="http://www.statcounter.com/" target="_blank"><img src="http://c8.statcounter.com/counter.php?sc_project=895001&java=0&security=5ea85181&invisible=1" alt="counter stats" border="0"></a> </noscript><!-- End of StatCounter Code --> </body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?