[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*Subject*: Re: poly_2d*From*: thompson(at)orpheus.nascom.nasa.gov (William Thompson)*Date*: 6 Apr 2001 22:49:48 GMT*Newsgroups*: comp.lang.idl-pvwave*Organization*: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov)*References*: <9acmh1$po$1@news.netmar.com>*Xref*: news.doit.wisc.edu comp.lang.idl-pvwave:24430

pfis@mytec.com writes: >I am using poly_2d to warp an image. I am using 3 parameters for each >coordinate (e.g. xnew=a+bx+cy and similar for ynew). My problem is I am >having trouble choosing 'a' such that the center of the image (actually pixel >[64,64] of a 128x128 image) does not move. Using a=fix(-64.*(b+c-1.)) keeps >the center stationary to about 1 pixel which is not good enough. I wrote my >own version of the warping program which does what I want but is slower than >poly_2d. Any help would be appreciated. I don't understand why you're using the FIX() function. I'm quite sure that the input parameters to POLY_2D can (and should) be floating point. In my own software, I use slightly different values of the parameter you call A, depending on whether or not nearest neighbor interpolation is going to be used. If I am using nearest neighbor, then I add 0.5 to A, specifically to avoid the problem that you're encountering. In your example, this would be A = -64.*(b+c-1.) + 0.5 However, for bilinear or cubic interpolation, I do not include the extra 0.5, so that A = -64.*(b+c-1.) William Thompson

**References**:**poly_2d***From:*pfis

- Prev by Date:
**Re: spherical gridding problem** - Next by Date:
**array dimensions** - Prev by thread:
**Re: poly_2d** - Next by thread:
**Google Stiffling Free Flow of Jokes** - Index(es):