function [wimg] = tpswarp_c(img, ipts, opts, regterm);
if nargin<4
    regterm = single(1);
end
regterm = single(regterm);
ipts = single(ipts');
opts = single(opts');
img = single(img);
[wimg] = tpswarp_version_1_3(img, opts(:), ipts(:), regterm);
wimg = uint8(wimg);