[mlpack-git] [mlpack/mlpack] Added the discretize function. Design changes as discussed. (#703)
Marcus Edel
notifications at github.com
Sun Aug 14 11:49:53 EDT 2016
> + // transform along columns
> + for (size_t x = 0; x < Im.n_cols; ++x)
> + {
> + f.subvec(0, Im.n_rows - 1) = Im.col(x);
> + arma::vec d;
> + this->DistanceTransform1D(f, Im.n_rows, inf, d);
> + Im.col(x) = d;
> + }
> +
> + // transform along rows
> + for (size_t y = 0; y < Im.n_rows; y++)
> + {
> + f.subvec(0, Im.n_cols - 1) = Im.row(y).t();
> + arma::vec d;
> + this->DistanceTransform1D(f, Im.n_cols, inf, d);
> + Im.row(y) = d.t();
It looks like you could pass im.row(y) instead of passing a copy of the transposed row. In this case you have to adjust the DistanceTransform1D function header:
```
arma::vec DistanceTransform1D(arma::row& f, const size_t n, ...)
```
--
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/703/files/72eb1ef22c7db1ea33af3de1cd043cdb277ec562#r74704124
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160814/d746df50/attachment-0001.html>
More information about the mlpack-git
mailing list