/usr/share/octave/site/m/vlfeat/toolbox/imop/vl_wtps.m is in octave-vlfeat 0.9.17+dfsg0-6build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | function [xp1,xp2]=vl_wtps(phi,Yp)
% VL_WTPS Thin-plate spline warping
% [XP1,XP2]=VL_WTPS(PHI,YP) computes the thin-plate spline (TPS)
% specified by the basis PHI and the warped control point Yp.
%
% Yp is a 2xK matrix with one column per control point and the basis
% PHI is calculated by means of the VL_TPS function.
%
% The thin-palte spline is defined on a domain X1,X2 and specified
% by a set of points Y and their warp YP. The spline passes
% interpolates exaclty the control points.
%
% The parameters X1,X2 and Y are used to compute the basis PHI. This
% operation is fairily slow, but computing the spline for a given Yp
% is then very quick, as the operation is just a linear combination
% of the basis.
%
% Example::
% To calculate the warped grid [X1,X2] by moving the control points Y to
% the control points YP use:
% [xp1,xp2]=VL_WTPS(VL_TPS(x1,x2,Y),Yp).
%
% See also: VL_TPS(), VL_HELP().
% Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson.
% All rights reserved.
%
% This file is part of the VLFeat library and is made available under
% the terms of the BSD license (see the COPYING file).
[K,M,N] = size(phi) ;
Xp=[Yp, zeros(2,3)]*reshape(phi,K,M*N) ;
xp1 = reshape(Xp(1,:),M,N) ;
xp2 = reshape(Xp(2,:),M,N) ;
|