opencv计算矩阵等级 [英] opencv calculate matrix rank

查看:124
本文介绍了opencv计算矩阵等级的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试查找矩阵的等级.在matlab中,这很简单,但是我正在使用Visual Studio 2008(c ++).我最近安装了openCV,到目前为止,它可以用于我的大多数矩阵算法,但是我无法弄清楚如何使用openCV来获得矩阵的排名.在我的在线研究中,我发现cvSVD显然可以给我排名 http://www.emgu .com/wiki/files/1.3.0.0/html/55d6f4d2-223d-8c55-2770-2b6a9c6eefa2.htm

I am trying to find rank of a matrix. In matlab this is fairly straight-forward but I am using visual studio 2008 (c++). I recently installed openCV and it works for most of my matrix arithmetic so far except I can't figure out how to use openCV to get rank of a matrix. In my research online I found that apparently cvSVD can give me rank http://www.emgu.com/wiki/files/1.3.0.0/html/55d6f4d2-223d-8c55-2770-2b6a9c6eefa2.htm

但是我不知道cvSVD将如何返回此特定属性.关于从openCV获取矩阵排名的任何想法?

But I have no idea how cvSVD will return this particular property. Any ideas on getting matrix rank from openCV???

谢谢.

推荐答案

阅读以下内容

http://en.wikipedia.org/wiki/Singular_value_decomposition#Applications_of_the_SVD

范围,空空间和等级部分中,它说明了如何从奇异值中获得等级.引用此页面:

in the section Range, null space and rank it explains how to get the Rank from the singular values. Quoting this page:

因此,M的秩等于非零单数 值

As a consequence, the rank of M equals the number of non-zero singular value

因此,基本上,您可以计算非零奇异值的数量,即秩.根据您在问题中提供的链接,opencv中的SVD计算函数应返回奇异值的矩阵或向量-如果它是矩阵,则奇异值位于该矩阵的主对角线上.从这里,你应该没事.可能有一种更简单的方法,但是我对opencv不熟悉.

So basically you can count the number of non-zero singular values and that is the rank. According to the link you provide in the question, your SVD calculation function in opencv should return you a matrix or vector of singular values - if it is a matrix, the singular values lie on the main diagonal of this matrix. From here you should be ok. There may be a simpler way, but I am not familiar with opencv.

这篇关于opencv计算矩阵等级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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