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

Home » Public Forums » archive » Re: costum stretch an image
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: costum stretch an image [message #68880 is a reply to message #68814] Mon, 30 November 2009 13:22 Go to previous messageGo to previous message
M. Katz is currently offline  M. Katz
Messages: 69
Registered: May 2005
Member
I don't know if the gaps in your almost-piecewise continuous mapping
were intentional, but you could try interpolation. As follows...

v = [-12, 0, 36, 48] ;--- output values
x = [0., 36., 72, 76.021912] ;--- input values
xout = (your input array)

output = interpol( v, x, xout )

and to make it all integers in the end, use either floor() or round(),
as you prefer.

output = floor(interpol( v, x, xout ))

This method also preserves the dimensions of xout in the output array.
It should be very fast.

-M.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: SHAPEFILE changes in IDL7.1?
Next Topic: svg output

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

Current Time: Fri Oct 10 15:03:32 PDT 2025

Total time taken to generate the page: 0.88143 seconds