Is there documentation on "fold-over triangles" in the Image Processing Toolbox?

3 views (last 30 days)
I want to use CP2TFORM command to create a transformation matrix between the input image and base image using the 'piecewise linear' transformation.
However, when I execute:
TFORM = cp2tform(input_points, base_points,'piecewise linear');
I receive the following error:
??? Error using ==> cp2tform>findPiecewiseLinear at 626
Eliminated xxx control point pair(s).
Fold-over triangles remain. See CP2TFORM reference page.
Error in ==> cp2tform at 159
[trans, output] = feval(findT_fcn,uv,xy,options);
Is there documentation on what does "fold-over triangles" mean?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This enhancement has been incorporated in Release 2008b (R2008b). For previous product releases, read below for any possible workarounds:
The attached image demonstrates the source of this error. This image shows control points chosen with the CPSELECT function in such a way as to cause this error when the points are exported and used with CP2TFORM. On the image, input window is the window on the left side while the base window is the window on the right side.
Point # 1 has been incorrectly mapped in the base window. During the transformation, if triangles are being formed between points 1-2-4 and 2-4-5 in the input window, the triangles between the same points would be overlapping in the base window. This is the "fold-over" (triangles folding onto each other when the transformation occurs). This, in turn, will cause the command CP2TFORM to result in an error.
One potential source of this problem is if the points are located correctly, but corresponding points between the images do not have the same indices (i.e. one image has its indices mixed-up with respect to the other). This can be prevented by correctly matching the corresponding control points between the input image and the base image.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!