当前位置: 首页 > news >正文

关于矩阵自由度的解释

在计算机视觉应用中,经常碰见矩阵自由度的说法,矩阵自由度同矩阵本身的性质,以及相关线性方程组的解,有着千丝万缕的联系,这里就集中解释下DOF(degree of freedom)的具体含义。

1.矩阵的自由度的定义

There are several different ways to think about degrees of freedom of a matrix.

Consider a m×n matrix. This matrix has mn entries. We can change mn values in this matrix to make mn unique matrices, so it has mn degrees of freedom.

What if we had a square m×m matrix that we knew was upper triangular? Well then, we know that several values in the matrix are 0. There are actually only m+m−1+⋯+2+1 nonzero entries, and so that's the number of the degrees of freedom of the matrix.

What is we had a 2×2 matrix that we knew was a rotation matrix? That puts huge constraints on the possible values in the matrix. Indeed, once one of the values is chosen, then all other values have been decided. There is only one degree of freedom in this matrix. This is easy to see geometrically; a rotation matrix on R2 can only rotate by an angle, which is its degree of freedom.

What if we had "equivalence classes"? What if we knew that all scalings of any matrix were equivalent. How many degrees of freedom do we have left? For any matrix, when the (1,1) element is non-zero, we can divide all elements of the matrix by the first element to make it 1. So if we had two matrices A and B=2A, when we scaled these matrices so that their first elements were 1, we'd see that they were equivalent. And thus, we've eliminated a degree of freedom. This is the case with homographies. So, for a 3×3 homography matrix, there are only 8 degrees of freedom. These degrees of freedom can also be interpreted geometrically.

选自:https://math.stackexchange.com/questions/2771591/degrees-of-freedom-for-a-matrix

简而言之,矩阵的自由度反映了矩阵中每个元素互相约束的状态。

关于homography矩阵,多说两句。它是up to a scale的,就是说 kH ~ H,一般在实现的时候(OpenCV),为了保证这个约束,一般采用两种方式。

以3*3矩阵为例,一种是H33 = 1,或者是 H11*H11 + H12*H12 + H13*H13 + H21*H21 + H22*H22 + H23*H23 + H31*H31 + H32*H32 + H33*H33 = 1

 

又如:以3*3的Rotation Matrix为例,为什么其自由度为3?

In nn dimensions you have 1/2n(n−1) degrees of freedom.

One argument goes like these lines: In nn dimensions a rotation matrix R has n^2 degrees of freedom. Rotations preserve the dot products of vectors. So utv=utRtRv for any vectors u and v and so RtR=I.

That's n^2 equations. But those below the diagonal are the same as those above. So we only have 1/2n(n+1) equations leaving 1/2n(n−1) degrees of freedom.

There's actually one more constraint: rotations need to preserve volume so detR=1.

You can already deduce (detR)2=1 from RtR=I so this extra constraint doesn't reduce the degrees of freedom, it just cuts the space in half. A full proof requires showing that the remaining equations are algebraically independent.

 

2.方程自由度的定义

与矩阵自由度类似的,还有方程自由度的定义。

The degrees of freedom is used when you have more variables than equations and the degrees of freedom is how many more variables you have than equations. So if you have 10 variables and 7 equations you have 3 degrees of freedom. I.e. 3 of the variables can assume whatever value you want and for any given choice of values for these 3 variables the remaining 7 have a specific value for a solution.

I.e. the number of equations + the degree of freedom always gives you how many variables you have.

If the number of equations are more than the number of variables you don't have any freedom and the system of equations are typically not solvable at all.

If you do have degrees of freedom, you typically need to find some additional constraint that can add additional equations. The idea is to have exactly the same number of equations as variables in which case there is one and only one solution. This is under the assumption that the equations are linearly independent. You must first remove all linearly dependent equations before you count the degrees of freedom.

For example: 2x + 3y = 5 and 4x + 6y = 10 are two equations but they are not linearly independent so when you remove one you see that you have only one equation with two variables so you have one equation and one degree of freedom.

 

3. 举例

以张正友的标定为例,在其论文A Flexible New Technique for Camera Calibration中,第2.3节有这么一段话:

These are the two basic constraints on the intrinsic parameters, given one homography. Because a
homography has 8 degrees of freedom and there are 6 extrinsic parameters (3 for rotation and 3 for
translation), we can only obtain 2 constraints on the intrinsic parameters.

可以这么理解:H矩阵有8个自由度,构成它的矩阵有一个R矩阵,有三个自由度,一个T矩阵有三个自由度,那就还剩下A矩阵的两个自由度。但因为A矩阵有四个元素(这里设skew为0),所以必须有两个约束保证其自有度只有两个(4-2=2)

 

转载于:https://www.cnblogs.com/ShaneZhang/p/9713606.html

相关文章:

  • 使用包和测试
  • 2018 noip 考前临死挣扎
  • vue增加按钮到表头单元格的解决方法
  • PostgreSQL 10.1 手册_部分 IV. 客户端接口_第 33 章 libpq - C 库_33.19. 在线程化程序中的行为...
  • facl权限(getfacl/setfacl)
  • Python打包系统简单入门
  • 动画开发
  • 高性能架构-存储高性能-关系型数据库
  • While executing gem bad response Not Found 404
  • mysql重启,重启释放ibtmp1
  • 我是一个线程(修订版) 转
  • 从头编写一个 HTTP 静态资源服务器
  • 简单手撸代码进入SMP2018中文人机对话技术评测任务一前三甲
  • 小程序开发之插件功能的有效实现方法
  • 数据库 Oracle12c (三):安装与启动
  • 【刷算法】从上往下打印二叉树
  • 【跃迁之路】【585天】程序员高效学习方法论探索系列(实验阶段342-2018.09.13)...
  • k8s 面向应用开发者的基础命令
  • Lucene解析 - 基本概念
  • MySQL QA
  • Spring Cloud(3) - 服务治理: Spring Cloud Eureka
  • springboot_database项目介绍
  • 安装python包到指定虚拟环境
  • 记录一下第一次使用npm
  • 简单实现一个textarea自适应高度
  • 将回调地狱按在地上摩擦的Promise
  • 悄悄地说一个bug
  • 使用 QuickBI 搭建酷炫可视化分析
  • 想使用 MongoDB ,你应该了解这8个方面!
  • 一道闭包题引发的思考
  • 正则表达式-基础知识Review
  • ​​​​​​​GitLab 之 GitLab-Runner 安装,配置与问题汇总
  • # 手柄编程_北通阿修罗3动手评:一款兼具功能、操控性的电竞手柄
  • (03)光刻——半导体电路的绘制
  • (6)【Python/机器学习/深度学习】Machine-Learning模型与算法应用—使用Adaboost建模及工作环境下的数据分析整理
  • (DenseNet)Densely Connected Convolutional Networks--Gao Huang
  • (ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY)讲解
  • (仿QQ聊天消息列表加载)wp7 listbox 列表项逐一加载的一种实现方式,以及加入渐显动画...
  • (介绍与使用)物联网NodeMCUESP8266(ESP-12F)连接新版onenet mqtt协议实现上传数据(温湿度)和下发指令(控制LED灯)
  • (免费领源码)python#django#mysql校园校园宿舍管理系统84831-计算机毕业设计项目选题推荐
  • (十一)手动添加用户和文件的特殊权限
  • (四)JPA - JQPL 实现增删改查
  • (四)鸿鹄云架构一服务注册中心
  • (一)基于IDEA的JAVA基础1
  • (转)Sql Server 保留几位小数的两种做法
  • (转载)虚幻引擎3--【UnrealScript教程】章节一:20.location和rotation
  • .[hudsonL@cock.li].mkp勒索病毒数据怎么处理|数据解密恢复
  • .NET 3.0 Framework已经被添加到WindowUpdate
  • .net core控制台应用程序初识
  • .net mvc actionresult 返回字符串_.NET架构师知识普及
  • .net 简单实现MD5
  • .NET 使用 ILRepack 合并多个程序集(替代 ILMerge),避免引入额外的依赖
  • .NET/C# 利用 Walterlv.WeakEvents 高性能地中转一个自定义的弱事件(可让任意 CLR 事件成为弱事件)
  • .NET开源快速、强大、免费的电子表格组件
  • .net快速开发框架源码分享