<p>In <a href="https://github.com/mlpack/mlpack/pull/703#discussion_r68451584">src/mlpack/methods/edge_boxes/feature_extraction_impl.hpp</a>:</p>
<pre style='color:#555'>&gt; +    dx.slice(i).col(0) = InImage.slice(i).col(1) - InImage.slice(i).col(0);
&gt; +    dx.slice(i).col(InImage.n_cols - 1) = InImage.slice(i).col(InImage.n_cols - 1)
&gt; +                                        - InImage.slice(i).col(InImage.n_cols - 2);
&gt; +
&gt; +    for (size_t j = 1; j &lt; InImage.n_cols-1; j++)
&gt; +      dx.slice(i).col(j) = 0.5 * ( InImage.slice(i).col(j+1) - InImage.slice(i).col(j) ); 
&gt; +
&gt; +    // do same for dy.
&gt; +    dy.slice(i).row(0) = InImage.slice(i).row(1) - InImage.slice(i).row(0);
&gt; +    dy.slice(i).row(InImage.n_rows - 1) = InImage.slice(i).row(InImage.n_rows - 1)
&gt; +                                        - InImage.slice(i).row(InImage.n_rows - 2);
&gt; +
&gt; +    for (size_t j = 1; j &lt; InImage.n_rows-1; j++)
&gt; +      dy.slice(i).row(j) = 0.5 * ( InImage.slice(i).row(j+1) - InImage.slice(i).row(j) );
&gt; +  }  
&gt; +
</pre>
<p>Hello <a href="https://github.com/stereomatchingkiss" class="user-mention">@stereomatchingkiss</a>, to save you some time, I made a bunch of similar comments here: <a href="https://github.com/mlpack/mlpack/pull/696" class="issue-link js-issue-link" data-url="https://github.com/mlpack/mlpack/issues/696" data-id="160243740" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">#696</a></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/703/files/987f0790f745314a2117a87f28a346b05a8a2a2d#r68451584">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFB_GBcUGvC_QbBPRcX7adD30sanLks5qPDJsgaJpZM4I5X__">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFIBaMz6jyREan0CjdtQyanMkK-84ks5qPDJsgaJpZM4I5X__.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#r68451584"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>