Mat的重置:Mat置零 Mat mat = zeros(height, width, CV_64FC1); 或者 Mat mat = Mat::zeros(height, width, CV_64FC1); Mat是否为空 if(!mat .data) return false;