What does it mean for a matrix to have degrees of freedom? How does the degrees of freedom relate to constraints on what those values could be in the context of an optimization problem? I'm specifically confused about the last paragraph in this screenshot, but a more general explanation would be much appreciated.
1 Answers
There are several different ways to think about degrees of freedom of a matrix.
Consider a $m\times 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\times 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 + \cdots + 2 + 1$ nonzero entries, and so that's the number of the degrees of freedom of the matrix.
What is we had a $2\times 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 $\mathbb{R}^2$ 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=2 A$, 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\times 3$ homography matrix, there are only 8 degrees of freedom. These degrees of freedom can also be interpreted geometrically.
- 6,951
-
Thanks. So, what's the point of having a $1$ in the bottom right corner of a homography? I've seen this in affine transforms as well. I always thought of that element as a "scratchpad" which reflected how much the matrix has been scaled by so if someone wanted to recover the equivalent matrix they can just scale the entire matrix such that the bottom right becomes $1$ again – Carpetfizz May 08 '18 at 03:53
-
2@Carpetfizz Since one conventionally “normalizes” homogenous coordinates by arranging for the last coordinate value to be $1$, homogeneous matrices are also “normalized” in this way. It’s particularly convenient for affine transformations because it keeps the final $1$ in the homogeneous coordinate vector of a point unchanged. – amd May 08 '18 at 05:50
-
Do you mind explaining what it means to normalize a matrix and why we do it? – Carpetfizz May 08 '18 at 06:05
-
@Carpetfizz To normalize a matrix in the context that amd describes is just to make the last coordinate value to be 1. This makes it easy for a human to realize if two homographies are the same when looking at the numbers in the matrix. If the homographies haven't been normailzed, we have to divide to see the scaling. But if they have been normalized, we just have to see if the elements of the two homographies are the same. – NicNic8 May 08 '18 at 18:02
-
@NicNic8 so is my interpretation of it being just a bookkeeping tool accurate? – Carpetfizz May 08 '18 at 19:27
-
1@Carpetfizz I'm not sure what you mean by a "bookkeeping" tool. It's just a way of making a comparison between homographies easy. If you correctly write code that accepts a homography, and you pass in two homographies that are off by a scalar, then the code should output equivalent values. – NicNic8 May 08 '18 at 21:11
-
Thanks again. When would you ever scale a homogrpahy? – Carpetfizz May 08 '18 at 21:14
-
3@Carpetfizz When working with Projective Geometry, we use homogeneous coordinates. Homogeneous coordinates can be scaled by each other and still represent the same coordinate. If you use scaled homogeneous coordinates, you might get scaled versions of the homographies out. – NicNic8 May 08 '18 at 22:59
