Processing images takes time (comparably much more than the time it takes to process 1D data). Often, processing time is the crucial factor that decides whether a solution is practical or not. OpenCV provides two functions to measure the elapsed time:
getTickFrequency(). You'll use them like this:
double t0 = (double)getTickCount(); // your stuff here ... elapsed = ((double)getTickCount() – t0)/getTickFrequency();
elapsed is in seconds.