<p>In <a href="https://github.com/mlpack/mlpack/pull/683#discussion_r66475952">src/mlpack/methods/edge_boxes/feature_extraction_impl.hpp</a>:</p>
<pre style='color:#555'>> + return InImage;
> +}
> +
> +template<typename MatType, typename CubeType>
> +CubeType StructuredForests<MatType, CubeType>::
> +ConvTriangle(CubeType& InImage, int radius)
> +{
> + if (radius == 0)
> + {
> + return InImage;
> + }
> + else if (radius <= 1)
> + {
> + double p = 12.0 / radius / (radius + 2) - 2;
> + arma::vec kernel = {1 , p, 1};
> + kernel = kernel / (p + 2);
</pre>
<p><code>kernel /= (p+2);</code></p>
<p>Maybe can avoid copy, I am not sure about this part.Because armadillo may do a lot of jobs to avoid memory allocation in this casein this c</p>
<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/683/files/9d85b64c6c6bdff608331195351d09abf56cfc96#r66475952">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFMzSyy4UPq118751Vlh-Dn31XuW_ks5qKEDxgaJpZM4IvUrl">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFOJYxeQF_scX7m83Z76naJdPhi6Oks5qKEDxgaJpZM4IvUrl.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/683/files/9d85b64c6c6bdff608331195351d09abf56cfc96#r66475952"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>