<p>In <a href="https://github.com/mlpack/mlpack/pull/703#discussion_r68438602">src/mlpack/methods/edge_boxes/feature_extraction_impl.hpp</a>:</p>
<pre style='color:#555'>&gt; +          &lt;&lt; 0.341550 &lt;&lt; 0.706655 &lt;&lt; 0.129553 &lt;&lt; arma::endr
&gt; +          &lt;&lt; 0.178325 &lt;&lt; 0.071330 &lt;&lt; 0.939180;
&gt; +
&gt; +  //see how to calculate this efficiently. numpy.dot does this.
&gt; +  CubeType xyz(InImage.n_rows, InImage.n_cols, rgb2xyz.n_cols);
&gt; +
&gt; +  for (size_t i = 0; i &lt; InImage.slice(0).n_elem; ++i)
&gt; +  {
&gt; +    double r = InImage.slice(0)(i);
&gt; +    double g = InImage.slice(1)(i);
&gt; +    double b = InImage.slice(2)(i);
&gt; +    
&gt; +    xyz.slice(0)(i) = 0.430574 * r + 0.341550 * g + 0.178325 * b;
&gt; +    xyz.slice(1)(i) = 0.222015 * r + 0.706655 * g + 0.071330 * b;
&gt; +    xyz.slice(2)(i) = 0.020183 * r + 0.129553 * g + 0.939180 * b;
&gt; +  }
</pre>
<p>Why not just</p>

<pre><code>xyz.slice(0) = 0.430574 * InImage.slice(0) + 0.341550 * InImage.slice(1) + 0.178325 * InImage.slice(2);
xyz.slice(1) = 0.222015 * InImage.slice(0) + 0.706655 * InImage.slice(1) + 0.071330 * InImage.slice(2);
xyz.slice(2) = 0.020183 * InImage.slice(0) + 0.129553 * InImage.slice(1) + 0.939180 * InImage.slice(2);
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/pull/703/files/987f0790f745314a2117a87f28a346b05a8a2a2d#r68438602">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFAHBlDSEbx8HG6wLjam77BKr5VsEks5qPB4EgaJpZM4I5X__">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFFXtkKjt_VzZ7CHR9kd24zRE63hOks5qPB4EgaJpZM4I5X__.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/mlpack/mlpack/pull/703/files/987f0790f745314a2117a87f28a346b05a8a2a2d#r68438602"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>