From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: sub-pixel shifting of a matrix
Date: Thu, 25 Feb 2010 06:02:05 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 10
Message-ID: <hm53ot$ig8$>
References: <h8ss9r$jhf$> <h8svoe$rkb$> <hm3fkm$c2u$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1267077725 18952 (25 Feb 2010 06:02:05 GMT)
NNTP-Posting-Date: Thu, 25 Feb 2010 06:02:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2232754
Xref: comp.soft-sys.matlab:611470

interp2 works well alright (thanks shalin mehta) but it fills the shifted region of the matrix with NaNs. may be it can be padded by copying the adjacent columns or rows, as the case may be, using 'padarray' function. but again this loop takes longer time. especially when you are dealing with series of matrices/images to be shifted in a loop as Mat also points out. 

does conv2 work for fractions >1?? but even this, i guess,  leaves the shifted column (for shift in x direction) in shambles. 

Wish we could have something like 'circshift' handle fractions along with integers. :(

I need to shift an image by say 6.3 pixels in x direction in such a way that as if only the object in the image has moved and the background is retained as it is. and i need to implement it in a loop for several images with varying values of shift in x direction. so needless to say the faster the better as the original post has asked for.