3x3 窗口中的插值峰值定位
我正在使用 C++ 创建一个程序来查找数组中峰值的子像素位置。目前我在 3x3 窗口内找到最大值,这样每个窗口中的中心像素都大于其 8 个邻居中的每一个。
是否有一种众所周知的方法来确定峰值到亚像素精度的位置?
我读过有关通过泰勒展开式表示数组直至二次项并在零处取导数以找到偏移量的内容,但它似乎有点重量级......
I'm using C++ to create a program to find the sub-pixel location of peaks in an array. Currently I find maxima within a 3x3 window, such that the central pixel in each window is greater than each of it's 8 neighbours.
Is there a well known method for determining the location of the peak to sub-pixel accuracy?
I've read about representing the array by a Taylor expansion up to quadratic terms and taking its derivative at zero to find the offset, but it seems a little heavyweight...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
谢谢@罗斯。这是我为完成这项工作而编写的代码片段,以防其他人正在寻找相同的东西。
Thanks @Ross. Here's a code snippet of what I wrote to do the job in case anyone else is looking for the same thing.
如果这对你来说似乎是“重量级”,那么一切都是重量级的。一般来说,您需要一种插值算法来从离散表示变为某种连续表示并找到峰值。使用“图像处理”意味着 2D 功能。我可以建议使用一些基本插值(线性、双线性、三次等)并找到导数趋于 0 的峰值。
If this seems "heavyweight" for you everything is heavyweight. Generally speaking you need a interpolation algorithm to get from discrete representation to some continuous representation and find the peak. Using "image-processing" implies functions in 2D. I can suggest to use some basic interpolation (linear, bi-linear, cubic, etc.) and find the peaks where derivatives go to 0.