opencv 如何判断某一个点在某个轮廓里面 1.新建一个相同大小的全0 Mat dst 2.在该Mat 上绘出该轮廓,用drawContours,并填充为255; 3.判断dst 上该点像素值是否是 255 Mat dst = Mat::zeros(src.size(),CV_8U); drawContours(dst,contours,index,Scalar(255),-1); Point pt(x,y); if(dat.at<uchar>(y,x) == 255) { // 在该轮廓内 } else { // 不在该轮廓内 }