optimization of cv::accumulate**