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 has a factorization
with orthogonal matrix and upper triangular . A is transformed into R by a successive series of Householder reflectors
of columns in . The i’th step of the factorization algorithm operates on the i’th column of . After steps, the first
Triangularization can be done in any column order by swapping columns between each step and agglomerating the swaps into a permutation/pivot matrix
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
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
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
Check out the PDF below for MATLAB code and further discussion,