I am trying to compare two images where one of them is rotated and shifted. I need to find the transformation from one to another so that I can resample and compare/subtract using VIPS to see the difference. Is there a way to do this?
1 Answers
nip2 has a couple of ways of doing this.
Load two images and click Toolkits / Images / Transform / Linear Match. A pair of tie points will appear on your two images: drag them to mark a pair of features on each image. The output image will be the second image resamped to match the first. There are some options to automatically improve your tie points, and to only rotate. It should be quick, even for very large images.
There's also an automatic transform finder. The auto search will only work for pairs of images which are rather similar; for example, it won't be able to match an x-ray and a visible image. To try this, load two images (they must be exactly the same size), and click Toolkits / Image / Transform / Rubber Sheet / Find. This will find a transform that matches the second image to the first. You can set how long it searches and the error threshold. It won't work for very large images (more than a few GB).
After you've found a transform, you can apply it to any other image with Toolkits / Image / Transform / Rubber Sheet / Apply. It'll take account of changes of scale, so you can find on a small image and apply on a large one.
Unfortunately, the auto transform finder was written by a friend of mine and he can't release the source. It's compiled into the Windows nip2 binary, or on linux you have to download a binary plugin and put it in the vips lib area.

- 10,213
- 2
- 23
- 39
-
Will try this out. However, I am looking to do it as part of a web application and need something that will run at least as a command line call. Is there any benefit in coupling this with OpenCV for the transformation part? – JoeD Apr 18 '16 at 13:09
-
Do you need to search for a transform, or are you using tie points? – jcupitt Apr 18 '16 at 13:16
-
I just have 2 images to compare and I need to find the transform to apply to align them and subtract them to get the difference. So I am exploring different libraries to do this. – JoeD Apr 18 '16 at 18:32
-
Sounds like opencv would be your best bet for finding a transform. vips might be useful for the actual resampling. – jcupitt Apr 19 '16 at 12:05