public void apply ( DMatrixRMaj H , DMatrixRMaj output ) { output . reshape ( 3 , H . numCols ) ; int stride = H . numCols ; for ( int col = 0 ; col < H . numCols ; col ++ ) { // This column in H double h1 = H . data [ col ] , h2 = H . data [ col + stride ] , h3 = H . data [ col + 2 * stride ] ; output . data [ col ] = h1 / stdX - meanX * h3 / stdX ; output . data [ col + stride ] = h2 / stdY - meanY * h3 / stdY ; output . data [ col + 2 * stride ] = h3 ; } }
Applies normalization to a H = 3xN matrix