source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/vlutil/toolbox/imwbackward.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1function wI = imwbackward(varargin)
2% IMWBACKWARD  Image backward warping
3%   J = IMWBACKWARD(I, X, Y) returns the values of image I at
4%   locations X,Y. X and Y are real matrices of arbitrary but
5%   identical dimensions. I is bilinearly interpolated between
6%   samples and extended with NaNs to the whole real plane.
7%
8%   By default, IMWBACKWARD assumes that the image I uses the standard
9%   coordinate system (see WARP_OVERVIEW). IMWBACKWARD(XR,YR,I,X,Y)
10%   assumes instead that I is defined on a rectangular grid
11%   specified by the vectors XR and YR.
12%
13%   ALGORITHM. What IMWBACKWARD is less general than the MATLAB native
14%   function INTERP2, but significantly faster.
15%
16%   See also WARP_OVERVIEW, IMWFORWARD, INTERP2.
17
18if nargin < 5
19  I = varargin{1} ;
20  [M,N,K] = size(I) ;
21  xr = 1:N ;
22  yr = 1:M ;
23  varargin = { varargin{2:end} } ;
24else
25  xr = varargin{1} ;
26  yr = varargin{2} ;
27  I  = varargin{3} ;
28  [M,N,K] = size(I) ;
29  varargin = { varargin{4:end} } ;
30end
31 
32if K == 1
33  wI = imwbackwardmx(xr, yr, I, varargin{:}) ;
34else
35  [M,N] = size(varargin{1}) ;
36  wI = zeros(M,N,K) ;
37  for k=1:K
38    wI(:,:,k) = imwbackwardmx(xr, yr, squeeze(I(:,:,k)),  varargin{:}) ;
39  end
40end
Note: See TracBrowser for help on using the repository browser.