From here
http://docs.opencv.org/modules/core/doc/basic_structures.html[
^] we get:
Mat::Mat(const IplImage* img, bool copyData=false)
img - Pointer to the old-style IplImage image structure. By default, the data is shared between the original image and the new matrix. But when copyData is set, the full copy of the image data is created.
So:
IplImage *img=cvQueryFrame(camera);
cvShowImage("img",img);
Mat imgMat(img);
This is the way to convert.
Then:
namedWindow( "Display window", WINDOW_AUTOSIZE );imshow( "Display window", imgMat );