switch from cv::Mat to plain arrays