Getting the transforms from a homography?

Hi all,

How can I gain the individual transformations that the homography node is outputting?

I can get the explicit matrix using the getMatrix node but is there a way of getting the rotation/scale/translate out?


just found the Decompose node. This seems to do what I need. Great stuff


hello, unfortunately is the perspective transform of the homography node one of the special cases where the decompose module doesn’t work correctly…

for what do you need the transforms, maybe there is a workaround?

Decompose vs Homography.v4p (16.2 kB)

hmmm…i see the problem.

i use vvvv to map a grid to my projector screen using the homography node. vvvv then sends tracking data to a full screen flash player. I then need to transform the full screen flash movieclip to the same screen and thought if I can get the decomposed transforms I could use them in flash.

I can’t use the flash renderer to a GDI texture because of the latency involved.

ah ok, but just send the matrix over, flash should be able to handle 4x4 matrices…!?

I hadn’t though of that. Great idea and so simple. It turns out flash does have a Matrix3D function which is 4x4 so it may work. I will give it a go when i get back to the studio. :)

ok. sort of got it working apart from issues with flash perspectiveProjection settings but more the issue I have got major problems understanding the conversion of values 4 and 8 (slice 3 and 7) in the 16 values from GetMatrix. They seem to make a massive difference to my movieclip in flash. I have to divide them by 10,000 to get a value that makes an approximately correct homography in flash. I’ve research and researched but I still can’t really tell what these values do. I know what they do to the transformation visually and I guessing they are a perspective transform, but why would flash need values like 0.00000523 to make such differences? I can’t find anybody using these values in matrix3D in flash. Everyone just says best set to 0. I’m making some posts on some flash forums regarding this too.

Any thoughts tonfilm?


these values alter the w component of a xyzw-vector, so if you divide the vector by its w component after the transformation, the w component gets 1 again and the vector is back in our space.

hope this helps… does it?

so we get w component to 1 again, but it started at 0. How does it help it being at 1? If all the w components are 1 my homography is horribly distorted. I sure this isn’t what you mean.

before the transform the w should be 1 too, if they are 0, just set them to 1…

I’ve attached an example of what I think you mean but it doesn’t do what I need it to do. Could you take a look please, it may be easier. Thanks.

adjustMatrix.v4p (25.5 kB)

I’ve attached a slightly tidier version of the patch

adjustMatrix.v4p (25.5 kB)

no I haven’t. same version. hang on

…and finally…

adjustMatrix2.v4p (26.8 kB)

nono, the vectors in flash must be divided by w. but maybe there is a matrix function in flash that does this already…

like this:

adjustVector.v4p (14.1 kB)

thanks for your help on this ton. Its hard work for my head and i’ve got to concentrate on a big project that end with a live performance next friday so I’m going to leave this for a couple of weeks and revisit.

If any one else wants to get stuck in I’m happy to supply the source (flash and vvvv) for communicating transformations from vvvv to flash in real-time. It quite cool really.