这是错误:
Error no Operand "<<" matches these operands
我得到错误的行是:
cout << "M = "<< endl << " " << size << endl << endl;
但如果我使用这条线,我不会收到错误:
cout << "M = "<< endl << " " << frame << endl << endl;
这是代码:
#include <cv.h>
#include <highgui.h>
using namespace std;
int main(){
CvCapture* capture =0;
capture = cvCreateCameraCapture(0);
if(!capture){
//printf("Capture failure\n");
return -1;
}
IplImage* frame=0;
int size = 0;
cvNamedWindow("Video");
//iterate through each frames of the video
while(true){
frame = cvQueryFrame(capture);
if(!frame) break;
frame=cvCloneImage(frame);
CvSize size = cvGetSize(frame);
cout << "M = "<< endl << " " << size << endl << endl;
//Clean up used images
cvReleaseImage(&frame);
//Wait 50mS
int c = cvWaitKey(10);
//If 'ESC' is pressed, break the loop
if((char)c==27 ) break;
}
cvDestroyAllWindows() ;
cvReleaseCapture(&capture);
return 0;
}
//////////////////////////////////////
这是为什么....请帮助我获得变量“大小”的输出,并请引用在线资源以获得您的答案,以便我可以学习获得任何 OpenCV 变量的输出。