From AffineTransform to PerspectiveTransform

Z

zerg

Arne said:
Yes. Exactly. Which is why I asked the question.

But that doesn't make any sense. You asked the question *because* the
answer was obviously "I'm not"??? Because, rather than despite?

You're strange.
 
A

Andrew Thompson

You might look at PerspectiveTransform:

<http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/ja
vax/media/jai/PerspectiveTransform.html>

Yes. That worked a treat.

I downloaded the wrong SDK and it failed when I
did not have a (J2SE) 1.3 SDK installed, but with
the docs and guide in hand, and a couple of Jar's
from an older release, I got it to do what I wanted
(I got exceptions because the natives were missing,
but since JAI was quite willing to WTE '..revert to
pure Java..' that was not a significant problem).

The code was hacked in around a previous GUI that
was written for aligning spherical images (moon
phases) and had a lot of the little UI bits I needed
to make it workable (e.g. panels to highlight points
with zoom, and accepting keyboard focus to adjust the
exact position of the point).

Now, I actually coded this because I made a rash
promise to my sister that I could correct the skew
in photos of images under glass. I had a quick look
at the motley collection of programs I had for image
manipulation, and was surprised to see that *none*
of them offered to correct such perspective skewed
images.

As a more general question, does anybody know of
programs that *do* offer perspective transforms?

I was vaguely considering offering it as a web
start app. if I can locate an existing (JWS based)
implementation of JAI, though it would take at
least as much code again, to make it usable as
a general program.

Ahh.. it seems it is here
<http://download.java.net/lg3d/test/jai.jnlp>
 
R

RedGrittyBrick

Peter said:
[...]
As a more general question, does anybody know of
programs that *do* offer perspective transforms?

It's not a Java program, but Photoshop Elements does. Its "Skew"
command allows you to move any corner of a selection in any direction.
Move two corners toward or away from each other, and you wind up with a
sort of perspective transform.

Given that GIMP is supposed to be a Photoshop competitor, I'd be really
surprised if GIMP couldn't do the same thing. Maybe even with basically
the same UI. But I don't have it installed at the moment, so I can't
check to see for sure.

GIMP does perspective transforms. Context menu, Tools, Transform Tools
has Rotation, Scaling, Shearing and Perspective transforms. The last of
which works in the way you describe.
 
J

John B. Matthews

Andrew Thompson said:
[...] promise to my sister...
As a more general question, does anybody know of
programs that *do* offer perspective transforms?

On the chance that she has access to a Mac, the included Developer Tools
DVD includes /Developer/Applications/Graphics Tools/Core Image Fun
House. It exercises the Quartz facilities, including perspective
transform.
 
A

Andrew Thompson

[...]
As a more general question, does anybody know of
programs that *do* offer perspective transforms?

It's not a Java program, but Photoshop Elements does.

That's cool, I was just wondering generally.

It seems with PhotoShop for Windows based
machines, GIMP for *nix, and the one John
mentioned for Mac, that the field is well
covered. I won't bother proceeding with
another specialist program (though I'll keep
it handy for my own use).

Thanks all.
 
N

Nigel Wade

Andrew said:
[...]
As a more general question, does anybody know of
programs that *do* offer perspective transforms?

It's not a Java program, but Photoshop Elements does.

That's cool, I was just wondering generally.

It seems with PhotoShop for Windows based
machines, GIMP for *nix, and the one John
mentioned for Mac, that the field is well
covered. I won't bother proceeding with
another specialist program (though I'll keep
it handy for my own use).

Thanks all.

GIMP is available for all those platforms - and it's free.
For other platforms the source is available.

Although, as the manual points out, it's not really a perspective tool but
rather a distort tool as no rules of perspective are imposed.
 
J

John B. Matthews

Nigel Wade said:
Andrew said:
On Sun, 02 Nov 2008 21:25:22 -0800, Andrew Thompson

[...]
As a more general question, does anybody know of
programs that *do* offer perspective transforms?

It's not a Java program, but Photoshop Elements does.

That's cool, I was just wondering generally.

It seems with PhotoShop for Windows based
machines, GIMP for *nix, and the one John
mentioned for Mac, that the field is well
covered. I won't bother proceeding with
another specialist program (though I'll keep
it handy for my own use).
Thanks all.

GIMP is available for all those platforms - and it's free.
For other platforms the source is available.

I just learned that Photoshop Elements version < 4 breaks under Mac OS X
10.5.1+, but GIMP is quite usable:

Although, as the manual points out, it's not really a perspective
tool but rather a distort tool as no rules of perspective are
imposed.

Surely. I confess an affinity for the GIMP user interface, which lets me
drag the corners as well as adjust the transformation matrix entries.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,813
Messages
2,569,699
Members
45,488
Latest member
MohammedHa

Latest Threads

Top