Another school work for the holiday...
I've tested with another scene, and it works.
The only note that I'd wish you to check:
RX= always invert the positive to negative value and vice versa.
RY= always positive
SZ (zoom factor) in that case is 1.83 seems to depend not to the camera position but is in raltionship with the lens (or the field of view) used.
TY (or TX) = to use if the camera have an Y or X offset (in my case I have a 5% Y offset so I've manually found -0.045 value , that is about 5/100 infact)
Wow.. not easy.
Would be fantastic to have a script that do in automatic way all this operation. As I said doing architectural rendering you have every day to manage the background image...
Thanks for your help. Ciao.