Reputation:
here is the error:
Error no Operand "<<" matches these operands
the line I get error on is:
cout << "M = "<< endl << " " << size << endl << endl;
but if I use this line I get no error:
cout << "M = "<< endl << " " << frame << endl << endl;
here is the code:
#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;
}
//////////////////////////////////////
why is that....please help me get output of variable "size" and please cite online resource for your answer so I may learn to get output of any OpenCV variable.
Upvotes: 0
Views: 98
Reputation: 66194
There is no CvSize stream inserter. If you want that syntax, then define one:
std::ostream& operator <<(std::ostream& os, const CvSize& siz)
{
os << siz.width << ',' << siz.height;
return os;
}
Upvotes: 1