% detransrot.m Steve Mann, 1993 % (x-b)/a group image desampling for testing Peleg algorithm. % % This function will un-rotate and un-translate an image at subpixel resolution. % An additional feature (for future use) is that it can un-scale an image. % % Note the group is the reverse mapping y=g((x-b)/a) and not ax+b % so rot, trans, etc in usual sense: g(x-1) gives incr. along real axis % % Use: Y = detransrot(a,X,b) % a is dilation: angle(a) is rotation to act on X % X is input image % b is translation (real part is downward axis, imag part, right axis) % % Examples: tv(detransrot(exp(i*30*o),red)) % 30o rotated counterclockwise % tv(detransrot(1,red,3+4*i)) % translated 3 pixels down, 4 right % tv(detransrot(2,red) % displays function Y=red(X/2) which is bigger % % detransrot(2,red,100) is red((x-100)/2) = red(x/2-50); so 100 pel shift right % % detransrot(a,red,b,interp_order) uses something other than default bilinear % detransrot(a,red,b,interp_order,antialias_method) uses other than default = -1 % See also: detransrotxy, retransrotxy function Y = desamplerforPeleg(a,X,b, interp_order, antialias_method,myNaN) if nargin < 6 disp('detransrot: setting myNaN=NaN (default background grey level)') myNaN=NaN; % default NaN end%if if nargin < 5 disp('detransrot: antialias method not specified; setting it to -1') antialias_method = -1; end%if if nargin < 4 disp('detransrot: interp_order not specified; setting it to 1 (bilinear)') interp_order = 1; end%if if nargin == 2 disp('detransrot: you did not specify b so I am setting it to 0') b=0; end%if if nargin == 1 disp('--------------------------------------------') disp('detransrot: you MUST specify an input image, X') disp('--------------------------------------------') return end%if if nargin == 0 disp('---------------------------------------------------------------------') disp('detransrot: you MUST specify the dilation parameter,a, and the image X') disp('---------------------------------------------------------------------') return end%if Y = retransrot(1/a,X,-b/a, interp_order, antialias_method,myNaN);