Richard Gould a écrit :
> I'm giving a set of source points (image pixels) and destination points
> (world coordinates) to the WarpTransform2D class, and using that to
> create the WarpPolynomial object to perform the JAI operation, but the
> Warp that is created contains a strange affine transform. Although it is
> more than likely that I just don't quite understand what is going on.

WarpTransform2D is build on top of

     javax.media.jai.WarpPolynomial.createWarp(...)

I noticed strange behavior when the amount of points is close to the required 
minimum. It sound like that this method need slightly overdetermined set of 
points in order to give good result.

> The Warp's affine transform:
> [[0.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
> 
> I would think that that would be the identity? The image returned by JAI
> is the same shape, but it is blank. 

A line with only 0.0 values is suspect and is probably responsible for the 
blank 
image...

> Here is my test source code:
> 
>         src[0]  = new Point(0,0);
>         dest[0] = new DirectPosition2D(0, 0);
>         
>         src[1]  = new Point(0, 24);
>         dest[1] = new DirectPosition2D(0, 24);
>         
>         src[2]  = new Point(24, 24);
>         dest[2] = new DirectPosition2D(24, 24);
>         
>         src[3]  = new Point(24, 0);
>         dest[3] = new DirectPosition2D(24, 0);


I'm really not sure, but it may be worth to try the following:

  * Provides some additional points
  * Avoid to provides only points that are on the same line or
    same columns (i.e. try to provides points that looks like
    more random).

I really don't know if it will help; it is just a guess. In the referencing 
module test suite, we create affine transform and quadratic transform from a 
set 
of 100 random points, and it work.

http://svn.geotools.org/geotools/trunk/gt/modules/library/referencing/src/test/java/org/geotools/referencing/operation/transform/WarpTransformTest.java

100 points is probably much more than needed; it should work with much less 
points, but I don't know what the "real" minimum is. It seems to be more than 
what is currently documented.

        Martin

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to