image-processing - 高斯拉普拉斯算子

标签 image-processing filtering laplacianofgaussian

我在实现 LoG 内核时遇到了问题。我正在尝试使用 theta = 1.4 实现 9x9 内核,如此链接中所示 http://homepages.inf.ed.ac.uk/rbf/HIPR2/log.htm .

但是,我对公式本身有困难。如果有人能告诉我如何计算中心,即使用什么 x 和 y 值才能在 9x9 内核中获得 -40,我将不胜感激。

最佳答案

您无需担心公式 - 仅用于生成系数。您只需要将这些 9x9 系数应用于您的图像。

示例(未经测试的代码!):

const int K = 9;
const int K2 = K / 2;
const int NORM = 500; // constant for normalising filter gain
const int coeffs[K][K] = { ... };
int in_image[M][N];
int out_image[M][N];

for (i = K2; i < M - K2; ++i)
{
    for (j = K2; j < N - K2; ++j)
    {
        int term = 0;
        for (di = -K2; di <= K2; ++di)
        {
            for (dj = -K2; dj <= K2; ++dj)
            {
                term += in_image[i + di][j + dj] * coeff[K2 + ii][K2 + jj];
            }
        }
        out_image = term / NORM;
    }
}

关于image-processing - 高斯拉普拉斯算子,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2556958/

相关文章:

XSLT:将 base64 数据转换为图像文件

image-processing - 图像分割 : how to isolate human body figure and a complex background?

python - 如何按职位过滤数据集?

python - OpenCV拉普拉斯金字塔: size not correct

python - 高斯拉普拉斯算子是用于 Blob 检测还是用于边缘检测?

image - 如何检测图像中有一点噪声的线条?

java - java中的扫描图像热图

c# - LINQ 按嵌套在 3 个列表中的属性筛选

filtering - MDX:定义维度子集并显示总计