将单通道数据值变成3通道
cv::Mat mask_face(H, w, CV_8UC3, ppu8Plane[0]); for (int i = 0; i < mask_glass.rows; i++) { for (int j = 0; j < mask_glass.cols; j++) { mask_face.at<uchar>(i, j * 3 + 0) = mask_face0.at<uchar>(i, j); mask_face.at<uchar>(i, j * 3 + 1) = mask_face0.at<uchar>(i, j); mask_face.at<uchar>(i, j * 3 + 2) = mask_face0.at<uchar>(i, j); } }