optimized cv::transpose inplace