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

asked 2014-03-05 06:35:32 -0600

York gravatar image

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

edit retag flag offensive close merge delete

Comments

maybe try to find debug mode and opencv dll, lib are the same?

wuling gravatar imagewuling ( 2014-03-05 07:48:38 -0600 )edit

请问这位老师,我可以在一段程序中同时使用c &c++ 数据结构并且相互转换吗?

York gravatar imageYork ( 2014-03-06 01:52:28 -0600 )edit

yes,you can ,i am an engineer not a teacher

wuling gravatar imagewuling ( 2014-03-06 08:31:16 -0600 )edit

ok sorry,we used to call that for a respect in Shandong…maybe have something to do with Confucius,welcome to Shandong!

York gravatar imageYork ( 2014-03-09 06:56:36 -0600 )edit