Recently over at the Photoshop Forum the matter of automatically placing images into photographs of TV-screens has come up repeatedly. (Possibly for electronics-catalogs I guess.)
Now images are pretty easily placed automatically in frontal shots as long as paths for the screens exist and follow some previously known naming-conventions.
Inserting images into slanted shots of the TV-screens is tougher to automate when they are supposed to show perspectival shortening.
If the vertical lines in the photograph remain parallel to the vertical borders of the document I think Ive more or less got it (depending on the screen-paths being four-points-only); the subPathItems.pathPoints.anchor-values can be used to calculate the necessary shortening, skewing and scaling; not that I could figure out the math myself though. Because I fragmented the operations (thus sacrificing speed I guess) it can be achieved in a loss-free manner only with Smart Objects in CS4.
If all the parallels converge to respective vanishing points on the other hand Im pretty much flabbergasted, because I can hardly make sense of the values I get when recording transformations with the Scripting Listener as it is.
Still I can vaguely see a possible, rather complicated way of achieving it by breaking the transformation down into even more separate operations.
But when considering what Photomerge can do it seems to me that perspectival transformations should indeed be scriptable
So, does anyone know it its possible to achieve a perspectival transformation in JavaScript by addressing the four corner-points directly, which would seem the easiest way?
Can any of You point me to a source that explains the interaction of the various transformation values?
Or does a functioning Script for perspectival transformation based on a four-point-path exist already anyway?
Its not a matter of urgency, it just seems an interesting problem.