Jonathan,

I'm not sure what you are asking, i.e., how to compute the coefficients of
the transformation or how to apply it.

As for the calculation of the transformation you would in your example
need to identify the mathematical form of the transformation and then
compute the best fit of its coefficients to the available data points.

As for the type of transformation, you will need to use something other
than an affine mapping which inherently maps parallel lines to parallel
lines. This is not the case in what you describe as the top and bottom
of the image are no longer parallel. See for example

http://www.cs.sunysb.edu/~oliveira/Courses/CSE528/CSE528_Slide_Set_4_Geometric_transf.pdf

for a brief discussion of geometrical transformations.

This case probably calls for a projective transformation or a specical
case thereof, the perspective transformation. The Java Advanced Imaging
API

        http://java.sun.com/products/java-media/jai/index.html

supports the perspective transformation as well as general bivariate
polynomial and generic grid warping.

Brian

On Wed, 19 Dec 2001, Jonathan Sosa wrote:

> Hello,
>
> I'm trying to resize an image (jpg) before drawing it to the graphics2d. But
> I need to apply greater ratio of resize to one of the sides of the image.
>
> supposing the original 4 corner points of the image are
> (10,10) (30,10) (30,20) (10,20)
> the normal 2X resize (and translation) would give
> (10,10) (50,10) (50,30) (10,30)
>
> but the resize I'm intended to do, keeping the left edge of the image size
> intact and resizing to right would result in
> (10,10) (40,0) (40,30) (10,20)
>
> the porpouse is to give the feeling of "entering" a corridor. Beign the
> images like the walls of the corridor.
>
> I can't use 3D graphics, must do it with 2d
> best regards
> Jonathan
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff JAVA2D-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to