Which way of accessing pixels in OpenCV is the fastest?

If you want to do custom high performance image processing code, this is an important question. I’m working on a real-time video processing project and we need fast pixel access. In the old days before OpenCV 2.x your only choice was direct pointer access in an IPL Image. The only problem with that is that…