Search code examples
performanceopencvmatrix-multiplicationperspectivehomography

Why do different homographies affect running time?


I am applying OpenCV's warpPerspective() function to an image and I'm timing this task (only the call to the function, nothing else). I noticed that if I use different homographies the running time changes.

For example I tried using the identity matrix and found that it is faster than another homography that I generated with OpenCV's findHomography(), specifically this one:

[ -4.2374501377308356e+00, -4.1373817174321941e+00, 1.6044389922446646e+03,
  -1.6805996938549963e+00, -9.0838245171456080e+00, 1.9901208871396577e+03,
  -2.4454046226610403e-03, -8.2658343249518724e-03, 1.                     ]

Please note that the output is not my concern, I am only talking about running time. So why is it different?

Thanks

EDIT: I'm using OpenCV 3.4 on a PowerVR GX6650. I tested it with and without OpenCL and the pattern is still the same.


Solution

  • As mentioned by @Micka in the comments, the difference seems to be given by the different number of times that the interpolation method is called.