[mlpack-git] [mlpack/mlpack] edge_boxes: feature extraction updated, tests added (#696)

Marcus Edel notifications at github.com
Wed Jun 15 08:04:46 EDT 2016


> +
> +template<typename MatType, typename CubeType>
> +arma::vec StructuredForests<MatType, CubeType>::
> +DistanceTransform1D(arma::vec const &f, const size_t n, const double inf)
> +{
> +  arma::vec d(n), v(n), z(n + 1);
> +  size_t k = 0;
> +  v[0] = 0.0;
> +  z[0] = -inf;
> +  z[1] = inf;
> +  for (size_t q = 1; q <= n - 1; ++q)
> +  {
> +    float s  = ( (f[q] + q * q)-( f[v[k]] + v[k] * v[k]) ) / (2 * q - 2 * v[k]);
> +    while (s <= z[k])
> +    {
> +      --k;

I'm not sure, but if we set k = 0 at the beginning, how can we decrease k, and still get the right index?

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/696/files/b38b688edfc4c2ee8bf461240f8384a70575d3a4#r67148615
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160615/f91c8136/attachment-0001.html>


More information about the mlpack-git mailing list