Ask Your Question

Revision history [back]

Why Xcode runs OpenCV with no title?

I just wrote a simple cpp which add an image file to a window created using cvNamedWindow(), but when I run the code, the image was showed in a window with no title. I've searched online for solution but there was no similar question on the net here is my code:

include <opencv2 opencv.hpp="">

include <iostream>

include <string>

using namespace cv; using namespace std;

int main() {

IplImage *img = cvLoadImage("/Users/iPaul/Desktop/xxx.jpg");

cvNamedWindow("xxx",CV_WINDOW_AUTOSIZE);
cvShowImage("xxx",img);

cvWaitKey(0);

cvDestroyWindow("xxx");
cvReleaseImage(&img);

return 0;

}