0

I have some data (left image), with the second image taken at some t (right image). There is a shift in my images, with the masked portion of the image representing a physical piece that does not move relative to the 'rings' seen in the images (and is masked out for image clarity): enter image description here

Now, by eye, they look nearly identical; however, I'm interested in the difference between these two images. The difference of the two images is shown here, with darker blue being a negative value and yellow being a positive value: enter image description here

It is clear that there is a slight shift to the right (the left of the rings is always negative, and the right of the rings are always positive, uniformally around the image).

I am trying a means to effectively compute the shift between these images; I have tried masked_register_translation from skimage, but it is slow, and does not register any shift (this is likely due to the presence of 'hot spots' that are not shifting). Even if I were to mask these and apply some sort of median blur, the shift is incredibly slow and not particularly accurate.

Using peaks from the rings is difficult as no pronounced peak is visible.

I am unaware of any reliable 2D methods for calculating such a 'few pixel' shift - if there are any means of doing this more quickly and effectively relative to the skimage option, I would be more than grateful to hear!

kalle
  • 425
  • 1
  • 6
  • 17
  • Is the shift uniform across the whole image? Is the sift always in the same direction? – Pibben Oct 18 '19 at 12:49
  • I would try to estimate [Optical Flow](https://en.wikipedia.org/wiki/Optical_flow), for example using [pyoptflow](https://github.com/scivision/pyoptflow), and then calculate the average displacement vector. – Pibben Oct 18 '19 at 12:52

1 Answers1

0

Have you tried using register_translation instead? Perhaps setting space='fourier'? The reason I suggest this is I think I'm looking at SAED patterns, which is imaged in the Fourier plane of the TEM. Am I correct in saying it is a diffraction pattern.

I would also recommend attaching the images as tiffs, and when displaying them in the question, to have the colorbar plotted also. I would like to have a closer look. If they are diffraction patterns, the details in the diffraction rings may be different (sample drift, sample changing under the beam), but I'm confused as to why the position of the SAED pattern would change at all. The only reason I can imagine would be that your beam is not stable, perhaps due to the projector lens? Or perhaps you moved this manually? Regardless this isn't a TEM question, I'm just curious to learn the reason.

Also are you aware of the Hyperspy package? Good tools for EM related analysis.

PinkShnack
  • 26
  • 1
  • 4