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 m
Read the following
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:
As a consequence, the rank of M equals the number of non-zero singular value
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.