title: Metric rectification using the dual degenerate conic in MATLAB
body: <p>I'm implementing metric rectification of an image with projective distortion in the following manner:</p>
  
  <ul>
  <li>From the original image I'm finding two sets of parallel lines and finding their intersection points (the vanishing points at infinity).</li>
  <li>I'm selecting five non-collinear points on a circle to be fit to a conic, then I'm checking where that conic intersects the line at infinity using the aforementioned points.</li>
  <li>I use those points to find the distorted dual degenerate conic.</li>
  </ul>
  
  <p>Theoretically, since the distorted conic is determined by C*'=HC*H' (C* is the dual degenerate conic, ' is transpose, H is my homography), I should be able to run SVD to determine H. Undistorted, C* is a 3x3 identity matrix with the last element on the diagonal zero. However, if I run SVD I don't get ones in the diagonal matrix. For some matrices I can avoid this by using Cholesky factorization instead (which factors to C*'=HH' which, at least for this, is mostly okay) but this requires a matrix that's positive definite. Is there a way to distribute the scale inside the diagonal matrix returned in SVD equally into the U and V' matrices while keeping them the same? (e.g. U = V).</p>
  
  <p>I'm using MATLAB for this. I'm sure I'm missing something obvious... </p>