reduced 30% time by changing 2d vectors to cv::Mat

reduced 30% time by changing 2d vectors to cv::Mat

reduced 30% time by changing 2d vectors to cv::Mat