Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You forgot to call waitKey function. This function fetchs and handles window events, such as repaint event, so it must be called. Also check that your image was loaded properly:

cv::Mat pic = cv::imread("1.jpg");
if (pic.empty())
{
    cout << "can't load image" << endl;
    return -1;
}
cv::imshow("Smile", pic);
cv::waitKey();