phase correlation for image stitching (using of Hamming Window)

空扰寡人 提交于 2019-12-12 03:14:35

问题


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);

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/


回答1:


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.



来源:https://stackoverflow.com/questions/9377640/phase-correlation-for-image-stitching-using-of-hamming-window

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!