[mlpack-git] [mlpack/mlpack] backported ind2sub and sub2ind. (#683)

stereomatchingkiss notifications at github.com
Thu Jun 9 11:27:46 EDT 2016


> +
> +  // transform along rows
> +  for (int y = 0; y < im.n_rows; y++)
> +  {
> +    f.subvec(0, im.n_cols - 1) = im.row(y).t();
> +    arma::vec d = this->dt_1d(f, im.n_cols);
> +    im.row(y) = d.t();
> +  }
> +}
> +
> +/* euclidean distance transform of binary image using squared distance */
> +template<typename MatType, typename CubeType>
> +MatType StructuredForests<MatType, CubeType>::
> +dt_image(MatType& im, double on)
> +{
> +  MatType out = MatType(im.n_rows, im.n_cols);

Maybe this could save some typing

`MatType out (im.n_rows, im.cols, arma::fill::zeros);`

---
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/683/files/9d85b64c6c6bdff608331195351d09abf56cfc96#r66463201
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160609/b3367a3f/attachment.html>


More information about the mlpack-git mailing list