I've corresponded on this matter with someone from Mathworks before.
Initially, I thought it might have been the fact that I was giving
the function too many input points (something like 10000!). Now
cp2tform gives me the message
"
??? Error using ==> cp2tform (findPolynomialTransform)
At least 15 non-collinear points needed to infer polynomial transform.
Error in ==> C:\MATLAB6\toolbox\images\images\cp2tform.m
On line 142 ==> [trans, output] = feval(findT_fcn,uv,xy,options);
"
The control points I used this time around were selected using the
Control Point Selection. I selected 16 points which the Selection
Tool determined to be good enough matches. They are:
base_points =
1.0e+003 *
1.2550 0.1768
1.6946 0.2740
1.3846 0.6210
1.5280 0.6441
0.9542 2.1801
1.3291 2.0505
1.0098 2.4530
1.3244 2.8926
0.4545 1.9488
0.5378 1.6989
0.6442 1.4213
1.4679 1.0281
1.0560 2.0182
1.1532 1.7359
1.3013 1.9071
1.3707 1.6758
input_points =
1.0e+003 *
1.7779 0.3249
1.3707 0.5978
1.2735 1.0142
1.5604 0.5978
0.9728 2.1431
1.3198 2.0320
1.0746 2.5271
1.3568 2.8972
0.4499 1.9349
0.5470 1.6804
0.6488 1.4028
1.4818 1.0235
1.0422 1.9950
1.1347 1.7036
1.3059 1.8886
1.3800 1.5833
Anyone knows why it's giving me the error? It only gives me the
error when I try to fit a 4th Order Polynomial. 2nd and 3rd Order
are fine. Interchanging the input-base points have no effect.
I'd be really greatful if someone could point out what is wrong, or
if someone from mathworks could tell me if the script is buggy and
needs an update.
Thanks,
Jakkris