开发者

I need help compensating for the shifting of images when trying to create a grid with one image and apply it on another

开发者 https://www.devze.com 2023-01-08 06:03 出处:网络
I have two images of yeast plates: Permissive: Xgal: The to images should be in the same spot and roughly the same size. I am trying to use one of the images to generate a grid and then apply t

I have two images of yeast plates:

Permissive:

I need help compensating for the shifting of images when trying to create a grid with one image and apply it on another

Xgal:

I need help compensating for the shifting of images when trying to create a grid with one image and apply it on another

The to images should be in the same spot and roughly the same size. I am trying to use one of the images to generate a grid and then apply that grid to the other image. The grid is made by looking at the co开发者_StackOverflow社区lonies on permissive plate, the plate should have 1536 colonies on it. The problem is that the camera that was used to take the images moves a bit up and down and the images can also be shifted slightly due to the other plate not being in exactly the same place.

This then means that when I use the permissive plate to generate the grid on the xgal plate the grid shifts. Does anyone know a way in which I can compensate for this? I am using perl with the gd module. Any advice would be greatly appreciated. Thank you


I've done this in other languages in relation to motion analysis. You can mathematically determine the shift in position between two images using cross correlation.

Fortunately, you may not need to actually do the maths :) You could use something like ImageMagick, which provides a lot of image processing functions for you, and is perl scriptable. Independently scripts already exists for tasks very much like yours -- see.


If you have only a few pairs of images and, as in the examples, they are very different in appearance then an alternative method to Tim Barrass' would be

  1. Open the first image in gimp, find the co-ordinates of a landmark feature
  2. Open the second image in gimp, find the co-ordinates of the same landmark
  3. Calculate the offset
  4. Shift the second image using ImageMagick's convert command with the affine option. Set the parameters sx=sy=1.0, rx=ry=0.0, tx= negative horizontal offset, ty= negative vertical offset
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号