Quad warping - openCV not required

Hi guys,
I have modified the code theo uploaded in this-thread so that it no longer needs the OpenCV points and matrices.

A test app is available here:

I haven’t figured out how to properly package source/binary examples yet, but if you uncompress the zip file to your examples folder, it *should* all run ok.

The OpenFrameworks side of the code is based entirely on theo’s example.
The OpenCV replacement code is all contained within the matrix.h file.
It uses a combination of symbolic and numerical solutions to map the source quad through a unit square and out to the target quad. This is significantly faster than a straight linear system solver, so it should run faster than the OpenCV-based example, with no loss of quality.


It should be fairly simple to wrap this so it uses ofPoint, etc.

Note that the mapping fails if you bend the points to create a non-convex quad.

Also, the obligatory video, with shamefully poor image quality:


many thxs for this,really useful! :smiley:

thank you. very interesting

is there a easy way to get rid of this heavy perspective transformation?
so it would be just linear? like transforming some textures in photoshop.

thank you

Random numbers, the link doesn’t seems to work.
can you renew it, please.
thank you