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

Home » Public Forums » archive » Re: shifting individual pixels within 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: shifting individual pixels within an image [message #70734 is a reply to message #70733] Mon, 03 May 2010 06:41 Go to previous messageGo to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On May 3, 10:19 am, David Fanning <n...@dfanning.com> wrote:
> barbis writes:
>> SHIFT  function returns the following:
>
>> % SHIFT: Expression must be a scalar or 1 element array in this
>> context: TX.
>
>> it does not accept 2 dim arrays as input.
>
> Not sure where you are getting this information,
> but you are being misinformed. :-)

I think that he means that the amount to shift cannot be an array.
What he seems to want is not what I would call a shift, which is
moving each dimension by a constant value, but to get, for each
position in the array, the value at some other position, given by an
offset, which is not the same for every pixel (or evey dimension).
Then add that to the original value.

It seems he wants something like:

sz=size(input,/dimensions)
;convert offsets (tx,ty) into indexes after offset (ix,iy)
ix=rebin(lindgen(sz[0]),sz[0],sz[1])+tx
iy=rebin(reform(lindgen(sz[1]),1,sz[1]),sz[0],sz[1])+ty
output=input[ix,iy]+input

That is assuming that no shifts will get to out-of-range indexes.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How to reverse the axis
Next Topic: OR

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

Current Time: Fri Oct 10 03:56:56 PDT 2025

Total time taken to generate the page: 0.16255 seconds