RRQR Factorization and Spanning Boxes

The famous QR factorization algorithm can be BLAS-3 optimized. Using the Woodbury matrix identity, we implement a block-based Rank-Revealing QR and point out a connection between pivot selection and object detection.

QR Decomposition

A square matrix A has a factorization

    \[A = QR\]

with orthogonal matrix Q and upper triangular R. A is transformed into R by a successive series of Householder reflectors

    \[H_i \doteq I - 2 v v^T\,,\quad  v = \begin{bmatrix} \|a_i\| \\ 0 \\ \vdots \end{bmatrix} - a_i\]

of columns a_j in M = H_{i-1} H_{i-2} \cdots H_1 A. The i’th step of the factorization algorithm operates on the i’th column of M. After i steps, the first i columns of the resulting H_i M are triangularized.

Fully triangularized matrix

Triangularization can be done in any column order by swapping columns between each step and agglomerating the swaps into a permutation/pivot matrix P

    \[Q^{-1} A P = \prod H_i A P = R \iff QRP^{-1} = A \,.\]

pivot matrix corresponding to

When done in order of greatest column rank, this is called the strong Rank Revealing QR factorization (RRQR). In addition to being more numerically stable, the RRQR provides spectral information of the matrix by virtue of the pivot selection P without additional computation of column norms. Columns may instead be sampled if spatially relevant, or convolved and filtered as the basis of an indicator-transform in the case of object detection.

Pivot Selection for Image Input

If the matrix encodes a grayscale image such as the one above, then the resulting pivot selection indicates a preference for darkest overall columns and triangularizes them first. RRQR of a grayscale image selects pivots corresponding to detected object locations inside the image and generates a spanning box grid which we compare to the objects in the original image. Applying the one-sided RRQR to an image matrix, and again another RRQR to its transpose, objects are detected by filtering the resulting pivots in P, P^T.

RRQR Object Detection with downsampling

dim col A’ = .3 * dim col A

dim col A’ = .2 * dim col A

On a uniform grid of objects, object detection by RRQR remains consistent even for a downsampled matrix

    \[A' = (A^T G)^T\,,\quad \text{Gaussian matrix }G\,.\]

Check out the PDF below for MATLAB code and further discussion,

Powered By EmbedPress

Avatar

By Alexander Wei

BA, MS Mathematics, Tufts University

Leave a comment

Your email address will not be published. Required fields are marked *