Mat src,dst,dst1; IplImage* pI; int count_black=0; char*window_name="window"; int main() { src=imread("F:\peo.jpg",1); cvtColor(src,dst,CV_BGR2GRAY); threshold(dst,dst1,10,255,0);
Mat dst1;
IplImage* pI = &dst1.operator IplImage();
int count_black=cvCountNonZero (pI);
cout<<" "<<count_black<<endl;
namedWindow("window",CV_WINDOW_AUTOSIZE);
imshow("window",dst1);
waitKey(0);
return 0;
}
============================================================ pick up my mistake please, —a newbie