comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » poly_2d
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
poly_2d [message #24493] Tue, 03 April 2001 07:25 Go to next message
pfis is currently offline  pfis
Messages: 2
Registered: February 2001
Junior Member
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.

Regards,

Phil




----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net
Re: poly_2d [message #24592 is a reply to message #24493] Fri, 06 April 2001 15:49 Go to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: spherical gridding problem
Next Topic: Re: why is using objects so much slower ?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 14:55:38 PDT 2025

Total time taken to generate the page: 0.00502 seconds