C++ OpenCV cvShowImage函数错误(在ubuntu 14.04中)

C++ OpenCV cvShowImage函数错误(在ubuntu 14.04中),c++,opencv,ubuntu-14.04,C++,Opencv,Ubuntu 14.04,我使用cvShowImage功能来显示图像CvMat。但结果是不正确的。CvMat为120*160,而结果为120*364(高度*宽度)像素。守则: void SHOW_IMAGE(const CvMat *pmat, const char str[], int wait) { cout << "channels:" << CV_MAT_CN(pmat->type) << "\n"; CvMat *mat = cvCloneMat(pma

我使用
cvShowImage
功能来显示图像CvMat。但结果是不正确的。CvMat为120*160,而结果为120*364(高度*宽度)像素。守则:

void SHOW_IMAGE(const CvMat *pmat, const char str[], int wait)
{
    cout << "channels:" << CV_MAT_CN(pmat->type) << "\n";
    CvMat *mat = cvCloneMat(pmat);
    assert(mat);
    //show it
    cvNamedWindow(str, CV_WINDOW_AUTOSIZE); //0 1
    cvShowImage(str, mat);
    cvWaitKey(wait); 
    //clear
    cvReleaseMat(&mat);
 } 
void SHOW_IMAGE(常量CvMat*pmat,常量char str[],int wait)
{

cout代码运行良好..在winxp、visual studio 2010、opencv 2.4.8.Gui Qt 4.8.6上进行了测试。

谢谢。但是在ubuntu 14.04上代码不正常。我用CvMat(120*380)测试了cvShowImage函数,结果是正确的。我发现图像的宽度是有限的(至少364)。我不确认这个结论。