本文介绍了OpenCV:改变高斯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种使DoG内核对图像进行过滤的简单方法.我知道可以手动生成内核,然后彼此相减,但这不是更聪明的方法吗?

Is there a simple way of making DoG kernel to filter a image. I know it is possible to generate the kernels manually and then substract them from each other, but isn't there a smarter way to do this?

推荐答案

另一种方法是使用所需的参数为内核创建解析公式,并计算其中每个像素的位置.

Another way of doing it is to create the analytic formula for your kernel, with the needed parameters, and calculate the position of every pixel inside.

getDoG(i,j, sigma1Big, sigma2Big, sigma1Small, sigma2small,
                            rotationBig, rotationSmall, kernelSize, ...);

不要问我这个公式:)

但是最简单的方法是使用正确的参数制作两个内核并将它们相减.

But the easiest way is to make two kernels with the correct parameters and subtract them.

别忘了,对内核进行归一化(更改值,以使所有内核值的总和为1)

Do not forget to normalize the kernel (shift the values so that the sum of all kernel values is 1)

这篇关于OpenCV:改变高斯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-10 22:21