MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Learn moreOpportunities for recent engineering grads.
Apply TodayNew to MATLAB?
MATLAB Central > MATLAB Newsreader > subpixel shifting of a matrix 

Subject: subpixel shifting of a matrix From: Shalin Mehta Date: 17 Sep, 2009 08:34:03 Message: 1 of 15 
Hello world, 
Subject: subpixel shifting of a matrix From: Shalin Mehta Date: 17 Sep, 2009 09:33:02 Message: 2 of 15 
Just found a useful solution: Use interp2 with '*linear' option. Works factor of 2.5 faster than imtransform. Any other ideas? 
Subject: subpixel shifting of a matrix From: Dumebi Okwechime Date: 30 Oct, 2009 10:07:01 Message: 3 of 15 
Hi Shalin, 
Subject: subpixel shifting of a matrix From: Shalin Mehta Date: 24 Feb, 2010 11:58:07 Message: 4 of 15 
Hi Dumebi, 
"Shalin Mehta" <shalinDOTmehtaHATESSPAM@gmail.com> wrote in message <h8svoe$rkb$1@fred.mathworks.com>... 
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. 
"Rajesh " <rv_acharya@rediffmail.com> wrote in message <hm53ot$ig8$1@fred.mathworks.com>... 
"Matt J " <mattjacREMOVE@THISieee.spam> wrote in message <hm56qd$t3c$1@fred.mathworks.com>... 
> You can extrapolate with zeros or any other desired value using the EXTRAPVAL option. 
Subject: subpixel shifting of a matrix From: Paulus Potter Date: 6 Feb, 2013 19:26:07 Message: 10 of 15 
It should be: 
Subject: subpixel shifting of a matrix From: Bruno Luong Date: 6 Feb, 2013 19:47:09 Message: 11 of 15 
"Paulus Potter" wrote in message <keuaof$amu$1@newscl01ah.mathworks.com>... 
"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <keubvt$fki$1@newscl01ah.mathworks.com>... 
Subject: subpixel shifting of a matrix From: Bruno Luong Date: 6 Feb, 2013 22:49:08 Message: 13 of 15 
"Matt J" wrote in message <keuln5$onb$1@newscl01ah.mathworks.com>... 
"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <keuml4$rtj$1@newscl01ah.mathworks.com>... 
Subject: subpixel shifting of a matrix From: Bruno Luong Date: 7 Feb, 2013 17:23:08 Message: 15 of 15 
"Matt J" wrote in message <kf0lu4$eph$1@newscl01ah.mathworks.com>... 
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.