Affine transformation that takes a given, known ellipse and maps it to a circle with diameter equal to the major axis.
古いコメントを表示
I am looking for the affine transformation that takes a given, known ellipse and maps it to a circle with diameter equal to the major axis. I plan to use this transformation matrix to map the image's original coordinates to new ones, thereby stretching the ellipse into a circle. Some assistance would be greatly appreciated.
採用された回答
その他の回答 (1 件)
Richard Brown
2012 年 4 月 11 日
Not difficult to do, but a bit fiddly. Exactly how difficult depends on the form of your known ellipse equation. I'm going to assume that your ellipse is in the following parametric form, you may need to adapt from there:
x = x0 + Q * [a * cos(theta); b * sin(theta)]
where x and x0 are 2-vectors, with a > b > 0, and where Q is a rotation matrix:
Q = [cos(alpha), -sin(alpha); sin(alpha) cos(alpha)]
First, change variables to y = Q' * (x - x0). then
y = [a * cos(theta); b * sin(theta)];
Lets say you want to your transformation to produce yp in the shifted, rotated coordinates, and xp in the original coordinates. Then, your change of variables will be as follows:
yp = diag([1, a/b]) * y
= S * y
and hence
xp = Q*yp + x0
= Q*S*Q'*(x - x0) + x0
= Q*S*Q'*x + (eye(2) - Q*S*Q')*x0
which is your required affine transformation. If your ellipse is in a different form, then you'll need to convert to parametric form first.
カテゴリ
ヘルプ センター および File Exchange で Image Arithmetic についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!