Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

code below running in VC2010 ,no error but failed,help!

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