Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: sub-pixel shifting of a matrix
Replies: 14   Last Post: Feb 7, 2013 12:23 PM

 Messages: [ Previous | Next ]
 Matt J Posts: 4,997 Registered: 11/28/09
Re: sub-pixel shifting of a matrix
Posted: Feb 24, 2010 10:12 AM

"Shalin Mehta" <shalinDOTmehtaHATESSPAM@gmail.com> wrote in message <h8svoe\$rkb\$1@fred.mathworks.com>...
> Just found a useful solution: Use interp2 with '*linear' option. Works factor of 2.5 faster than imtransform. Any other ideas?
=================

Yes, interp2 will still be quite slow because of all the different functionality it has to support, for example, interpolation on non-uniform grids. It is much faster to express the interpolation as a separable convolution and use
conv2().

Namely if your shift in x and y are 0<sx<1 and 0<sy<1 respectively, then you can do

Image=conv2(Image,[sx, 1-sx],'same');
Result=conv2(Image,[sy, 1-sy],'same');

Date Subject Author
9/17/09 Shalin Mehta
9/17/09 Shalin Mehta
10/30/09 Dumebi Okwechime
2/24/10 Shalin Mehta
2/24/10 Matt J
2/25/10 Rajesh
2/25/10 Matt J
2/25/10 Matt J
2/26/10 Rajesh
2/6/13 Bruno Luong
2/6/13 Matt J
2/6/13 Bruno Luong
2/7/13 Matt J
2/7/13 Bruno Luong