Efficient homography mapping

I’m working on a project including video tracking and I’m trying to improve the framerate. I figured out that the bottleneck of my application is the warping of the incoming frames. I’m calling cvWarpPerspectiveQMatrix() once, after calibrating, and then for every frame I’m calling cvWarpPerspective(). I read somewhere on the forum that it would be more efficient to only map the point we’re interested in, which makes sense, but I can’t get it to work. So I already have a 3x3 perspective matrix based on a calibration, but I don’t know how to use that matrix to only undistort the points I’m detecting.

Any help is very much appreciated.


i haven’t done this before, but i think the trick would be doing a cvInvert on the homography followed by cvPerspectiveTransform to project the point(s).

yup, you’re doing a dense perspective transformation, whereas you want a sparse. It is cvPerspectiveTransform as kyle says
I really recommend this book by the way.

Ah thanks guys, I’m quite new to openCV but so far I really like it.

I’ll try to implement the sparse transformation. I have ‘learning opencv’ somewhere on my hard drive so I’ll get there :slight_smile: