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

stereomatchingkiss notifications at github.com
Thu Jun 9 11:42:38 EDT 2016


> +  }
> +  return OutImage;  
> +}
> +
> +template<typename MatType, typename CubeType>
> +CubeType StructuredForests<MatType, CubeType>::
> +RGB2LUV(CubeType& InImage)
> +{
> +  //assert type is double or float.
> +  double a, y0, maxi;
> +  a = pow(29.0, 3) / 27.0;
> +  y0 = 8.0 / a;
> +  maxi = 1.0 / 270.0;
> +
> +  arma::vec table(1025);
> +  for (size_t i = 0; i < 1025; ++i)

you can call table.n_elems, this way you only need to change the value 1025 once only(if you need to change it in the future)

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


More information about the mlpack-git mailing list