rmislam/PythonSIFT

Why using same gaussian_kernels to generate GaussianImages?

yllgl opened this issue · 2 comments

yllgl commented
def generateGaussianImages(image, num_octaves, gaussian_kernels):
    """Generate scale-space pyramid of Gaussian images
    """
    logger.debug('Generating Gaussian images...')
    gaussian_images = []

    for octave_index in range(num_octaves):
        gaussian_images_in_octave = []
        gaussian_images_in_octave.append(image)  # first image in octave already has the correct blur
        for gaussian_kernel in gaussian_kernels[1:]:
            image = GaussianBlur(image, (0, 0), sigmaX=gaussian_kernel, sigmaY=gaussian_kernel)
            gaussian_images_in_octave.append(image)
        gaussian_images.append(gaussian_images_in_octave)
        octave_base = gaussian_images_in_octave[-3]
        image = resize(octave_base, (int(octave_base.shape[1] / 2), int(octave_base.shape[0] / 2)), interpolation=INTER_NEAREST)
    return array(gaussian_images, dtype=object)

gassian_kernel is:

print(gaussian_kernels)
array([1.6, 1.22627, 1.54501, 1.94659, 2.45255, 3.09002])

the first octave sigma is 1.6, we blur this image by 1.94659 to produce our last image, which has a blur of sqrt(1.6 ** 2 + 1.22627 **2 +1.54501 **2 +1.94659 ** 2) == 3.2. And 2 * 1.6 == 3.2, so we’ve moved up exactly one octave! Sounds good...
However, the next octave, which sigma is 3.2, still uses the same gaussian_kernels, and it will produce sqrt(3.2 ** 2 + 1.22627 **2 +1.54501 **2 +1.94659 ** 2) == 4.23, which is not equivalent to 3.2*2. I think it's wrong. Could you give me some advice?

please refer to #13 (comment)

Yes, please refer to the comment @casiatao refers to. Thanks. Feel free to reopen this issue @yllgl if you feel that comment does not answer your question.