# 结构张量

结构张量是图像处理中使用的一种矩阵，它概括某点指定邻域内的主要梯度方向，以及这些方向的相干程度<sup>[1](https://pmc.ncbi.nlm.nih.gov/articles/PMC9078703/)</sup>。该张量通过计算图像梯度与自身的外积并在局部窗口上平均而成，因此不仅记录梯度强度，也记录邻近梯度共享同一取向的程度。<sup>[2](https://apps.fz-juelich.de/juspice/image_processing/feature_extraction/structure_tensor_coherence.html)</sup> 其特征值和特征向量提供局部取向、置信度度量和幅值，这使它成为边缘与角点检测、光流估计以及纹理和纤维结构取向分析的标准工具<sup>[3](https://www.mia.uni-saarland.de/Publications/brox-pp113.pdf)</sup><sup> • </sup><sup>[4](https://www.bmva-archive.org.uk/bmvc/1988/avc-88-023.html)</sup>。

| 关键事实 | 细节 |
|---|---|
| 定义 | \( \mathbf{J} = \langle \nabla f\, \nabla f^{\top} \rangle_w \)，即图像梯度与自身外积的加权局部平均；一个对称半正定矩阵<sup>[5](https://biomedical-imaging-group.github.io/OrientationJ/theory/)</sup> |
| 特征结构 | 最大特征值对应的特征向量给出最大梯度能量的方向；最小特征值对应的特征向量给出局部结构的主取向，因为梯度垂直于边缘和纤维<sup>[5](https://biomedical-imaging-group.github.io/OrientationJ/theory/)</sup><sup> • </sup><sup>[3](https://www.mia.uni-saarland.de/Publications/brox-pp113.pdf)</sup> |
| 相干性 | \( C = (\lambda_1 - \lambda_2)/(\lambda_1 + \lambda_2) \in [0,1] \)；在单一取向占主导处接近 1，在邻域各向同性处接近 0<sup>[5](https://biomedical-imaging-group.github.io/OrientationJ/theory/)</sup><sup> • </sup><sup>[2](https://apps.fz-juelich.de/juspice/image_processing/feature_extraction/structure_tensor_coherence.html)</sup> |
| 能量 | \( E = \operatorname{tr}(\mathbf{J}) = \lambda_1 + \lambda_2 \)，窗口内的总梯度能量；在平坦区域为零，并与图像对比度的平方成正比<sup>[5](https://biomedical-imaging-group.github.io/OrientationJ/theory/)</sup> |
| 尺度参数 | 以积分尺度 \( \rho \) 进行高斯（Gaussian）平滑，可设定邻域大小、去除噪声，并把取向信息传播到小的无结构区域<sup>[3](https://www.mia.uni-saarland.de/Publications/brox-pp113.pdf)</sup> |
| 光流用途 | 对结构张量进行特征值分析，相当于用局部常值位移向量场对强度数据做总体最小二乘拟合<sup>[6](https://www.researchgate.net/publication/2374096_Accurate_Optical_Flow_in_Noisy_Image_Sequences)</sup> |
| 关键文献 | 约瑟夫·比金（Josef Bigün）与约斯塔·格兰隆德（Gösta Granlund）（1987）关于最优取向检测；克里斯·哈里斯（Chris Harris）与迈克·斯蒂芬斯（Mike Stephens）（1988）的组合式角点与边缘检测器；布鲁斯·卢卡斯（Bruce Lucas）与金出武雄（Takeo Kanade）（1981）的光流方法<sup>[4](https://www.bmva-archive.org.uk/bmvc/1988/avc-88-023.html)</sup><sup> • </sup><sup>[7](https://idl.uw.edu/living-papers-paper/lucas-kanade/)</sup> |

## 定义与构造

对于图像 \( f \)，梯度结构张量是在感兴趣区域上以加权内积定义的，其中权重函数 \( w(x,y) \geq 0 \) 通常是归一化方形窗口，或标准差为 \( \sigma_w \) 的高斯窗口<sup>[5](https://biomedical-imaging-group.github.io/OrientationJ/theory/)</sup>。在二维情形下，该张量是 \( 2 \times 2 \) 矩阵

\[ \mathbf{J} = \begin{bmatrix} \langle f_x, f_x \rangle_w & \langle f_x, f_y \rangle_w \\ \langle f_x, f_y \rangle_w & \langle f_y, f_y \rangle_w \end{bmatrix}, \]

其中 \( f_x \) 和 \( f_y \) 是图像的偏导数。由于它来自对对称半正定矩阵的平均，结构张量本身也是对称半正定的<sup>[3](https://www.mia.uni-saarland.de/Publications/brox-pp113.pdf)</sup>。同样的构造可推广到彩色图像等向量值数据：先对各分量梯度的外积求和，再进行平滑<sup>[3](https://www.mia.uni-saarland.de/Publications/brox-pp113.pdf)</sup>。

**梯度的选择很重要。** 在组装任何张量之前，必须先对图像求导，而导数算子的选取是个重要问题，并非无关紧要的细节。常见选项包括有限差分、三次样条插值的精确导数、在傅里叶域（Fourier domain）中乘以 \( i\omega \)、[里斯变换](https://www.edgepedia.org/zh/riesz-transform)（Riesz transform），以及与高斯导数卷积<sup>[8](https://biomedical-imaging-group.github.io/OrientationJ/assessment/compare-gradients/)</sup>。在具有已知取向的测试图像上，有限差分梯度在精细结构上最先退化，且退化最严重，误差比其他方法高一到两个数量级，而带限导数和三次样条则能把精度保持到采样极限<sup>[8](https://biomedical-imaging-group.github.io/OrientationJ/assessment/compare-gradients/)</sup>。

## 特征值分析

主轴变换 \( \mathbf{J}_\rho = \mathbf{S}^{\top} \boldsymbol{\Lambda} \mathbf{S} \) 将张量对角化；与最小特征值相关联的特征向量决定局部结构的主取向，而迹 \( \operatorname{tr} \mathbf{J}_\rho \) 决定其幅值<sup>[3](https://www.mia.uni-saarland.de/Publications/brox-pp113.pdf)</sup>。在二维中，相干性常用张量的条件数——最大特征值除以最小特征值——或用量度 \( (\lambda_1 - \lambda_2)^2 \) 表示<sup>[3](https://www.mia.uni-saarland.de/Publications/brox-pp113.pdf)</sup>。

特征值将图像结构区分为几种可识别情形。均匀区域产生小幅值。边缘产生大幅值和大的相干性，而角点产生大幅值但小的相干性<sup>[3](https://www.mia.uni-saarland.de/Publications/brox-pp113.pdf)</sup>。在用于图像序列的三维张量中，会出现四种情形：所有特征值都接近零，意味着没有结构，也无法估计运动；只有最小特征值接近零，表示角点状或点状结构，可恢复完整位移向量；两个特征值接近零，是众所周知的孔径问题，此时只能估计垂直于强度结构的流动；三个特征值都显著非零，意味着没有相干运动，运动不连续处就是如此<sup>[6](https://www.researchgate.net/publication/2374096_Accurate_Optical_Flow_in_Noisy_Image_Sequences)</sup>。

## 历史

取向估计的张量方法源于约瑟夫·比金与约斯塔·格兰隆德的工作：他们1987年关于线性对称的最优取向检测的论文为结构张量技术奠定了基础，1991年的论文则表明，取向检测对应于对n维结构的[傅里叶变换](https://www.edgepedia.org/zh/fourier-transform)拟合一条轴或一个平面，从而产生稳健的纹理特征和光流算法<sup>[6](https://www.researchgate.net/publication/2374096_Accurate_Optical_Flow_in_Noisy_Image_Sequences)</sup>。在运动估计中，该矩阵出现在卢卡斯—金出方法（Lucas–Kanade method）中；该方法由[布鲁斯·卢卡斯](https://www.edgepedia.org/zh/bruce-lucas)与金出武雄在1981年关于迭代图像配准的论文中提出，它在邻域上最小化光流约束方程；该目标中的梯度外积之和就是图像梯度的结构张量<sup>[7](https://idl.uw.edu/living-papers-paper/lucas-kanade/)</sup><sup> • </sup><sup>[9](https://repositorio.ufmg.br/server/api/core/bitstreams/0ad5a081-5772-49e9-b873-930babe808c1/content)</sup>。克里斯·哈里斯与迈克·斯蒂芬斯1988年在阿尔维视觉会议（Alvey Vision Conference）上发表的论文《一种组合式角点与边缘检测器》（A Combined Corner and Edge Detector），第23.1—23.6页，将角点检测器建立在该矩阵之上<sup>[4](https://www.bmva-archive.org.uk/bmvc/1988/avc-88-023.html)</sup>。

## 平滑与尺度

**积分尺度。** 原始外积 \( \nabla f \nabla f^{\top} \) 含有噪声，因此用高斯 \( G_\rho \) 对张量进行平滑，得到 \( \mathbf{J}_\rho = G_\rho * (\nabla f \nabla f^{\top}) \)<sup>[6](https://www.researchgate.net/publication/2374096_Accurate_Optical_Flow_in_Noisy_Image_Sequences)</sup>。这种平滑改善了取向信息对噪声的稳健性，并创建了一个尺度空间：参数 \( \rho \) 决定结构分析所考虑的邻域大小<sup>[3](https://www.mia.uni-saarland.de/Publications/brox-pp113.pdf)</sup>。较大的 \( \sigma \) 会产生更平滑的张量场和更不局部的取向估计，但噪声稳健性更好<sup>[10](https://www.researchgate.net/publication/280388448_Texture_Synthesis_Using_the_Structure_Tensor)</sup>。平滑还产生填充效应，把取向信息从有结构区域传播到小的无结构区域<sup>[3](https://www.mia.uni-saarland.de/Publications/brox-pp113.pdf)</sup>。

## 应用

**光流。** 基于结构张量的方法可从图像序列中定量估计光流场，而张量的特征值分析同时也可视为局部运动的秩分析。后来的工作将三维结构张量与参数化流动模型结合，把估计转化为广义特征值问题，并使用由广义特征值导出的置信度度量来自适应调整相干运动区域<sup>[11](https://www.researchgate.net/publication/5613820_Accurate_Dense_Optical_Flow_Estimation_Using_Adaptive_Structure_Tensors_and_a_Parametric_Model)</sup>。张量驱动的各向异性扩散沿张量指示的方向进行平滑，已被用于在强噪声下稳定流动估计<sup>[6](https://www.researchgate.net/publication/2374096_Accurate_Optical_Flow_in_Noisy_Image_Sequences)</sup>。

**生物医学取向分析。** 许多科学图像由纤维、细丝、裂纹和年轮等细长结构组成，结构张量可在图像各处量化其方向<sup>[12](https://biomedical-imaging-group.github.io/OrientationJ/)</sup>。在胶原成像中，结构张量方法给出的主方向结果与[傅里叶分析](https://www.edgepedia.org/zh/fourier-analysis)相当且一致，同时还能提供相干性值，而没有Directionality插件（Directionality plugin）的高斯拟合缺点；相干性从随机取向的0到完全对齐特征的1不等<sup>[1](https://pmc.ncbi.nlm.nih.gov/articles/PMC9078703/)</sup><sup> • </sup><sup>[13](https://pmc.ncbi.nlm.nih.gov/articles/PMC8654057/)</sup>。在神经科学中，结构张量分析可估计脑组织显微图像中轴突的取向，以便与扩散磁共振成像（diffusion MRI）的取向估计进行比较，并已用于离体大鼠脑的序列光学相干扫描仪图像，以构建二维和三维的定量纤维取向图<sup>[14](https://pmc.ncbi.nlm.nih.gov/articles/PMC12903131/)</sup><sup> • </sup><sup>[15](https://www.spiedigitallibrary.org/journals/journal-of-biomedical-optics/volume-20/issue-3/036003/Structure-tensor-analysis-of-serial-optical-coherence-scanner-images-for/10.1117/1.JBO.20.3.036003.pdf)</sup>。一项2025年的验证研究考察了滤波器参数和图像各向异性（其性质随方向而异）如何影响模拟体模中这些取向估计的准确性<sup>[14](https://pmc.ncbi.nlm.nih.gov/articles/PMC12903131/)</sup>。

**软件。** OrientationJ是一系列用于ImageJ和Fiji的开源Java插件，它在每个像素的局部窗口上计算梯度结构张量，并报告取向、相干性、能量和各向异性；已有300多项已发表研究使用它，从肌动蛋白细胞骨架到纳米纤维和骨<sup>[12](https://biomedical-imaging-group.github.io/OrientationJ/)</sup>。其Python后继OrientationPy将同一张量扩展到三维体数据<sup>[12](https://biomedical-imaging-group.github.io/OrientationJ/)</sup>，而scikit-image以`feature.structure_tensor`提供相同的张量公式<sup>[16](https://biomedical-imaging-group.github.io/OrientationJ/assessment/benchmarking/)</sup>。

## 加权行为与变体

结构张量与相关估计器的区别在于它如何对像素加权。向列张量 \( Q = \langle \mathbf{n}\,\mathbf{n}^{\top} \rangle \) 给每个像素权重1，而结构张量 \( \mathbf{J} = \langle \lVert \mathbf{g} \rVert^2 \mathbf{n}\,\mathbf{n}^{\top} \rangle \) 按每个像素的梯度能量加权<sup>[17](https://biomedical-imaging-group.github.io/OrientationJ/assessment/structure-nematic/)</sup>。这种能量加权会压制平坦或饱和像素，因为这些像素唯一的梯度是虚假的；在同样情形下，向列张量会向虚假取向偏置，且这种偏置无法通过任何窗口大小消除；在一幅中等退化水平的测试图像上，结构张量的平均绝对误差保持在0.64度，而向列张量为8.68度<sup>[17](https://biomedical-imaging-group.github.io/OrientationJ/assessment/structure-nematic/)</sup>。同样的加权也使结构张量容易受到散斑等强脉冲的影响：少数高能量噪声像素可能使相干性崩溃，而单位权重的向列张量会忽略这种情况<sup>[17](https://biomedical-imaging-group.github.io/OrientationJ/assessment/structure-nematic/)</sup>。

替代方案和改进仍在不断出现。最近一项提议使用梯度能量张量作为结构张量的替代，用于角点检测、光流和图像增强<sup>[18](https://arxiv.org/abs/2608.22314)</sup>；一种以特征为中心的结构张量尺度空间用环形滤波步骤取代高斯积分，该步骤将导数滤波器响应从特征边缘移到其中心，从而在二维和三维中减少对用户选择参数的依赖<sup>[19](https://ieeeaccess.ieee.org/featured-article/feature-centered-first-order-structure-tensor-scale-space-in-2d-and-3d/)</sup>。

## 与扩散张量的关系

张量一词也出现在扩散磁共振成像中，其中扩散张量成像（diffusion tensor imaging）对组织中水扩散的方向性限制建模；该张量各向异性的贡献因素包括细胞膜、轴突和髓鞘，而脑白质中的扩散沿轴突方向比垂直于轴突方向受到的限制更小<sup>[20](https://doi.org/10.1016/j.compbiomed.2010.10.008)</sup>。该扩散张量是从磁共振测量中估计的物理量，不同于图像梯度的结构张量，不过二者在应用中相遇，例如用扩散磁共振成像估计来验证显微图像导出的轴突取向<sup>[14](https://pmc.ncbi.nlm.nih.gov/articles/PMC12903131/)</sup>。

## References

1. [Coherency image analysis to quantify collagen architecture: implications in scar assessment, PMC](https://pmc.ncbi.nlm.nih.gov/articles/PMC9078703/)
2. [Structure Tensor Coherence, JuSPICE Documentation, Forschungszentrum Jülich](https://apps.fz-juelich.de/juspice/image_processing/feature_extraction/structure_tensor_coherence.html)
3. [Brox, Weickert et al., structure tensor publications, Universität des Saarlandes](https://www.mia.uni-saarland.de/Publications/brox-pp113.pdf)
4. [Harris, C. and Stephens, M. (1988). A Combined Corner and Edge Detector, Proceedings of the Alvey Vision Conference](https://www.bmva-archive.org.uk/bmvc/1988/avc-88-023.html)
5. [Theory, OrientationJ documentation, EPFL Biomedical Imaging Group](https://biomedical-imaging-group.github.io/OrientationJ/theory/)
6. [Accurate Optical Flow in Noisy Image Sequences, ResearchGate](https://www.researchgate.net/publication/2374096_Accurate_Optical_Flow_in_Noisy_Image_Sequences)
7. [Lucas, B. and Kanade, T. (1981). An Iterative Image Registration Technique with an Application to Stereo Vision](https://idl.uw.edu/living-papers-paper/lucas-kanade/)
8. [Compare gradients, OrientationJ documentation](https://biomedical-imaging-group.github.io/OrientationJ/assessment/compare-gradients/)
9. [FASTENSOR: A Tensor Framework, Universidade Federal de Minas Gerais repository](https://repositorio.ufmg.br/server/api/core/bitstreams/0ad5a081-5772-49e9-b873-930babe808c1/content)
10. [Texture Synthesis Using the Structure Tensor, ResearchGate](https://www.researchgate.net/publication/280388448_Texture_Synthesis_Using_the_Structure_Tensor)
11. [Accurate Dense Optical Flow Estimation Using Adaptive Structure Tensors and a Parametric Model, ResearchGate](https://www.researchgate.net/publication/5613820_Accurate_Dense_Optical_Flow_Estimation_Using_Adaptive_Structure_Tensors_and_a_Parametric_Model)
12. [OrientationJ, EPFL Biomedical Imaging Group](https://biomedical-imaging-group.github.io/OrientationJ/)
13. [A workflow for rapid unbiased quantification of fibrillar feature alignment in biological images, PMC](https://pmc.ncbi.nlm.nih.gov/articles/PMC8654057/)
14. [Validation of structure tensor analysis for orientation estimation in brain tissue microscopy, PMC](https://pmc.ncbi.nlm.nih.gov/articles/PMC12903131/)
15. [Structure tensor analysis of serial optical coherence scanner images, Journal of Biomedical Optics 20(3), 036003](https://www.spiedigitallibrary.org/journals/journal-of-biomedical-optics/volume-20/issue-3/036003/Structure-tensor-analysis-of-serial-optical-coherence-scanner-images-for/10.1117/1.JBO.20.3.036003.pdf)
16. [Benchmarking, OrientationJ documentation](https://biomedical-imaging-group.github.io/OrientationJ/assessment/benchmarking/)
17. [Structure tensor vs nematic tensor, OrientationJ documentation](https://biomedical-imaging-group.github.io/OrientationJ/assessment/structure-nematic/)
18. [On the Choice of Tensor Estimation for Corner Detection, Optical Flow and Denoising, arXiv](https://arxiv.org/abs/2608.22314)
19. [Feature-Centered First Order Structure Tensor Scale-Space in 2D and 3D, IEEE Access](https://ieeeaccess.ieee.org/featured-article/feature-centered-first-order-structure-tensor-scale-space-in-2d-and-3d/)
20. [Hasan et al. (2011). A review of diffusion tensor magnetic resonance imaging computational methods and software tools, Computers in Biology and Medicine](https://doi.org/10.1016/j.compbiomed.2010.10.008)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Language and vision AI › Computer vision › Vision methods and geometry › Motion analysis and optical flow

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/structure-tensor

English original: https://www.edgepedia.org/structure-tensor
