Opencv中判断Mat中0像素的个数

int rows = image.rows;//图像的行数
int columns = image.cols;//图像的列数

int nonZeroCount = cv::countNonZero(grayMat);

int result=rows *columns -nonZeroCount ;

posted @ 2023-02-14 08:50  爱编程的顺  阅读(36)  评论(0)    收藏  举报