本文介绍了图像拼接的相位相关(使用汉明窗)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用相位相关进行图像拼接,它可以为我的大部分测试数据提供良好的结果。我只是stitiching图像左右和上下(只有移位)
但是有一些奇怪的行为。
第一个奇怪的坐标,我必须转换坐标

I use phase correlation for image stitching and it gives good results for most part of my test data. I just stitiching pairs of image left-right and top-bottom(only shift)But there is some strange behaviour.First strange coordinates, I must convert coordinates

//if L-R
pt.x= src->width-maxloc.x;
pt.y= src->height-maxloc.y;
if(pt.y>(temp->height/2))
  pt.y= -(maxloc.y+1);
//if T-B
pt.x= src->width-maxloc.x;
pt.y= src->height-maxloc.y;
if(pt.x>(temp->width/2))
  pt.x= -(maxloc.x+1);

然后使用Hamming窗口似乎当我使用Hamming窗口进行左右拼接时效果更好(即使是不好的情况),但是如果我使用汉明窗口进行上下工作则很糟糕(即使情况很好)。
我认为我不需要为L-R和T-B分离个别情况,我希望相位相关只给我全局最大值,但似乎在理解FFT或相位相关时会出现一些错误。
这里是我使用的代码

Then usage of Hamming window it seems that when I use Hamming window for left-right stitching it works better(even for bad cases), but if I use Hamming window for top-bottom it works bad (even in good cases).And I think I don't need to separate individual cases for L-R and T-B, I expect that phase correlation just give me the global maximum, but it seems that some mistakes in understanding of FFT or phase correlation.here is the code that I use http://codepaste.ru/9415/

推荐答案

您的代码有一个明显的错误:

Your code has a glaring mistake:

//if L-R
pt.x= src->width-maxloc.x;
pt.y= src->height-maxloc.y;
if(pt.y>(temp->height/2))
  pt.y= -(maxloc.y+1);
//if T-B
pt.x= src->width-maxloc.x;  // (repeated)
pt.y= src->height-maxloc.y; // <- overwrites previous value
if(pt.x>(temp->width/2))
  pt.x= -(maxloc.x+1);

请显示您尝试注册的图片。

Please can you show the images that you are trying to register.

这篇关于图像拼接的相位相关(使用汉明窗)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 12:38