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

stereomatchingkiss notifications at github.com
Thu Jun 9 12:07:06 EDT 2016


> +  OutImage.slice(1) = U;
> +  OutImage.slice(2) = V;
> +  //OutImage = arma::join_slices(L,U);
> +  //OutImage = arma::join_slices(OutImage, V);
> +  return OutImage; 
> +}
> +
> +template<typename MatType, typename CubeType>
> +MatType StructuredForests<MatType, CubeType>::
> +bilinearInterpolation(MatType const &src,
> +                      size_t height, size_t width)
> +{
> +  MatType dst(height, width);
> +  double const x_ratio = static_cast<double>((src.n_cols - 1)) / width;
> +  double const y_ratio = static_cast<double>((src.n_rows - 1)) / height;
> +  for(size_t row = 0; row != dst.n_rows; ++row)

opencv is row based, but armadillo is col based, if we want speed, we better iterate by col, but this could be done later on, write the unit test, make sure prototype is correct before we start to optimize.

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


More information about the mlpack-git mailing list