创建高斯金字塔

信息处理 图像处理 matlab 多尺度分析
2022-02-02 01:26:34

我正在尝试使用以下比例重新创建一个 gassuain 金字塔:

在此处输入图像描述

这里似乎使用了两个概念:

1) 当图像减半时,应用 σ 的高斯核将应用为 2σ。

2) 当图像的尺度为 σ,并且应用了 σ 的高斯核,则生成的图像将具有 sqrt(2)*σ 的尺度。

因此,当我构建上述比例空间时,我会执行以下操作:

在此处输入图像描述

其中显示的 sigma 是以指定比例应用于图像的高斯核的 sigma。

我在matlab中实现了这个:

for i = 0:3 % Cycle over octaves - 4 total                    
    for j = 0:4 % Cycle over scales - 5 total
        if(i == 0 && j == 0)
            % This is the first octave and first octave
            obj.gaussianpyramid{i+1,j+1} = blob_class_image.filt_gaussian(obj.gs,1/sqrt(2));
        elseif(i > 0 && j == 0)
            % This is the first scale after the first
            % octave, take 3rd image from previous row
            obj.gaussianpyramid{i+1,j+1} = obj.gaussianpyramid{i,3}(1:2:end,1:2:end);
        else
            % These are second + scales. Take image from
            % previous column and apply the same scale
            obj.gaussianpyramid{i+1,j+1} = blob_class_image.filt_gaussian(obj.gaussianpyramid{i+1,j},sqrt(2)^(j-2));   

            % Store logpyramid
            obj.logpyramid{i+1,j} = obj.gaussianpyramid{i+1,j+1} - obj.gaussianpyramid{i+1,j};
        end                        
    end
end

这是正确的思路吗?我已经实现了这一点,当我查看高斯金字塔的拉普拉斯算子时,它似乎跳过了一些尺度。

编辑:经过一些测试,我似乎无法实现上面列出的#2),其中两个带有 σ 的高斯卷积与带有 sqrt(2)*σ 的单个高斯卷积相同。当我测试它然后减去图像时,它们不一样......

EDIT2:在计算西格玛时也犯了一个小错误。上面的想法现在应该是正确的。我通过将原始图像与 σ = 22.627 的高斯核卷积,然后对两个图像进行下采样和比较,比较在 σ = 22.627 处获得的尺度进行了双重检查,它们看起来是相同的。

0个回答
没有发现任何回复~