cv::Mat mask = cv::Mat::zeros(ptr->image.size(), CV_8UC1);static_cast<int>(mask.ptr<uchar>(j)[i]) 这个比较靠谱https://www.cnblogs.com/jins-note/p/9512772.html