<p>In <a href="https://github.com/mlpack/mlpack/pull/683#discussion_r66462533">src/mlpack/methods/edge_boxes/feature_extraction_impl.hpp</a>:</p>
<pre style='color:#555'>&gt; +  for (int y = 0; y &lt; im.n_rows; y++)
&gt; +  {
&gt; +    f.subvec(0, im.n_cols - 1) = im.row(y).t();
&gt; +    arma::vec d = this-&gt;dt_1d(f, im.n_cols);
&gt; +    im.row(y) = d.t();
&gt; +  }
&gt; +}
&gt; +
&gt; +/* euclidean distance transform of binary image using squared distance */
&gt; +template&lt;typename MatType, typename CubeType&gt;
&gt; +MatType StructuredForests&lt;MatType, CubeType&gt;::
&gt; +dt_image(MatType&amp; im, double on)
&gt; +{
&gt; +  MatType out = MatType(im.n_rows, im.n_cols);
&gt; +  out.fill(0.0);
&gt; +  out.elem( find(im != on) ).fill(INF);
</pre>
<p>quite need, I like this</p>

<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/683/files/9d85b64c6c6bdff608331195351d09abf56cfc96#r66462533">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFDzC2q7kv5-yrMh2c6LSGzTJ081eks5qKDArgaJpZM4IvUrl">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFH7JlK9tfaRMdCa1vHmAaZFk70-aks5qKDArgaJpZM4IvUrl.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#r66462533"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>