Pregunta

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/

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top