1 | initial version |
Other than Martin's suggestion, take a look at the warpPerspective function. It mainly consists of two parts. The first part calculates a (or 2 depending on the interpolation method) mapping matrix using the homography and then in the second part it will do a remap of the image using the mapping matrix. If the homography hasn't changed, you only need to calculate the mapping matrix only once. So dig up the code, break it into two parts. I can guarantee it will be super fast.