<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'>> + << 0.341550 << 0.706655 << 0.129553 << arma::endr
> + << 0.178325 << 0.071330 << 0.939180;
> +
> + //see how to calculate this efficiently. numpy.dot does this.
> + CubeType xyz(InImage.n_rows, InImage.n_cols, rgb2xyz.n_cols);
> +
> + for (size_t i = 0; i < InImage.slice(0).n_elem; ++i)
> + {
> + double r = InImage.slice(0)(i);
> + double g = InImage.slice(1)(i);
> + double b = InImage.slice(2)(i);
> +
> + xyz.slice(0)(i) = 0.430574 * r + 0.341550 * g + 0.178325 * b;
> + xyz.slice(1)(i) = 0.222015 * r + 0.706655 * g + 0.071330 * b;
> + xyz.slice(2)(i) = 0.020183 * r + 0.129553 * g + 0.939180 * b;
> + }
</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;">—<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>