I just installed Matlab 2013a with the image processing toolbox. It has a new function IMWARP. It is very similar to the existing IMTRANSFORM function when performing 2D transformations on an image. I performed the same transformation on an image using both IMWARP and IMTRANSFORM. IMWARP is significantly faster (2X to 3X). I compared both images and they gave similar, but not exactly the same results. Also each function uses a difference version of the TFORM object. I was wondering is someone can describe the differences and advantages between these two functions.
out = imwarp(I,tform);
is not the same as the algorithm used by imtransform syntax:
out = imtransform(I,tform);
% Read and display image I = imread('pout.tif'); imshow(I); % Create geometric transformation T = [1 -sin(pi/4) 0; sin(pi/4) 1 0; 0 0 1]; tform = maketform('affine', T); % Define input spatial referencing udata = [-1 1]; vdata = [-1 1]; % Define output spatial referencing xdata = [-0.8 0.8]; ydata = [-0.8 0.8]; output_size = round(size(I)/8); % Apply geometric transformation to image J = imtransform(I, tform, 'UData', udata, 'VData', vdata, ... 'XData', xdata, 'YData', ydata, 'Size', output_size); % Display transformed image imshow(J)
In R2013a, this can be rewritten using imwarp, geometric transformation objects, and spatial referencing objects:
% Read and display image I = imread('pout.tif'); imshow(I); % Create geometric transformation object T = [1 -sin(pi/4) 0; sin(pi/4) 1 0; 0 0 1]; tform = affine2d(T); % Define input spatial referencing. World limits of input image are from % -1 to 1 in both X and Y directions. RI = imref2d(size(I),[-1 1],[-1 1]); % Define output spatial referencing. World limits out output image are % from -0.8 to 0.8 in both X and Y directions. Output grid size is 1/8 % that of the input image. Rout = imref2d(round(size(I)/8),[-0.8 0.8],[-0.8 0.8]); % Apply geometric transformation to image [J,RJ] = imwarp(I,RI,tform,'OutputView',Rout); % Display transformed image imshow(J,RJ)
Matlabsolutions.com provides guaranteed satisfaction with a
commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain
experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support
to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been
empanelled after extensive research and quality check.
Matlabsolutions.com provides undivided attention to each Matlab
assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services
include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work
done at the best price in industry.