[mlpack-git] [mlpack/mlpack] Added the discretize function. Design changes as discussed. (#703)

Marcus Edel notifications at github.com
Fri Jun 24 15:39:24 EDT 2016


> +    dx.slice(i).col(0) = InImage.slice(i).col(1) - InImage.slice(i).col(0);
> +    dx.slice(i).col(InImage.n_cols - 1) = InImage.slice(i).col(InImage.n_cols - 1)
> +                                        - InImage.slice(i).col(InImage.n_cols - 2);
> +
> +    for (size_t j = 1; j < InImage.n_cols-1; j++)
> +      dx.slice(i).col(j) = 0.5 * ( InImage.slice(i).col(j+1) - InImage.slice(i).col(j) ); 
> +
> +    // do same for dy.
> +    dy.slice(i).row(0) = InImage.slice(i).row(1) - InImage.slice(i).row(0);
> +    dy.slice(i).row(InImage.n_rows - 1) = InImage.slice(i).row(InImage.n_rows - 1)
> +                                        - InImage.slice(i).row(InImage.n_rows - 2);
> +
> +    for (size_t j = 1; j < InImage.n_rows-1; j++)
> +      dy.slice(i).row(j) = 0.5 * ( InImage.slice(i).row(j+1) - InImage.slice(i).row(j) );
> +  }  
> +

Hello @stereomatchingkiss, to save you some time, I made a bunch of similar comments here: https://github.com/mlpack/mlpack/pull/696

---
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/987f0790f745314a2117a87f28a346b05a8a2a2d#r68451584
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160624/6f388240/attachment.html>


More information about the mlpack-git mailing list