You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过SVD求解旋转矩阵?U、V含义及公式原理答疑

Using SVD to Compute Rotation Matrices: Breaking Down U, V, and the Formula

Great question—let’s unpack this clearly, since SVD-based rigid registration can feel abstract until you connect the pieces.

First, let’s set the stage properly:
We’re working with two sets of corresponding points (e.g., 3D points from a scan and a model):

  • Let A be the source point set (n points, each a 3D vector)
  • Let B be the target point set (n corresponding points)

Before applying SVD, we must center both point sets by subtracting their respective centroids:

  • A' = A - mean(A) (each point in A minus the average of all points in A)
  • B' = B - mean(B)

This step is critical because rotation acts around a center point; centering removes translation, so we can focus solely on rotation.


Step 1: The Covariance Matrix H

First, we construct a 3x3 covariance matrix H that captures the relationship between the centered point sets:

H = B' * A'^T

Here, A'^T is the transpose of A'. Intuitively, H measures how the points in A' relate to the points in B'—it encodes the "directional overlap" between the two sets.


Step 2: What Are U and V in SVD?

We perform Singular Value Decomposition (SVD) on H, which gives us:

H = U * Σ * V^T

Let’s break down each component:

  • U: A 3x3 orthogonal matrix (its columns are mutually perpendicular, and U^T = U^{-1}). The columns of U are the principal component directions of the centered target set B'. In other words, U captures the main axes along which B' is distributed.
  • V: Another 3x3 orthogonal matrix. The columns of V are the principal component directions of the centered source set A'. It captures the main axes of A''s distribution.
  • Σ: A diagonal matrix with non-negative "singular values" on its diagonal, ordered from largest to smallest. These values measure the strength of the correlation between the corresponding principal components of A' and B'.

Think of U and V as coordinate systems that align with the "shape" of each point set. SVD essentially decomposes the relationship between A' and B' into these two coordinate systems plus a scaling factor (Σ).


Step 3: Why R = U^T * V Gives the Rotation Matrix?

Our goal is to find an orthogonal matrix R (rotation matrices are orthogonal with determinant = 1) such that B' ≈ R * A'—meaning we want to rotate A' to best match B' in a least-squares sense.

Here’s why U^T * V works:

  1. Orthogonality Preservation: Since U and V are orthogonal matrices, their transposes and products are also orthogonal. U^T is orthogonal, so U^T * V is orthogonal (the product of two orthogonal matrices is orthogonal). This guarantees R has the right structure for a rotation/reflection.
  2. Aligning Principal Components:
    • V^T rotates the source set A' so its principal components align with the standard coordinate axes.
    • U rotates the standard coordinate axes to align with the target set B''s principal components.
    • Combining these, U^T * V directly maps the principal components of A' to those of B'—exactly the rotation needed to align the two point sets.

One Edge Case to Watch For

Occasionally, det(U^T * V) might equal -1 instead of 1. This means the matrix represents a reflection (a flip plus rotation) rather than a pure rotation. To fix this, multiply the last column of V by -1 before computing R:

if det(U^T * V) == -1:
    V[:, 2] *= -1
R = U^T * V

This ensures det(R) = 1, giving us a valid pure rotation matrix.


Quick Example to Solidify

Suppose we have a 2D source set A' = [(1, 0), (2, 0)] (aligned along the x-axis) and target set B' = [(0, 1), (0, 2)] (aligned along the y-axis). The covariance matrix H = B' * A'^T is:

H = [[0*1 + 0*2, 0*0 + 0*0],
     [1*1 + 2*2, 1*0 + 2*0]] = [[0, 0], [5, 0]]

SVD of H gives U = [[0, 1], [1, 0]], Σ = [[5, 0], [0, 0]], V = [[1, 0], [0, 1]]. Then R = U^T * V = [[0, 1], [1, 0]]^T * [[1,0],[0,1]] = [[0, 1], [1, 0]]—which is exactly the 90-degree rotation matrix needed to turn A' into B'.

内容的提问来源于stack exchange,提问作者vignesh viki

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.07 21:22:34