Here is a problem I was given yesterday.
There are two maps of the same place. They both show major landmarks about right, but the projections, scale, and probably poor cartography in one of them don't make them align. I would like to 'warp' one of them to conform to the other one.
Here is what I was trying to do, which kind of works but it's quite a bit of work
1) I cropped them to about the same area. I resampled one of them so that they both have the same pixel dimensions.
2) I used Composite with 3-point alignment, using the same landmarks as far apart from each other as possible, in Register mode. They are closer now, but no cigar.
3) I used Distort on the overlay map (the one I want to 'warp') and placed several control points on some other landmarks that I can identify on both.
4) Then I copied the Distort transformation to the base map (i.e. the better one - the one I want the overlay map to conform to) and I pointed the control points arrows to the common landmarks on it.
5) Then, finally, I copied this revised Distort transformation back to the Overlay map and let it distort it accordingly.
They align about right now, but I was choosing the most effective distort method blindly (Sheppard ended up working ok) and I wonder if there is an easier way to do something similar to my quest?
Aligning and distoring maps to match
Moderator: jsachs
-
- Posts: 1431
- Joined: April 25th, 2009, 12:56 am
- What is the make/model of your primary camera?: Fuji X-E2
- Contact:
Aligning and distoring maps to match
Maciej Tomczak
Phototramp.com
Phototramp.com
Re: Aligning and distoring maps to match
There is a powerful feature in PWP 7 which I never bothered to port to PWP 8 for just this problem. It is call multi-point alignment in the Composite transformation. It lets you match up a bunch of corresponding points in two images and aligns and warps the images as necessary to get all the points to line up.
Jonathan Sachs
Digital Light & Color
Digital Light & Color
-
- Posts: 1431
- Joined: April 25th, 2009, 12:56 am
- What is the make/model of your primary camera?: Fuji X-E2
- Contact:
Re: Aligning and distoring maps to match
This is PWP7 question. Is there a difference between the first 3 alignment point and the rest of them? The way I understand it is that the first 3 points are responsible for translation, rotation, and scaling, which happens first, then the already translated, rotated, and scaled image is warped based on the rest of the points and the method. In other words, if the first 3 points are mischosen, the rest of them have a lesser chance to warp the image successfully. Is that correct?
Maciej Tomczak
Phototramp.com
Phototramp.com
Re: Aligning and distoring maps to match
Yes, the first 3 points define a base 3-point alignment transformation that is applied globally to deal with translation, scaling and rotation mismatch. The remaining points distort the overlay image locally. The better the images match before local adjustments, the more accurate the overall match.
This method is often used, for example, to stitch together sets of overlapping aerial photos for map making or surveying purposes. Before specialized programs were developed for the purpose, we also had a number of astrophotographers using it to stack images that were slightly distorted.
This method is often used, for example, to stitch together sets of overlapping aerial photos for map making or surveying purposes. Before specialized programs were developed for the purpose, we also had a number of astrophotographers using it to stack images that were slightly distorted.
Jonathan Sachs
Digital Light & Color
Digital Light & Color
-
- Posts: 1431
- Joined: April 25th, 2009, 12:56 am
- What is the make/model of your primary camera?: Fuji X-E2
- Contact:
Re: Aligning and distoring maps to match
Thanks. One point that I'm not sure if I understand is why would it be better for the multipoint alignment to start from the initial global corrections using 3 points, rather than 4 (including perspective)?
Maciej Tomczak
Phototramp.com
Phototramp.com
Re: Aligning and distoring maps to match
I could have used 4 points but did not want to require too many pairs of points.
If you want to get the effect of 4 points, do a 4-point alignment first and select Register as the operation. This will register the overlay image with the base image. You can then composite the registered overlay image again with the base image.
If you want to get the effect of 4 points, do a 4-point alignment first and select Register as the operation. This will register the overlay image with the base image. You can then composite the registered overlay image again with the base image.
Jonathan Sachs
Digital Light & Color
Digital Light & Color
-
- Posts: 1431
- Joined: April 25th, 2009, 12:56 am
- What is the make/model of your primary camera?: Fuji X-E2
- Contact:
Re: Aligning and distoring maps to match
Is there a remote chance that sometimes in the future porting of Multipoint Composite could be considered?
Other than maps and astrophotography it seems to be quite useful in compositing e.g. different part of faces from two images when they have to be aligned first and probably other operations. I was thinking that since Distort is already there, some of the code may be borrowed from it? But I have no idea if that's true or how difficult and time-consuming it may be. But it's a really nice transformation...
Other than maps and astrophotography it seems to be quite useful in compositing e.g. different part of faces from two images when they have to be aligned first and probably other operations. I was thinking that since Distort is already there, some of the code may be borrowed from it? But I have no idea if that's true or how difficult and time-consuming it may be. But it's a really nice transformation...
Maciej Tomczak
Phototramp.com
Phototramp.com
Re: Aligning and distoring maps to match
It has been on the thing to do list for a long time but I was never entirely happy with the original implementation and hardly anyone ever used it.
Jonathan Sachs
Digital Light & Color
Digital Light & Color
-
- Posts: 1431
- Joined: April 25th, 2009, 12:56 am
- What is the make/model of your primary camera?: Fuji X-E2
- Contact:
Re: Aligning and distoring maps to match
Out of curiosity, how the original implementation could be improved?
Maciej Tomczak
Phototramp.com
Phototramp.com
Re: Aligning and distoring maps to match
The refinement of alignment points never worked particularly well -- it would also be nice to automatically identify and align points in images as in done by panoramic stitching programs. I have information on how to do all this, but it is complicated.
Jonathan Sachs
Digital Light & Color
Digital Light & Color