# SIFT: why Gaussian blur is performed iteratively?

SIFT is the feature detector I am trying to implement for self-study purposes. But my question concerns the Gaussian blurring done as part of detecting the keypoints.

Gaussian pyramid is constructed. It is done by iteratively applying Gaussian blur (filter of pre-selected width). I.e. the next layer in the pyramid is calculated relatively to the current layer in pyramid. In this case, the relative sigma are used. Example from the Python implementation on github (https://github.com/rmislam/PythonSIFT/blob/master/pysift.py) :

for image_index in range(1, num_images_per_octave):
sigma_previous = (k ** (image_index - 1)) * sigma
sigma_total = k * sigma_previous
gaussian_kernels[image_index] = sqrt(sigma_total ** 2 - sigma_previous ** 2)


Is it possible to use absolute values of $$\sigma$$, i.e. sigma_total from the code snippet, and always perform the blur relative to the first image in the octave? Not relative to the previous level in the pyramid? Is it something that is done in https://github.com/Celebrandil/CudaSift/blob/Pascal/cudaSiftH.cu (function PrepareLaplaceKernels), or I have misunderstood it?

UPD: the question regarding the https://github.com/Celebrandil/CudaSift/blob/Pascal/cudaSiftH.cu implementation is still open: what exactly they do there? The calculation of Gaussian kernels seem to be very different from those in the "classical" implementations available on github.

• I answered your first question at gis.stackexchange.com/a/9434/664. The bottom line is that yes, you can perform every calculation relative to the first image, but it's less efficient. – whuber Jan 2 at 22:04
• @whuber thank you, I was not able to find it in search. I am writing it in CUDA, so calculating it iteratively would mean calling kernel several times, and having more access to global GPU memory (instead of just using cache several times). But I might be wrong about that, this is an exercise I am doing for learning CUDA. – Valeria Jan 2 at 22:09
• The nice thing about the iteration is that you can carry it out by computing the FFT of the kernel once, the FFT of the base image once, and then just repeatedly multiply the FFTs (and run an inverse FFT on each result). – whuber Jan 2 at 22:24
• @whuber but even in the iterative construction of the pyramid, $\sigma$ are different (seen from the code snippet in the question), so the kernel would be different at each level, anyway, no? – Valeria Jan 2 at 22:27
• Good point--I hadn't inspected the code. It looks like somebody is exploring a sequence where $\sigma$ changes exponentially. In that case it looks like there's little to be preferred between the two approaches we have been discussing, unless you are short on RAM: the sequential algorithm doesn't need to retain the base image. – whuber Jan 2 at 22:39