Ryan OShea | de36e4a | 2020-03-13 16:26:19 +0000 | [diff] [blame] | 1 | <!-- Copyright (c) 2020 ARM Limited. --> |
| 2 | <!-- --> |
| 3 | <!-- SPDX-License-Identifier: MIT --> |
| 4 | <!-- --> |
| 5 | <!-- HTML header for doxygen 1.8.13--> |
| 6 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 7 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 8 | <head> |
| 9 | <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| 10 | <meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| 11 | <meta name="generator" content="Doxygen 1.8.13"/> |
| 12 | <meta name="robots" content="NOINDEX, NOFOLLOW" /> |
| 13 | <meta name="viewport" content="width=device-width, initial-scale=1"/> |
| 14 | <title>ArmNN: tests/InferenceTestImage.cpp File Reference</title> |
| 15 | <link href="tabs.css" rel="stylesheet" type="text/css"/> |
| 16 | <script type="text/javascript" src="jquery.js"></script> |
| 17 | <script type="text/javascript" src="dynsections.js"></script> |
| 18 | <link href="navtree.css" rel="stylesheet" type="text/css"/> |
| 19 | <script type="text/javascript" src="resize.js"></script> |
| 20 | <script type="text/javascript" src="navtreedata.js"></script> |
| 21 | <script type="text/javascript" src="navtree.js"></script> |
| 22 | <script type="text/javascript"> |
| 23 | $(document).ready(initResizable); |
| 24 | </script> |
| 25 | <link href="search/search.css" rel="stylesheet" type="text/css"/> |
| 26 | <script type="text/javascript" src="search/searchdata.js"></script> |
| 27 | <script type="text/javascript" src="search/search.js"></script> |
| 28 | <script type="text/x-mathjax-config"> |
| 29 | MathJax.Hub.Config({ |
| 30 | extensions: ["tex2jax.js"], |
| 31 | jax: ["input/TeX","output/HTML-CSS"], |
| 32 | }); |
| 33 | </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script> |
| 34 | <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| 35 | <link href="stylesheet.css" rel="stylesheet" type="text/css"/> |
| 36 | </head> |
| 37 | <body> |
| 38 | <div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| 39 | <div id="titlearea"> |
| 40 | <table cellspacing="0" cellpadding="0"> |
| 41 | <tbody> |
| 42 | <tr style="height: 56px;"> |
| 43 | <img alt="ArmNN" src="Arm_NN_horizontal_blue.png" style="max-width: 10rem; margin-top: .5rem; margin-left 10px"/> |
| 44 | <td style="padding-left: 0.5em;"> |
| 45 | <div id="projectname"> |
| 46 |  <span id="projectnumber">20.02</span> |
| 47 | </div> |
| 48 | </td> |
| 49 | </tr> |
| 50 | </tbody> |
| 51 | </table> |
| 52 | </div> |
| 53 | <!-- end header part --> |
| 54 | <!-- Generated by Doxygen 1.8.13 --> |
| 55 | <script type="text/javascript"> |
| 56 | var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| 57 | </script> |
| 58 | <script type="text/javascript" src="menudata.js"></script> |
| 59 | <script type="text/javascript" src="menu.js"></script> |
| 60 | <script type="text/javascript"> |
| 61 | $(function() { |
| 62 | initMenu('',true,false,'search.php','Search'); |
| 63 | $(document).ready(function() { init_search(); }); |
| 64 | }); |
| 65 | </script> |
| 66 | <div id="main-nav"></div> |
| 67 | </div><!-- top --> |
| 68 | <div id="side-nav" class="ui-resizable side-nav-resizable"> |
| 69 | <div id="nav-tree"> |
| 70 | <div id="nav-tree-contents"> |
| 71 | <div id="nav-sync" class="sync"></div> |
| 72 | </div> |
| 73 | </div> |
| 74 | <div id="splitbar" style="-moz-user-select:none;" |
| 75 | class="ui-resizable-handle"> |
| 76 | </div> |
| 77 | </div> |
| 78 | <script type="text/javascript"> |
| 79 | $(document).ready(function(){initNavTree('_inference_test_image_8cpp.xhtml','');}); |
| 80 | </script> |
| 81 | <div id="doc-content"> |
| 82 | <!-- window showing the filter options --> |
| 83 | <div id="MSearchSelectWindow" |
| 84 | onmouseover="return searchBox.OnSearchSelectShow()" |
| 85 | onmouseout="return searchBox.OnSearchSelectHide()" |
| 86 | onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| 87 | </div> |
| 88 | |
| 89 | <!-- iframe showing the search results (closed by default) --> |
| 90 | <div id="MSearchResultsWindow"> |
| 91 | <iframe src="javascript:void(0)" frameborder="0" |
| 92 | name="MSearchResults" id="MSearchResults"> |
| 93 | </iframe> |
| 94 | </div> |
| 95 | |
| 96 | <div class="header"> |
| 97 | <div class="summary"> |
| 98 | <a href="#define-members">Macros</a> | |
| 99 | <a href="#func-members">Functions</a> </div> |
| 100 | <div class="headertitle"> |
| 101 | <div class="title">InferenceTestImage.cpp File Reference</div> </div> |
| 102 | </div><!--header--> |
| 103 | <div class="contents"> |
| 104 | <div class="textblock"><code>#include "<a class="el" href="_inference_test_image_8hpp_source.xhtml">InferenceTestImage.hpp</a>"</code><br /> |
| 105 | <code>#include <<a class="el" href="_ignore_unused_8hpp_source.xhtml">armnn/utility/IgnoreUnused.hpp</a>></code><br /> |
| 106 | <code>#include <boost/format.hpp></code><br /> |
| 107 | <code>#include <boost/numeric/conversion/cast.hpp></code><br /> |
| 108 | <code>#include <array></code><br /> |
| 109 | <code>#include <stb/stb_image.h></code><br /> |
| 110 | <code>#include <stb/stb_image_resize.h></code><br /> |
| 111 | <code>#include <stb/stb_image_write.h></code><br /> |
| 112 | </div> |
| 113 | <p><a href="_inference_test_image_8cpp_source.xhtml">Go to the source code of this file.</a></p> |
| 114 | <table class="memberdecls"> |
| 115 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> |
| 116 | Macros</h2></td></tr> |
| 117 | <tr class="memitem:a18372412ad2fc3ce1e3240b3cf0efe78"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="_inference_test_image_8cpp.xhtml#a18372412ad2fc3ce1e3240b3cf0efe78">STB_IMAGE_IMPLEMENTATION</a></td></tr> |
| 118 | <tr class="separator:a18372412ad2fc3ce1e3240b3cf0efe78"><td class="memSeparator" colspan="2"> </td></tr> |
| 119 | <tr class="memitem:aa6a7b41350a14f718b619164bc2b8fdf"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="_inference_test_image_8cpp.xhtml#aa6a7b41350a14f718b619164bc2b8fdf">STB_IMAGE_RESIZE_IMPLEMENTATION</a></td></tr> |
| 120 | <tr class="separator:aa6a7b41350a14f718b619164bc2b8fdf"><td class="memSeparator" colspan="2"> </td></tr> |
| 121 | <tr class="memitem:aefe397a94e8feddc652f92ef40ce9597"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="_inference_test_image_8cpp.xhtml#aefe397a94e8feddc652f92ef40ce9597">STB_IMAGE_WRITE_IMPLEMENTATION</a></td></tr> |
| 122 | <tr class="separator:aefe397a94e8feddc652f92ef40ce9597"><td class="memSeparator" colspan="2"> </td></tr> |
| 123 | </table><table class="memberdecls"> |
| 124 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> |
| 125 | Functions</h2></td></tr> |
| 126 | <tr class="memitem:ada9c94c9ae0a7082f648f75f50d57be1"><td class="memTemplParams" colspan="2">template<typename TProcessValueCallable > </td></tr> |
| 127 | <tr class="memitem:ada9c94c9ae0a7082f648f75f50d57be1"><td class="memTemplItemLeft" align="right" valign="top">std::vector< float > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="_inference_test_image_8cpp.xhtml#ada9c94c9ae0a7082f648f75f50d57be1">GetImageDataInArmNnLayoutAsFloats</a> (<a class="el" href="_inference_test_image_8hpp.xhtml#a5f7592b0a8fa09208cd32721cf207110">ImageChannelLayout</a> channelLayout, const <a class="el" href="class_inference_test_image.xhtml">InferenceTestImage</a> &image, TProcessValueCallable processValue)</td></tr> |
| 128 | <tr class="separator:ada9c94c9ae0a7082f648f75f50d57be1"><td class="memSeparator" colspan="2"> </td></tr> |
| 129 | <tr class="memitem:a3f8ac82c346c723f775a383d22239182"><td class="memItemLeft" align="right" valign="top">std::vector< float > </td><td class="memItemRight" valign="bottom"><a class="el" href="_inference_test_image_8cpp.xhtml#a3f8ac82c346c723f775a383d22239182">GetImageDataInArmNnLayoutAsNormalizedFloats</a> (<a class="el" href="_inference_test_image_8hpp.xhtml#a5f7592b0a8fa09208cd32721cf207110">ImageChannelLayout</a> layout, const <a class="el" href="class_inference_test_image.xhtml">InferenceTestImage</a> &image)</td></tr> |
| 130 | <tr class="separator:a3f8ac82c346c723f775a383d22239182"><td class="memSeparator" colspan="2"> </td></tr> |
| 131 | <tr class="memitem:a16f15d88afcc9c6bba231cc72bdd8cbf"><td class="memItemLeft" align="right" valign="top">std::vector< float > </td><td class="memItemRight" valign="bottom"><a class="el" href="_inference_test_image_8cpp.xhtml#a16f15d88afcc9c6bba231cc72bdd8cbf">GetImageDataInArmNnLayoutAsFloatsSubtractingMean</a> (<a class="el" href="_inference_test_image_8hpp.xhtml#a5f7592b0a8fa09208cd32721cf207110">ImageChannelLayout</a> layout, const <a class="el" href="class_inference_test_image.xhtml">InferenceTestImage</a> &image, const std::array< float, 3 > &mean)</td></tr> |
| 132 | <tr class="separator:a16f15d88afcc9c6bba231cc72bdd8cbf"><td class="memSeparator" colspan="2"> </td></tr> |
| 133 | <tr class="memitem:a0b39a9dcbed4124b88b7b58f5d77096f"><td class="memItemLeft" align="right" valign="top">std::vector< float > </td><td class="memItemRight" valign="bottom"><a class="el" href="_inference_test_image_8cpp.xhtml#a0b39a9dcbed4124b88b7b58f5d77096f">GetImageDataAsNormalizedFloats</a> (<a class="el" href="_inference_test_image_8hpp.xhtml#a5f7592b0a8fa09208cd32721cf207110">ImageChannelLayout</a> layout, const <a class="el" href="class_inference_test_image.xhtml">InferenceTestImage</a> &image)</td></tr> |
| 134 | <tr class="separator:a0b39a9dcbed4124b88b7b58f5d77096f"><td class="memSeparator" colspan="2"> </td></tr> |
| 135 | </table> |
| 136 | <h2 class="groupheader">Macro Definition Documentation</h2> |
| 137 | <a id="a18372412ad2fc3ce1e3240b3cf0efe78"></a> |
| 138 | <h2 class="memtitle"><span class="permalink"><a href="#a18372412ad2fc3ce1e3240b3cf0efe78">◆ </a></span>STB_IMAGE_IMPLEMENTATION</h2> |
| 139 | |
| 140 | <div class="memitem"> |
| 141 | <div class="memproto"> |
| 142 | <table class="memname"> |
| 143 | <tr> |
| 144 | <td class="memname">#define STB_IMAGE_IMPLEMENTATION</td> |
| 145 | </tr> |
| 146 | </table> |
| 147 | </div><div class="memdoc"> |
| 148 | |
| 149 | <p class="definition">Definition at line <a class="el" href="_inference_test_image_8cpp_source.xhtml#l00014">14</a> of file <a class="el" href="_inference_test_image_8cpp_source.xhtml">InferenceTestImage.cpp</a>.</p> |
| 150 | |
| 151 | </div> |
| 152 | </div> |
| 153 | <a id="aa6a7b41350a14f718b619164bc2b8fdf"></a> |
| 154 | <h2 class="memtitle"><span class="permalink"><a href="#aa6a7b41350a14f718b619164bc2b8fdf">◆ </a></span>STB_IMAGE_RESIZE_IMPLEMENTATION</h2> |
| 155 | |
| 156 | <div class="memitem"> |
| 157 | <div class="memproto"> |
| 158 | <table class="memname"> |
| 159 | <tr> |
| 160 | <td class="memname">#define STB_IMAGE_RESIZE_IMPLEMENTATION</td> |
| 161 | </tr> |
| 162 | </table> |
| 163 | </div><div class="memdoc"> |
| 164 | |
| 165 | <p class="definition">Definition at line <a class="el" href="_inference_test_image_8cpp_source.xhtml#l00017">17</a> of file <a class="el" href="_inference_test_image_8cpp_source.xhtml">InferenceTestImage.cpp</a>.</p> |
| 166 | |
| 167 | </div> |
| 168 | </div> |
| 169 | <a id="aefe397a94e8feddc652f92ef40ce9597"></a> |
| 170 | <h2 class="memtitle"><span class="permalink"><a href="#aefe397a94e8feddc652f92ef40ce9597">◆ </a></span>STB_IMAGE_WRITE_IMPLEMENTATION</h2> |
| 171 | |
| 172 | <div class="memitem"> |
| 173 | <div class="memproto"> |
| 174 | <table class="memname"> |
| 175 | <tr> |
| 176 | <td class="memname">#define STB_IMAGE_WRITE_IMPLEMENTATION</td> |
| 177 | </tr> |
| 178 | </table> |
| 179 | </div><div class="memdoc"> |
| 180 | |
| 181 | <p class="definition">Definition at line <a class="el" href="_inference_test_image_8cpp_source.xhtml#l00020">20</a> of file <a class="el" href="_inference_test_image_8cpp_source.xhtml">InferenceTestImage.cpp</a>.</p> |
| 182 | |
| 183 | </div> |
| 184 | </div> |
| 185 | <h2 class="groupheader">Function Documentation</h2> |
| 186 | <a id="a0b39a9dcbed4124b88b7b58f5d77096f"></a> |
| 187 | <h2 class="memtitle"><span class="permalink"><a href="#a0b39a9dcbed4124b88b7b58f5d77096f">◆ </a></span>GetImageDataAsNormalizedFloats()</h2> |
| 188 | |
| 189 | <div class="memitem"> |
| 190 | <div class="memproto"> |
| 191 | <table class="memname"> |
| 192 | <tr> |
| 193 | <td class="memname">std::vector<float> GetImageDataAsNormalizedFloats </td> |
| 194 | <td>(</td> |
| 195 | <td class="paramtype"><a class="el" href="_inference_test_image_8hpp.xhtml#a5f7592b0a8fa09208cd32721cf207110">ImageChannelLayout</a> </td> |
| 196 | <td class="paramname"><em>layout</em>, </td> |
| 197 | </tr> |
| 198 | <tr> |
| 199 | <td class="paramkey"></td> |
| 200 | <td></td> |
| 201 | <td class="paramtype">const <a class="el" href="class_inference_test_image.xhtml">InferenceTestImage</a> & </td> |
| 202 | <td class="paramname"><em>image</em> </td> |
| 203 | </tr> |
| 204 | <tr> |
| 205 | <td></td> |
| 206 | <td>)</td> |
| 207 | <td></td><td></td> |
| 208 | </tr> |
| 209 | </table> |
| 210 | </div><div class="memdoc"> |
| 211 | |
| 212 | <p class="definition">Definition at line <a class="el" href="_inference_test_image_8cpp_source.xhtml#l00334">334</a> of file <a class="el" href="_inference_test_image_8cpp_source.xhtml">InferenceTestImage.cpp</a>.</p> |
| 213 | |
| 214 | <p class="reference">References <a class="el" href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296aa9d5ed678fe57bcca610140957afab571">B</a>, <a class="el" href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296aadfcf28d0734569a6a693bc8194de62bf">G</a>, <a class="el" href="_inference_test_image_8hpp_source.xhtml#l00076">InferenceTestImage::GetHeight()</a>, <a class="el" href="_inference_test_image_8cpp_source.xhtml#l00158">InferenceTestImage::GetPixelAs3Channels()</a>, <a class="el" href="_inference_test_image_8hpp_source.xhtml#l00075">InferenceTestImage::GetWidth()</a>, and <a class="el" href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296aae1e1d3d40573127e9ee0480caf1283d6">R</a>.</p> |
| 215 | <div class="fragment"><div class="line"><a name="l00336"></a><span class="lineno"> 336</span> {</div><div class="line"><a name="l00337"></a><span class="lineno"> 337</span>  std::vector<float> imageData;</div><div class="line"><a name="l00338"></a><span class="lineno"> 338</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> h = image.<a class="code" href="class_inference_test_image.xhtml#a0983225e32025d901ce6547170892f56">GetHeight</a>();</div><div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> w = image.<a class="code" href="class_inference_test_image.xhtml#a4ec823e49ce46950b3d4cee1efff050b">GetWidth</a>();</div><div class="line"><a name="l00340"></a><span class="lineno"> 340</span> </div><div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> rDstIndex = GetImageChannelIndex(layout, <a class="code" href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296aae1e1d3d40573127e9ee0480caf1283d6">ImageChannel::R</a>);</div><div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> gDstIndex = GetImageChannelIndex(layout, <a class="code" href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296aadfcf28d0734569a6a693bc8194de62bf">ImageChannel::G</a>);</div><div class="line"><a name="l00343"></a><span class="lineno"> 343</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> bDstIndex = GetImageChannelIndex(layout, <a class="code" href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296aa9d5ed678fe57bcca610140957afab571">ImageChannel::B</a>);</div><div class="line"><a name="l00344"></a><span class="lineno"> 344</span> </div><div class="line"><a name="l00345"></a><span class="lineno"> 345</span>  imageData.resize(h * w * 3);</div><div class="line"><a name="l00346"></a><span class="lineno"> 346</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> offset = 0;</div><div class="line"><a name="l00347"></a><span class="lineno"> 347</span> </div><div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j = 0; j < h; ++j)</div><div class="line"><a name="l00349"></a><span class="lineno"> 349</span>  {</div><div class="line"><a name="l00350"></a><span class="lineno"> 350</span>  <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i < w; ++i)</div><div class="line"><a name="l00351"></a><span class="lineno"> 351</span>  {</div><div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  uint8_t r, g, b;</div><div class="line"><a name="l00353"></a><span class="lineno"> 353</span>  std::tie(r, g, b) = image.<a class="code" href="class_inference_test_image.xhtml#a97a4644e316893df9dd2ab73cdd08d33">GetPixelAs3Channels</a>(i, j);</div><div class="line"><a name="l00354"></a><span class="lineno"> 354</span> </div><div class="line"><a name="l00355"></a><span class="lineno"> 355</span>  imageData[offset+rDstIndex] = float(r) / 255.0f;</div><div class="line"><a name="l00356"></a><span class="lineno"> 356</span>  imageData[offset+gDstIndex] = float(g) / 255.0f;</div><div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  imageData[offset+bDstIndex] = float(b) / 255.0f;</div><div class="line"><a name="l00358"></a><span class="lineno"> 358</span>  offset += 3;</div><div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  }</div><div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  }</div><div class="line"><a name="l00361"></a><span class="lineno"> 361</span> </div><div class="line"><a name="l00362"></a><span class="lineno"> 362</span>  <span class="keywordflow">return</span> imageData;</div><div class="line"><a name="l00363"></a><span class="lineno"> 363</span> }</div><div class="ttc" id="_inference_test_image_8hpp_xhtml_a65983f8cb907d873f2328bb8307c296aadfcf28d0734569a6a693bc8194de62bf"><div class="ttname"><a href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296aadfcf28d0734569a6a693bc8194de62bf">ImageChannel::G</a></div></div> |
| 216 | <div class="ttc" id="_inference_test_image_8hpp_xhtml_a65983f8cb907d873f2328bb8307c296aa9d5ed678fe57bcca610140957afab571"><div class="ttname"><a href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296aa9d5ed678fe57bcca610140957afab571">ImageChannel::B</a></div></div> |
| 217 | <div class="ttc" id="_inference_test_image_8hpp_xhtml_a65983f8cb907d873f2328bb8307c296aae1e1d3d40573127e9ee0480caf1283d6"><div class="ttname"><a href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296aae1e1d3d40573127e9ee0480caf1283d6">ImageChannel::R</a></div></div> |
| 218 | <div class="ttc" id="class_inference_test_image_xhtml_a4ec823e49ce46950b3d4cee1efff050b"><div class="ttname"><a href="class_inference_test_image.xhtml#a4ec823e49ce46950b3d4cee1efff050b">InferenceTestImage::GetWidth</a></div><div class="ttdeci">unsigned int GetWidth() const</div><div class="ttdef"><b>Definition:</b> <a href="_inference_test_image_8hpp_source.xhtml#l00075">InferenceTestImage.hpp:75</a></div></div> |
| 219 | <div class="ttc" id="class_inference_test_image_xhtml_a97a4644e316893df9dd2ab73cdd08d33"><div class="ttname"><a href="class_inference_test_image.xhtml#a97a4644e316893df9dd2ab73cdd08d33">InferenceTestImage::GetPixelAs3Channels</a></div><div class="ttdeci">std::tuple< uint8_t, uint8_t, uint8_t > GetPixelAs3Channels(unsigned int x, unsigned int y) const</div><div class="ttdef"><b>Definition:</b> <a href="_inference_test_image_8cpp_source.xhtml#l00158">InferenceTestImage.cpp:158</a></div></div> |
| 220 | <div class="ttc" id="class_inference_test_image_xhtml_a0983225e32025d901ce6547170892f56"><div class="ttname"><a href="class_inference_test_image.xhtml#a0983225e32025d901ce6547170892f56">InferenceTestImage::GetHeight</a></div><div class="ttdeci">unsigned int GetHeight() const</div><div class="ttdef"><b>Definition:</b> <a href="_inference_test_image_8hpp_source.xhtml#l00076">InferenceTestImage.hpp:76</a></div></div> |
| 221 | </div><!-- fragment --> |
| 222 | </div> |
| 223 | </div> |
| 224 | <a id="ada9c94c9ae0a7082f648f75f50d57be1"></a> |
| 225 | <h2 class="memtitle"><span class="permalink"><a href="#ada9c94c9ae0a7082f648f75f50d57be1">◆ </a></span>GetImageDataInArmNnLayoutAsFloats()</h2> |
| 226 | |
| 227 | <div class="memitem"> |
| 228 | <div class="memproto"> |
| 229 | <table class="memname"> |
| 230 | <tr> |
| 231 | <td class="memname">std::vector<float> GetImageDataInArmNnLayoutAsFloats </td> |
| 232 | <td>(</td> |
| 233 | <td class="paramtype"><a class="el" href="_inference_test_image_8hpp.xhtml#a5f7592b0a8fa09208cd32721cf207110">ImageChannelLayout</a> </td> |
| 234 | <td class="paramname"><em>channelLayout</em>, </td> |
| 235 | </tr> |
| 236 | <tr> |
| 237 | <td class="paramkey"></td> |
| 238 | <td></td> |
| 239 | <td class="paramtype">const <a class="el" href="class_inference_test_image.xhtml">InferenceTestImage</a> & </td> |
| 240 | <td class="paramname"><em>image</em>, </td> |
| 241 | </tr> |
| 242 | <tr> |
| 243 | <td class="paramkey"></td> |
| 244 | <td></td> |
| 245 | <td class="paramtype">TProcessValueCallable </td> |
| 246 | <td class="paramname"><em>processValue</em> </td> |
| 247 | </tr> |
| 248 | <tr> |
| 249 | <td></td> |
| 250 | <td>)</td> |
| 251 | <td></td><td></td> |
| 252 | </tr> |
| 253 | </table> |
| 254 | </div><div class="memdoc"> |
| 255 | |
| 256 | <p class="definition">Definition at line <a class="el" href="_inference_test_image_8cpp_source.xhtml#l00280">280</a> of file <a class="el" href="_inference_test_image_8cpp_source.xhtml">InferenceTestImage.cpp</a>.</p> |
| 257 | |
| 258 | <p class="reference">References <a class="el" href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296aa9d5ed678fe57bcca610140957afab571">B</a>, <a class="el" href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296aadfcf28d0734569a6a693bc8194de62bf">G</a>, <a class="el" href="_inference_test_image_8hpp_source.xhtml#l00076">InferenceTestImage::GetHeight()</a>, <a class="el" href="_inference_test_image_8cpp_source.xhtml#l00158">InferenceTestImage::GetPixelAs3Channels()</a>, <a class="el" href="_inference_test_image_8hpp_source.xhtml#l00075">InferenceTestImage::GetWidth()</a>, and <a class="el" href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296aae1e1d3d40573127e9ee0480caf1283d6">R</a>.</p> |
| 259 | |
| 260 | <p class="reference">Referenced by <a class="el" href="_inference_test_image_8cpp_source.xhtml#l00322">GetImageDataInArmNnLayoutAsFloatsSubtractingMean()</a>, and <a class="el" href="_inference_test_image_8cpp_source.xhtml#l00311">GetImageDataInArmNnLayoutAsNormalizedFloats()</a>.</p> |
| 261 | <div class="fragment"><div class="line"><a name="l00283"></a><span class="lineno"> 283</span> {</div><div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> h = image.<a class="code" href="class_inference_test_image.xhtml#a0983225e32025d901ce6547170892f56">GetHeight</a>();</div><div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> w = image.<a class="code" href="class_inference_test_image.xhtml#a4ec823e49ce46950b3d4cee1efff050b">GetWidth</a>();</div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span> </div><div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  std::vector<float> imageData;</div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  imageData.resize(h * w * 3);</div><div class="line"><a name="l00289"></a><span class="lineno"> 289</span> </div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j = 0; j < h; ++j)</div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  {</div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span>  <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i < w; ++i)</div><div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  {</div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  uint8_t r, g, b;</div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  std::tie(r, g, b) = image.<a class="code" href="class_inference_test_image.xhtml#a97a4644e316893df9dd2ab73cdd08d33">GetPixelAs3Channels</a>(i, j);</div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span> </div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span>  <span class="comment">// ArmNN order: C, H, W</span></div><div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> rDstIndex = GetImageChannelIndex(channelLayout, <a class="code" href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296aae1e1d3d40573127e9ee0480caf1283d6">ImageChannel::R</a>) * h * w + j * w + i;</div><div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> gDstIndex = GetImageChannelIndex(channelLayout, <a class="code" href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296aadfcf28d0734569a6a693bc8194de62bf">ImageChannel::G</a>) * h * w + j * w + i;</div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> bDstIndex = GetImageChannelIndex(channelLayout, <a class="code" href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296aa9d5ed678fe57bcca610140957afab571">ImageChannel::B</a>) * h * w + j * w + i;</div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span> </div><div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  imageData[rDstIndex] = processValue(<a class="code" href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296aae1e1d3d40573127e9ee0480caf1283d6">ImageChannel::R</a>, <span class="keywordtype">float</span>(r));</div><div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  imageData[gDstIndex] = processValue(<a class="code" href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296aadfcf28d0734569a6a693bc8194de62bf">ImageChannel::G</a>, <span class="keywordtype">float</span>(g));</div><div class="line"><a name="l00304"></a><span class="lineno"> 304</span>  imageData[bDstIndex] = processValue(<a class="code" href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296aa9d5ed678fe57bcca610140957afab571">ImageChannel::B</a>, <span class="keywordtype">float</span>(b));</div><div class="line"><a name="l00305"></a><span class="lineno"> 305</span>  }</div><div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  }</div><div class="line"><a name="l00307"></a><span class="lineno"> 307</span> </div><div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  <span class="keywordflow">return</span> imageData;</div><div class="line"><a name="l00309"></a><span class="lineno"> 309</span> }</div><div class="ttc" id="_inference_test_image_8hpp_xhtml_a65983f8cb907d873f2328bb8307c296aadfcf28d0734569a6a693bc8194de62bf"><div class="ttname"><a href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296aadfcf28d0734569a6a693bc8194de62bf">ImageChannel::G</a></div></div> |
| 262 | <div class="ttc" id="_inference_test_image_8hpp_xhtml_a65983f8cb907d873f2328bb8307c296aa9d5ed678fe57bcca610140957afab571"><div class="ttname"><a href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296aa9d5ed678fe57bcca610140957afab571">ImageChannel::B</a></div></div> |
| 263 | <div class="ttc" id="_inference_test_image_8hpp_xhtml_a65983f8cb907d873f2328bb8307c296aae1e1d3d40573127e9ee0480caf1283d6"><div class="ttname"><a href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296aae1e1d3d40573127e9ee0480caf1283d6">ImageChannel::R</a></div></div> |
| 264 | <div class="ttc" id="class_inference_test_image_xhtml_a4ec823e49ce46950b3d4cee1efff050b"><div class="ttname"><a href="class_inference_test_image.xhtml#a4ec823e49ce46950b3d4cee1efff050b">InferenceTestImage::GetWidth</a></div><div class="ttdeci">unsigned int GetWidth() const</div><div class="ttdef"><b>Definition:</b> <a href="_inference_test_image_8hpp_source.xhtml#l00075">InferenceTestImage.hpp:75</a></div></div> |
| 265 | <div class="ttc" id="class_inference_test_image_xhtml_a97a4644e316893df9dd2ab73cdd08d33"><div class="ttname"><a href="class_inference_test_image.xhtml#a97a4644e316893df9dd2ab73cdd08d33">InferenceTestImage::GetPixelAs3Channels</a></div><div class="ttdeci">std::tuple< uint8_t, uint8_t, uint8_t > GetPixelAs3Channels(unsigned int x, unsigned int y) const</div><div class="ttdef"><b>Definition:</b> <a href="_inference_test_image_8cpp_source.xhtml#l00158">InferenceTestImage.cpp:158</a></div></div> |
| 266 | <div class="ttc" id="class_inference_test_image_xhtml_a0983225e32025d901ce6547170892f56"><div class="ttname"><a href="class_inference_test_image.xhtml#a0983225e32025d901ce6547170892f56">InferenceTestImage::GetHeight</a></div><div class="ttdeci">unsigned int GetHeight() const</div><div class="ttdef"><b>Definition:</b> <a href="_inference_test_image_8hpp_source.xhtml#l00076">InferenceTestImage.hpp:76</a></div></div> |
| 267 | </div><!-- fragment --> |
| 268 | </div> |
| 269 | </div> |
| 270 | <a id="a16f15d88afcc9c6bba231cc72bdd8cbf"></a> |
| 271 | <h2 class="memtitle"><span class="permalink"><a href="#a16f15d88afcc9c6bba231cc72bdd8cbf">◆ </a></span>GetImageDataInArmNnLayoutAsFloatsSubtractingMean()</h2> |
| 272 | |
| 273 | <div class="memitem"> |
| 274 | <div class="memproto"> |
| 275 | <table class="memname"> |
| 276 | <tr> |
| 277 | <td class="memname">std::vector<float> GetImageDataInArmNnLayoutAsFloatsSubtractingMean </td> |
| 278 | <td>(</td> |
| 279 | <td class="paramtype"><a class="el" href="_inference_test_image_8hpp.xhtml#a5f7592b0a8fa09208cd32721cf207110">ImageChannelLayout</a> </td> |
| 280 | <td class="paramname"><em>layout</em>, </td> |
| 281 | </tr> |
| 282 | <tr> |
| 283 | <td class="paramkey"></td> |
| 284 | <td></td> |
| 285 | <td class="paramtype">const <a class="el" href="class_inference_test_image.xhtml">InferenceTestImage</a> & </td> |
| 286 | <td class="paramname"><em>image</em>, </td> |
| 287 | </tr> |
| 288 | <tr> |
| 289 | <td class="paramkey"></td> |
| 290 | <td></td> |
| 291 | <td class="paramtype">const std::array< float, 3 > & </td> |
| 292 | <td class="paramname"><em>mean</em> </td> |
| 293 | </tr> |
| 294 | <tr> |
| 295 | <td></td> |
| 296 | <td>)</td> |
| 297 | <td></td><td></td> |
| 298 | </tr> |
| 299 | </table> |
| 300 | </div><div class="memdoc"> |
| 301 | |
| 302 | <p class="definition">Definition at line <a class="el" href="_inference_test_image_8cpp_source.xhtml#l00322">322</a> of file <a class="el" href="_inference_test_image_8cpp_source.xhtml">InferenceTestImage.cpp</a>.</p> |
| 303 | |
| 304 | <p class="reference">References <a class="el" href="_inference_test_image_8cpp_source.xhtml#l00280">GetImageDataInArmNnLayoutAsFloats()</a>.</p> |
| 305 | |
| 306 | <p class="reference">Referenced by <a class="el" href="_caffe_preprocessor_8cpp_source.xhtml#l00030">CaffePreprocessor::GetTestCaseData()</a>.</p> |
| 307 | <div class="fragment"><div class="line"><a name="l00325"></a><span class="lineno"> 325</span> {</div><div class="line"><a name="l00326"></a><span class="lineno"> 326</span>  <span class="keywordflow">return</span> <a class="code" href="_inference_test_image_8cpp.xhtml#ada9c94c9ae0a7082f648f75f50d57be1">GetImageDataInArmNnLayoutAsFloats</a>(layout, image,</div><div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  [layout, &mean](<a class="code" href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296a">ImageChannel</a> channel, <span class="keywordtype">float</span> value)</div><div class="line"><a name="l00328"></a><span class="lineno"> 328</span>  {</div><div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channelIndex = GetImageChannelIndex(layout, channel);</div><div class="line"><a name="l00330"></a><span class="lineno"> 330</span>  <span class="keywordflow">return</span> value - mean[channelIndex];</div><div class="line"><a name="l00331"></a><span class="lineno"> 331</span>  });</div><div class="line"><a name="l00332"></a><span class="lineno"> 332</span> }</div><div class="ttc" id="_inference_test_image_8hpp_xhtml_a65983f8cb907d873f2328bb8307c296a"><div class="ttname"><a href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296a">ImageChannel</a></div><div class="ttdeci">ImageChannel</div><div class="ttdef"><b>Definition:</b> <a href="_inference_test_image_8hpp_source.xhtml#l00113">InferenceTestImage.hpp:113</a></div></div> |
| 308 | <div class="ttc" id="_inference_test_image_8cpp_xhtml_ada9c94c9ae0a7082f648f75f50d57be1"><div class="ttname"><a href="_inference_test_image_8cpp.xhtml#ada9c94c9ae0a7082f648f75f50d57be1">GetImageDataInArmNnLayoutAsFloats</a></div><div class="ttdeci">std::vector< float > GetImageDataInArmNnLayoutAsFloats(ImageChannelLayout channelLayout, const InferenceTestImage &image, TProcessValueCallable processValue)</div><div class="ttdef"><b>Definition:</b> <a href="_inference_test_image_8cpp_source.xhtml#l00280">InferenceTestImage.cpp:280</a></div></div> |
| 309 | </div><!-- fragment --> |
| 310 | </div> |
| 311 | </div> |
| 312 | <a id="a3f8ac82c346c723f775a383d22239182"></a> |
| 313 | <h2 class="memtitle"><span class="permalink"><a href="#a3f8ac82c346c723f775a383d22239182">◆ </a></span>GetImageDataInArmNnLayoutAsNormalizedFloats()</h2> |
| 314 | |
| 315 | <div class="memitem"> |
| 316 | <div class="memproto"> |
| 317 | <table class="memname"> |
| 318 | <tr> |
| 319 | <td class="memname">std::vector<float> GetImageDataInArmNnLayoutAsNormalizedFloats </td> |
| 320 | <td>(</td> |
| 321 | <td class="paramtype"><a class="el" href="_inference_test_image_8hpp.xhtml#a5f7592b0a8fa09208cd32721cf207110">ImageChannelLayout</a> </td> |
| 322 | <td class="paramname"><em>layout</em>, </td> |
| 323 | </tr> |
| 324 | <tr> |
| 325 | <td class="paramkey"></td> |
| 326 | <td></td> |
| 327 | <td class="paramtype">const <a class="el" href="class_inference_test_image.xhtml">InferenceTestImage</a> & </td> |
| 328 | <td class="paramname"><em>image</em> </td> |
| 329 | </tr> |
| 330 | <tr> |
| 331 | <td></td> |
| 332 | <td>)</td> |
| 333 | <td></td><td></td> |
| 334 | </tr> |
| 335 | </table> |
| 336 | </div><div class="memdoc"> |
| 337 | |
| 338 | <p class="definition">Definition at line <a class="el" href="_inference_test_image_8cpp_source.xhtml#l00311">311</a> of file <a class="el" href="_inference_test_image_8cpp_source.xhtml">InferenceTestImage.cpp</a>.</p> |
| 339 | |
| 340 | <p class="reference">References <a class="el" href="_inference_test_image_8cpp_source.xhtml#l00280">GetImageDataInArmNnLayoutAsFloats()</a>, and <a class="el" href="_ignore_unused_8hpp_source.xhtml#l00014">armnn::IgnoreUnused()</a>.</p> |
| 341 | |
| 342 | <p class="reference">Referenced by <a class="el" href="_yolo_database_8cpp_source.xhtml#l00075">YoloDatabase::GetTestCaseData()</a>.</p> |
| 343 | <div class="fragment"><div class="line"><a name="l00313"></a><span class="lineno"> 313</span> {</div><div class="line"><a name="l00314"></a><span class="lineno"> 314</span>  <span class="keywordflow">return</span> <a class="code" href="_inference_test_image_8cpp.xhtml#ada9c94c9ae0a7082f648f75f50d57be1">GetImageDataInArmNnLayoutAsFloats</a>(layout, image,</div><div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  [](<a class="code" href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296a">ImageChannel</a> channel, <span class="keywordtype">float</span> value)</div><div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  {</div><div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  <a class="code" href="namespacearmnn.xhtml#a44affeeb090c3c6a3062830562672e84">armnn::IgnoreUnused</a>(channel);</div><div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  <span class="keywordflow">return</span> value / 255.f;</div><div class="line"><a name="l00319"></a><span class="lineno"> 319</span>  });</div><div class="line"><a name="l00320"></a><span class="lineno"> 320</span> }</div><div class="ttc" id="namespacearmnn_xhtml_a44affeeb090c3c6a3062830562672e84"><div class="ttname"><a href="namespacearmnn.xhtml#a44affeeb090c3c6a3062830562672e84">armnn::IgnoreUnused</a></div><div class="ttdeci">void IgnoreUnused(Ts &&...)</div><div class="ttdef"><b>Definition:</b> <a href="_ignore_unused_8hpp_source.xhtml#l00014">IgnoreUnused.hpp:14</a></div></div> |
| 344 | <div class="ttc" id="_inference_test_image_8hpp_xhtml_a65983f8cb907d873f2328bb8307c296a"><div class="ttname"><a href="_inference_test_image_8hpp.xhtml#a65983f8cb907d873f2328bb8307c296a">ImageChannel</a></div><div class="ttdeci">ImageChannel</div><div class="ttdef"><b>Definition:</b> <a href="_inference_test_image_8hpp_source.xhtml#l00113">InferenceTestImage.hpp:113</a></div></div> |
| 345 | <div class="ttc" id="_inference_test_image_8cpp_xhtml_ada9c94c9ae0a7082f648f75f50d57be1"><div class="ttname"><a href="_inference_test_image_8cpp.xhtml#ada9c94c9ae0a7082f648f75f50d57be1">GetImageDataInArmNnLayoutAsFloats</a></div><div class="ttdeci">std::vector< float > GetImageDataInArmNnLayoutAsFloats(ImageChannelLayout channelLayout, const InferenceTestImage &image, TProcessValueCallable processValue)</div><div class="ttdef"><b>Definition:</b> <a href="_inference_test_image_8cpp_source.xhtml#l00280">InferenceTestImage.cpp:280</a></div></div> |
| 346 | </div><!-- fragment --> |
| 347 | </div> |
| 348 | </div> |
| 349 | </div><!-- contents --> |
| 350 | </div><!-- doc-content --> |
| 351 | <!-- start footer part --> |
| 352 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 353 | <ul> |
| 354 | <li class="navelem"><a class="el" href="dir_59425e443f801f1f2fd8bbe4959a3ccf.xhtml">tests</a></li><li class="navelem"><a class="el" href="_inference_test_image_8cpp.xhtml">InferenceTestImage.cpp</a></li> |
| 355 | <li class="footer">Generated on Fri Mar 13 2020 16:09:16 for ArmNN by |
| 356 | <a href="http://www.doxygen.org/index.html"> |
| 357 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 358 | </ul> |
| 359 | </div> |
| 360 | </body> |
| 361 | </html> |