Request: Allow Match Photo to accommodate pictures that were cropped asymmetrically, were taken with a tilt-shift lens, or were rectified post-shoot, or a combination of the above.
Problem description: Currently, Match Photo only works correctly when the optical axis of the perspective transform that underlies a photo-matched image lies at the center of that image. The above techniques will break that assumption, as many users, including myself, have found out after frustrating fiddling. Failure typically presents itself as the blue axis being tilted away from where it is expected, and/or by measurements in the red/green plane being unequal, possibly quite dramatically so. Yet, often, there is no intutively obvious issue with the source image.
Mathematically, all of the aforementioned image manipulation techniques can be represented by a single perspective transform, one that accommodates the optical axis being off-center. Such a transform has 11 scalar parameters (with viewport size, location, and pixel discretization included). Therefore, 11 parameters are required for the inverse transform. But currently, Match Photo takes in only 9 parameters: 6 for the 2D positions of the two vanishing points and the origin, 1 for axis scaling, and 2 implicitly from the image aspect ratio and its pixel size.
Suggestion: To take in the âmissingâ 2 scalar parameters (currently implied as fixed), I believe the existing Match Photo UI could be organically extended by allowing the user to manipulate one additional handle point to indicate the location of the optical axis.
- The UI object could be either a square handle like those for the vanishing points, or a bullseye element.
- The default handle location will be the image center, such that no action will be needed for uncropped images.
- The handle might be colored magenta or cyan to complement R/G/B for the directions and yellow for the horizon line.
Proof of concept (of sorts): I constructed a sample scene with deliberately strong perspective (short focus, camera close to scene elements) and elements arranged to one side:
I exported that scene as an image, cropped it both horizontally and vertically such that the camera aim point is off-center in the crop, and applied sepia-tone to reduce confusion on re-import. I then attempted Match Photo on it, which expectedly failed with the symptoms mentioned above:
To recover the Match attempt, I edited the picture externally, to re-extend the crop such that the camera aim point falls again at the center. This image gives excellent results for Match Photo, as expected:
In this contrived example, I of course knew a-priori where the aim point was, but a canvas extension could conceptually be done for any cropped picture to work with the existing Match Photo implementation. However, iterating the aim point search that way would be extremely tedious (having 2 dimensions to boot). If Match Photo could be extended to take in the aim point as additional 2D handle point, however, such an iteration should be much easier to perform by the user, and avoids a great deal of the current frustration.
I hope I have not missed any math issue here, and that there isnât an ominous business obstacle in play behind the scenes that so far prevented accommodating crops and the like.
Next: Accommodate barrel/pincushion distortion around the newly found aim point.
Thanks for reading;
Michael Sternberg.