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

stereomatchingkiss notifications at github.com
Thu Jun 9 12:36:01 EDT 2016


> +  return InImage;
> +}
> +
> +template<typename MatType, typename CubeType>
> +CubeType StructuredForests<MatType, CubeType>::
> +ConvTriangle(CubeType& InImage, int radius)
> +{
> +  if (radius == 0)
> +  {
> +    return InImage;
> +  }
> +  else if (radius <= 1)
> +  {
> +    double p = 12.0 / radius / (radius + 2) - 2;
> +    arma::vec kernel = {1 , p, 1};
> +    kernel = kernel / (p + 2);

`kernel /= (p+2);`

Maybe can avoid copy, I am not sure about this part.Because armadillo may do a lot of jobs to avoid memory allocation in this casein this c

---
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#r66475952
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160609/f84ee759/attachment.html>


More information about the mlpack-git mailing list