Hi Henrik,
Yes I do have access to mathematica and I have been using that for my matrix operations. The transformation matrix does seem close, but this approach relies on a reference. And, I only get the reference after I correct the image. Once it's corrected, I don't need this operation.
With that said it is still good information for future.
At this point, I have determined the set of operations that are needed to orthogonalize the image and how to scale them appropriately. I am now trying to figure out how to translate these steps so that they work at an arbitrary initial image angle. Meaning that the original image is captured at say 30 degrees and then rotated to zero so I can perform the operation. I basically need to 'undo' the original rotation so that the operations I have just performed are relevant to the arbitrary rotation angle.
I thought that this would be a change of basis by an arbitrary rotation angle, but that doesn't seem to give me the desired results, so here I am.
Thanks
mrphud