# Gaussian kernel in OpenCV to generate multiple scales

I want to implement an OpenCV version of VL_PHOW() (matlab src code) from VLFeat. In few words, it's dense SIFT with multiple scales (increasing SIFT descriptor bin size) to make it scale invariant.

However, the authors suggests to apply a Gaussian kernel to improve the results. In paritcular, the Magnif parameter describe it:

Magnif 6 The image is smoothed by a Gaussian kernel of standard deviation SIZE / MAGNIF. Note that, in the standard SIFT descriptor, the magnification value is 3; here the default one is 6 as it seems to perform better in applications.

And this is the relevant matlab code:

% smooth the image to the appropriate scale based on the size
% of the SIFT bins
sigma = opts.sizes(si) / opts.magnif ;
ims = vl_imsmooth(im, sigma) ;


My question is: how can I implement this in OpenCV? The equivalent function in OpenCV seems to be GaussianBlur, but I can't figure out how to represent the code above in terms of this function.

edit retag close merge delete

@LBerger thanks for your answer. However, I don't understand what the ksize parameter should be. Besides, is it correct that the matlab code above can be replicated using cv::GaussianBlur(in, out, cv::Size(), sigma) ?