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

Marcus Edel notifications at github.com
Sun Aug 14 11:51:55 EDT 2016


> +    this->ConvTriangle(Img, grdSmoothRad); 
> +    MatType Magnitude(InImage.n_rows, InImage.n_cols),
> +             Orientation(InImage.n_rows, InImage.n_cols);
> +    
> +    this->Gradient(Img, Magnitude, Orientation);
> +    size_t downscale = std::max(1, (int)(shrink * scale));
> +    
> +    CubeType Hist;
> +    this->Histogram(Magnitude, Orientation,
> +                    downscale, 0, Hist);
> +    BilinearInterpolation( Magnitude, rsize, csize, channels.slice(slice_idx));
> +    slice_idx++;
> +    for(size_t i = 0; i < InImage.n_slices; ++i)
> +      BilinearInterpolation( Magnitude, rsize, csize,
> +                      channels.slice(i + slice_idx));    
> +    slice_idx += 3;

I would recommend to use slice_idx += n_slicesinstead of slice_idx += 3; there is no guarantee that we call the function with a 3 channel image.

-- 
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/72eb1ef22c7db1ea33af3de1cd043cdb277ec562#r74704163
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160814/92d406ae/attachment.html>


More information about the mlpack-git mailing list