image_8h-source.html

来自「显著区域检测。求的图像中感兴趣区域的位置」· HTML 代码 · 共 123 行

HTML
123
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><title>SaliencyToolbox: Image.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"><link href="tabs.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.5.2 --><div class="tabs">  <ul>    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>    <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>    <li class="current"><a href="files.html"><span>Files</span></a></li>  </ul></div><div class="tabs">  <ul>    <li><a href="files.html"><span>File&nbsp;List</span></a></li>    <li><a href="globals.html"><span>Globals</span></a></li>  </ul></div><h1>Image.h</h1><a href="Image_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <a name="l00004"></a>00004 <span class="comment">// This file is part of the SaliencyToolbox - Copyright (C) 2006-2007</span><a name="l00005"></a>00005 <span class="comment">// by Dirk B. Walther and the California Institute of Technology.</span><a name="l00006"></a>00006 <span class="comment">// See the enclosed LICENSE.TXT document for the license agreement. </span><a name="l00007"></a>00007 <span class="comment">// More information about this project is available at: </span><a name="l00008"></a>00008 <span class="comment">// http://www.saliencytoolbox.net</span><a name="l00009"></a>00009 <a name="l00010"></a>00010 <span class="preprocessor">#ifndef IMAGE_H_DEFINED</span><a name="l00011"></a>00011 <span class="preprocessor"></span><span class="preprocessor">#define IMAGE_H_DEFINED</span><a name="l00012"></a>00012 <span class="preprocessor"></span><a name="l00013"></a>00013 <span class="preprocessor">#include &lt;mex.h&gt;</span><a name="l00014"></a>00014 <a name="l00015"></a>00015 <span class="comment">// ######################################################################</span><a name="l00017"></a>00017 <span class="comment"></span><a name="l00019"></a><a class="code" href="classImage.html">00019</a> <span class="keyword">class </span><a class="code" href="classImage.html" title="Provides access and processing functions for an image.">Image</a><a name="l00020"></a>00020 {<a name="l00021"></a>00021 <span class="keyword">public</span>:<a name="l00022"></a>00022     <a name="l00023"></a>00023   <span class="comment">// ######################################################################</span><a name="l00031"></a>00031 <span class="comment"></span>   <a name="l00033"></a>00033   <a class="code" href="classImage.html#58edd1c45b4faeb5f789b0d036d02313" title="Contructor for an uninitialized Image.">Image</a>();<a name="l00034"></a>00034   <a name="l00036"></a>00036   <a class="code" href="classImage.html#58edd1c45b4faeb5f789b0d036d02313" title="Contructor for an uninitialized Image.">Image</a>(<span class="keyword">const</span> mxArray *arr);<a name="l00037"></a>00037   <a name="l00039"></a>00039   <a class="code" href="classImage.html#58edd1c45b4faeb5f789b0d036d02313" title="Contructor for an uninitialized Image.">Image</a>(<span class="keyword">const</span> <a class="code" href="classImage.html" title="Provides access and processing functions for an image.">Image</a>&amp; other);<a name="l00040"></a>00040   <a name="l00042"></a>00042   <a class="code" href="classImage.html#58edd1c45b4faeb5f789b0d036d02313" title="Contructor for an uninitialized Image.">Image</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> w, <span class="keyword">const</span> <span class="keywordtype">int</span> h);<a name="l00043"></a>00043   <a name="l00045"></a>00045   <a class="code" href="classImage.html" title="Provides access and processing functions for an image.">Image</a> <a class="code" href="classImage.html#8b435b87e91840724e41597a71deecb4" title="Copy assigment operator.">operator=</a>(<span class="keyword">const</span> <a class="code" href="classImage.html" title="Provides access and processing functions for an image.">Image</a> other);<a name="l00046"></a>00046    <a name="l00048"></a>00048   <span class="keywordtype">void</span> <a class="code" href="classImage.html#6da101e823ef20810d8fb08e8a856584" title="Initializes from a two-dimensional Matlab array.">initialize</a>(<span class="keyword">const</span> mxArray *arr);<a name="l00049"></a>00049   <a name="l00051"></a>00051   <span class="keywordtype">void</span> <a class="code" href="classImage.html#6da101e823ef20810d8fb08e8a856584" title="Initializes from a two-dimensional Matlab array.">initialize</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> w, <span class="keyword">const</span> <span class="keywordtype">int</span> h);<a name="l00052"></a>00052   <a name="l00054"></a>00054   <span class="comment">// ######################################################################</span><a name="l00057"></a>00057 <span class="comment"></span>  <a name="l00059"></a>00059   <span class="keywordtype">int</span> <a class="code" href="classImage.html#36bcae4838228d574738249a87dc4464" title="Returns the width of the Image.">getWidth</a>() <span class="keyword">const</span>;<a name="l00060"></a>00060   <a name="l00062"></a>00062   <span class="keywordtype">int</span> <a class="code" href="classImage.html#1cd7587f88b6932b5269051d1ba08ff9" title="Returns the height of the Image.">getHeight</a>() <span class="keyword">const</span>;<a name="l00063"></a>00063   <a name="l00065"></a>00065   <span class="keywordtype">int</span> <a class="code" href="classImage.html#9e8efb4cb518bc0ab1253ce8d5ab2783" title="Returns the number of pixels in the Image.">getSize</a>() <span class="keyword">const</span>;<a name="l00066"></a>00066   <a name="l00068"></a>00068   <span class="keywordtype">bool</span> <a class="code" href="classImage.html#b87bf4b103cb5a9cf090f8729f362335" title="Returns whether the Image is initialized.">isInitialized</a>() <span class="keyword">const</span>;<a name="l00069"></a>00069   <a name="l00071"></a>00071 <a name="l00072"></a>00072   mxArray* <a class="code" href="classImage.html#eef0da5d895782bbb9ce3a17b538cf1b" title="Returns a pointer to the underlying Matlab array.">getArray</a>();<a name="l00073"></a>00073   <a name="l00075"></a>00075 <a name="l00076"></a>00076   <span class="keyword">const</span> mxArray* <a class="code" href="classImage.html#35612d5fc9961d1096fcafbccabe5d0e" title="Returns a constant pointer to the underlying Matlab array.">getConstArray</a>() <span class="keyword">const</span>;<a name="l00077"></a>00077   <a name="l00079"></a>00079   <span class="keywordtype">bool</span> <a class="code" href="classImage.html#c48ef479772ddafdfe71ab179ac77019" title="Check if the coordinates are within the bounds of the Image.">coordsOK</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y) <span class="keyword">const</span>;<a name="l00080"></a>00080 <a name="l00082"></a>00082   <span class="keywordtype">double</span> <a class="code" href="classImage.html#dc33e09c67dba8139626448f4dfcfdba" title="Returns a pixel value by index.">getVal</a>(<span class="keywordtype">int</span> index) <span class="keyword">const</span>;<a name="l00083"></a>00083   <a name="l00085"></a>00085   <span class="keywordtype">double</span> <a class="code" href="classImage.html#dc33e09c67dba8139626448f4dfcfdba" title="Returns a pixel value by index.">getVal</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y) <span class="keyword">const</span>;<a name="l00086"></a>00086   <a name="l00088"></a>00088   <span class="keywordtype">void</span> <a class="code" href="classImage.html#085cb560bd1ea0e54726baf7f42a9580" title="Sets a pixel value by index.">setVal</a>(<span class="keywordtype">int</span> index, <span class="keywordtype">double</span> val);<a name="l00089"></a>00089   <a name="l00091"></a>00091   <span class="keywordtype">void</span> <a class="code" href="classImage.html#085cb560bd1ea0e54726baf7f42a9580" title="Sets a pixel value by index.">setVal</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">double</span> val);<a name="l00092"></a>00092 <a name="l00094"></a>00094   <span class="comment">// ######################################################################</span><a name="l00097"></a>00097 <span class="comment"></span>  <a name="l00099"></a>00099 <a name="l00101"></a>00101   <span class="keywordtype">void</span> <a class="code" href="classImage.html#e6b29adaa2f021be2f6945b146fac6fc" title="Clamp the image between bottom and top.">clamp</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> bottom, <span class="keyword">const</span> <span class="keywordtype">double</span> top);<a name="l00102"></a>00102   <a name="l00104"></a>00104 <a name="l00105"></a>00105   <span class="keywordtype">void</span> <a class="code" href="classImage.html#746983fe94bf13fe2bf84ba84f5c4dd9" title="Clamp the image only at the bottom.">clampBottom</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> bottom);<a name="l00106"></a>00106   <a name="l00108"></a>00108 <a name="l00109"></a>00109   <span class="keywordtype">void</span> <a class="code" href="classImage.html#8974e2bbdc9e778403feee80564a07a7" title="Clamp the image only at the top.">clampTop</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> top);<a name="l00110"></a>00110   <a name="l00112"></a>00112 <a name="l00115"></a>00115   <span class="keywordtype">void</span> <a class="code" href="classImage.html#7a7cd0a9881bb7462b124d5d864c712c" title="Count and sum all local maxima above a threshold.">getLocalMaxima</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> thresh, <span class="keywordtype">int</span> *lm_num, <span class="keywordtype">double</span> *lm_sum);<a name="l00116"></a>00116   <a name="l00118"></a>00118   <a class="code" href="classImage.html" title="Provides access and processing functions for an image.">Image</a> <a class="code" href="classImage.html#1744e77216dece6f8150ddba16f57b1f" title="Multiply all values by a scalar factor.">operator*=</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> factor);<a name="l00119"></a>00119   <a name="l00121"></a>00121   <span class="comment">// #####################################################################</span><a name="l00128"></a>00128 <span class="comment"></span>  <a name="l00130"></a><a class="code" href="classImage.html#01d14564f4b61f97d305e293716933cf">00130</a>   <span class="keyword">typedef</span> <span class="keywordtype">double</span>* <a class="code" href="classImage.html#01d14564f4b61f97d305e293716933cf" title="Read/write iterator.">iterator</a>;<a name="l00131"></a>00131   <a name="l00133"></a><a class="code" href="classImage.html#f9f1ae298f5d8f8b44e4e34a72f61c2f">00133</a>   <span class="keyword">typedef</span> <span class="keyword">const</span> <span class="keywordtype">double</span>* <a class="code" href="classImage.html#f9f1ae298f5d8f8b44e4e34a72f61c2f" title="Read-only iterator.">const_iterator</a>;<a name="l00134"></a>00134   <a name="l00136"></a>00136   <a class="code" href="classImage.html#f9f1ae298f5d8f8b44e4e34a72f61c2f" title="Read-only iterator.">const_iterator</a> <a class="code" href="classImage.html#e0666b33daa7ba55e3348d4fff02356f" title="Returns a read-only iterator to the beginning of the Image data.">begin</a>() <span class="keyword">const</span>;<a name="l00137"></a>00137   <a name="l00139"></a>00139   <a class="code" href="classImage.html#f9f1ae298f5d8f8b44e4e34a72f61c2f" title="Read-only iterator.">const_iterator</a> <a class="code" href="classImage.html#d840a50d6451225149a4aed363b0cb91" title="Returns a read-only iterator to the one-past-the-end of the Image data.">end</a>() <span class="keyword">const</span>;<a name="l00140"></a>00140   <a name="l00142"></a>00142   <a class="code" href="classImage.html#01d14564f4b61f97d305e293716933cf" title="Read/write iterator.">iterator</a> <a class="code" href="classImage.html#9987bf538358f25470af7d628e97694a" title="Returns a read/write iterator to the beginning of the Image data.">beginw</a>();<a name="l00143"></a>00143   <a name="l00145"></a>00145   <a class="code" href="classImage.html#01d14564f4b61f97d305e293716933cf" title="Read/write iterator.">iterator</a> <a class="code" href="classImage.html#6bd3897cec644d5fa71e3c10a0f8b393" title="Returns a read/write iterator to the one-past-the-end of the Image data.">endw</a>();<a name="l00146"></a>00146   <a name="l00148"></a>00148   <a name="l00149"></a>00149 <span class="keyword">protected</span>:<a name="l00150"></a><a class="code" href="classImage.html#29d83cb67120560cbc1cd81477486b96">00150</a>   <span class="keywordtype">bool</span> <a class="code" href="classImage.html#29d83cb67120560cbc1cd81477486b96">itsInitialized</a>;<a name="l00151"></a><a class="code" href="classImage.html#f42c9d03363de26f252ff8aaba4a0680">00151</a>   mxArray *<a class="code" href="classImage.html#f42c9d03363de26f252ff8aaba4a0680">itsArray</a>;  <a name="l00152"></a>00152 };<a name="l00153"></a>00153 <a name="l00154"></a>00154 <span class="preprocessor">#endif</span></pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Fri Sep 7 13:09:49 2007 for SaliencyToolbox by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.2 </small></address></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?