필터 지우기
필터 지우기

cp2tform / tformfwd - are points outside controlpoints correctly transformed ?

조회 수: 1 (최근 30일)
Hi,
I am getting erratic results when trying to transform a set of 2D points using cp2tform and tformfwd.
When the points to be transformed are situated outside the perimeter of controlpoints, I sometime get negative coordinates (ok knowing the position of my CP), but sometimes the transformed coordinates seem to default to (0,y) or (0,0).
I thought this was caused by the piecewise linear transformation I'm using (as matlab probably cannot draw triangles beyond CP limits), bu it seems I get the same behavior when using projective or polynomial transformations, and tformfwd or tforminv.
What surprises me the most is that I do not get any error or warning message when these outlier points are being (wrongly) transformed ...
Any ideas ?

채택된 답변

Emmanuel
Emmanuel 2012년 5월 22일
An update about the original question, after more torough tests:
- the problem I got initially was caused by my own code, sorry about that.
- however, If this can help anybody, I discovered that piecewise linear TFORM behaves strangely if control points describe a non-convex polygon, creating triangles with zero area in the output space. These triangles are transformed to a segment that seem to "attract" even points outside the cp polygon. I don't have the skills to test it properly, but this may suggest that piecewise linear transform might be unreliable in some cases, e.g. for processing images with barrel distorsion.

추가 답변 (2개)

Sean de Wolski
Sean de Wolski 2012년 5월 2일
How colinear are your control points? If the points are relatively colinear then the contraints in the perpendicular dimension will not be good.

Emmanuel
Emmanuel 2012년 5월 2일
Thank you Sean,
I have 8 CP describing a rectangle in real coordinates:
X = 0 40 80 0 80 0 40 80 Y = 0 0 0 60 60 120 120 120
Is that too colinear ? should I remove some CP ? These are really all the CP I can have...
Is there a transformation type that would handle points outside this rectangle correctly ?

카테고리

Help CenterFile Exchange에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by