仿射变换算法 [英] Affine transformation algorithm

查看:492
本文介绍了仿射变换算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道任何标准的算法来确定两个坐标系基于一组已知点的仿射变换矩阵?

Does anyone know of any standard algorithms to determine an affine transformation matrix based upon a set of known points in two co-ordinate systems?

推荐答案

仿射变换以2×3矩阵给出。我们通过用M取我们的二维输入(XY),碰撞它到一个三维矢量(XY 1),然后乘以(左侧)执行仿射变换微米。

Affine transformations are given by 2x3 matrices. We perform an affine transformation M by taking our 2D input (x y), bumping it up to a 3D vector (x y 1), and then multiplying (on the left) by M.

所以,如果我们有三个点(X1 Y1)(X2 Y2)(X3 Y3)映射(U1 V1)(U2 V2)(U3 V3),那么我们有

So if we have three points (x1 y1) (x2 y2) (x3 y3) mapping to (u1 v1) (u2 v2) (u3 v3) then we have

   [x1 x2 x3]   [u1 u2 u3]
M  [y1 y2 y3] = [v1 v2 v3].
   [ 1  1  1]

您可以得到m简通过的反

You can get M simply by multiplying on the right by the inverse of

[x1 x2 x3]
[y1 y2 y3]
[ 1  1  1].

2×3的矩阵相乘由一个3x3矩阵的权利给了我们,我们要的2×3。 (你实际上并不需要完整的倒数,但如果矩阵求逆可用它很容易使用。)

A 2x3 matrix multiplied on the right by a 3x3 matrix gives us the 2x3 we want. (You don't actually need the full inverse, but if matrix inverse is available it's easy to use.)

容易地适应其它尺寸。如果你有超过3点,你可能想最小二乘最佳拟合。你不必再问对于这一点,但它是一个有点困难。

Easily adapted to other dimensions. If you have more than 3 points you may want a least squares best fit. You'll have to ask again for that, but it's a little harder.

这篇关于仿射变换算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆