Set encoding with cv::Mat::type().