1

Now I'm using standard phase correlation for image stitching. It give normal results, but on hard images it gives wrong result, but Stitch 2D plugin in ImageJ(FIJI) gives good result in the majority of cases. The algorithm used in plugin described in this paper http://bioinformatics.oxfordjournals.org/content/25/11/1463.full.pdf But i can't understand it. "In real images, however,F−1(Q) contains several peaks marking different translations with high correlation. Moreover, each peak describes eight different possible translations (in 3D) due to the periodicity of the Fourier space. To determine the correct shift, we select the n highest local maxima (3×3×3 neighborhood) from F−1(Q) and evaluate their eight possible translations by means of cross-correlation on the overlapping area of the images A,B. The peak with the highest correlation is selected as translation between the two images. If none of the peaks is above a certain limit the tiles are assumed to be non-overlapping." can anyone explain how to implement it?

mrgloom
  • 20,061
  • 36
  • 171
  • 301
  • If you are using 2-D Phase Correlation I suggest you read introductory material or original papers. Checking the 8 best peaks (for 3-D) with cross correlation is a waste of time. – koan Feb 17 '12 at 10:12
  • it seems that algorithm axplained in "Kuglin,C.D. and Hines,D.C. (1975) The phase correlation image alignment method. In Proceedings of the IEEE, International Conference on Cybernetics and Society, pp. 163–165." but I can't find this paper. – mrgloom Feb 17 '12 at 11:17
  • Here is another important paper by Graham Thomas, http://www.bbc.co.uk/rd/publications/rdreport_1987_11.shtml I think you will find it teaches everything you need. – koan Feb 17 '12 at 13:11
  • I find only some information about filtration in this paper. What if I smooth initial image? it help to filtrate fake peaks? or I must filtrate spatial domain? – mrgloom Feb 20 '12 at 07:16
  • Are you windowing the input to phase correlation ? or does it do it for you ? This is essential. – koan Feb 20 '12 at 09:33
  • No I don't. I find some information here http://en.wikipedia.org/wiki/Hamming_window#Hamming_window but can't understand it.I need to do it before FFT? Also I can't understand what w,n,N in formula's? code that i use here http://codepaste.ru/9226/ – mrgloom Feb 20 '12 at 11:58
  • See http://en.wikipedia.org/wiki/Window_function ; if you have problem with your code either insert into this question or ask another question. – koan Feb 20 '12 at 12:59
  • I apply Hamming window here the results with window http://rghost.ru/36617449/image.png without window http://rghost.ru/36617443/image.png .And the max peak has the same coordinate.I use the code double omega = 2.0*M_PI/(fft_size-1); double A= 0.54; double B= 0.46; img1[k].Re= (img1[k].Re)*(A-B*cos(omega*k)); but I don't understand which parameters better, or which window type is better. – mrgloom Feb 21 '12 at 05:58
  • I think jiles de wit has answered your original question. I think you should accept his answer and start a new question about the "hard" images that your code doesn't work with. – koan Feb 21 '12 at 08:57
  • ok. http://stackoverflow.com/questions/9377640/phase-correlation-for-image-stitching-using-of-hamming-window – mrgloom Feb 21 '12 at 12:29

1 Answers1

1

From the quote it looks as if:

  1. They use phase correllation to find multiple candidates ("we select the n highest local maxima (3×3×3 neighborhood) from F−1(Q)") for the overlapping segment between two images
  2. And then they use some matching in the original image data ("by means of cross-correlation on the overlapping area of the images A,B.")
  3. To select the best candidate from those("The peak with the highest correlation is selected as translation between the two images."),
  4. If that best candidate matches good enough ("If none of the peaks is above a certain limit the tiles are assumed to be non-overlapping.").
jilles de wit
  • 7,060
  • 3
  • 26
  • 50
  • yes, I understand it on the level that you explain but I don't understand item 2) the method of "some matching".It seems like they find N best peaks but what to do next? – mrgloom Feb 17 '12 at 11:17
  • By matching I mean that for each peak found in step 1 they then compare the corresponding regions of overlap in image A and B, and determine how similar these two regions are (as they should be if they overlap) they use cross correlation for this matching step (https://en.wikipedia.org/wiki/Cross-correlation). This gives them another number for each peak (the cross correlation coefficient) that is higher if the overlapping pieces in image A and B are more similar. In step 3 they then select the highest of these numbers (i.e. most similar overlapping area). – jilles de wit Feb 17 '12 at 12:31
  • Other names for matching are "image comparison" and "template matching". Some techniques (other than cross correlation) are discussed here: http://stackoverflow.com/questions/843972/image-comparison-fast-algorithm – jilles de wit Feb 17 '12 at 12:33
  • Since phase correlation is a type of normalised cross correlation, calculating additional correlation values for each peak will not improve the result. – koan Feb 17 '12 at 13:19
  • Phase correlation is calculated on the Fourier transform of the original image data. In step two you use the correlation of the original image data. – jilles de wit Feb 17 '12 at 13:37
  • I think it's the same only some difference in normalisation. – mrgloom Feb 20 '12 at 08:28
  • @jiles-de-wit Phase correlation is the normalised cross power spectrum. The CPS is the Fourier Transform pair of cross correlation so calculating the PC is almost the same as calculating cross correlation in the spatial domain. The difference is so small, it wouldn't be worth doing. – koan Feb 20 '12 at 09:10
  • @koan, I know this (it is all coming back to me now), but this is what is done in the paper the orginal question asks about, and they claim it helps. So presumably the small difference is enough of a difference to make a difference. And anyway, I was answering the question (how to implement their technique) not debating its merits. – jilles de wit Feb 20 '12 at 09:36