How can I get the estimated coordinates when applying affine transform?

How can I get the estimated or adjusted points when apply affine transformation with control points matched from distorted image (input_points)and original image (base_points)? Example points like below:
base_points= [202.5 198.5; 3998.5 198.5; 4002.5 2602.5; 202.5 2602.5];
input_points= [278.5 246.5; 4038.5 170.5; 4162.5 2702.5; 170.5 2622.5];
t_affine = cp2tform(input_points,base_points,'affine');
Can I get the estimated coordinates using imtransform like below?
estimate_aff = imtransform(input_points,t_affine);

 Accepted Answer

Use TFORMFWD.

1 Comment

Thanks.
How about if I increase the number of matched control points to 30 points and would like to use 2nd order of polynomial and piecewise linear as transformation like below:
t_poly2 = cp2tform(input_points, base_points,'polynomial',2);
t_pwl = cp2tform(input_points, base_points,'piecewise linear');
How can I get the estimated or adjusted points? I could not use tformfwd. Error obtained as below:
??? Error using ==> tform>checkTform at 109 Function TFORMFWD expected T's forward_fcn field to be non-empty.
Error in ==> tform at 30 [t, A] = checkTform(f, numout, varargin{:});
Error in ==> tformfwd at 68 varargout = tform('fwd', nargout, varargin{:});

Sign in to comment.

More Answers (0)

Asked:

on 4 Oct 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!