Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I do not know why exeption is thrown, but suggest to call waitKey in the right way:

#include "opencv2\opencv.hpp"    
using namespace cv;    
int main(int argv, char** argc)
{
    Mat test = imread("McLaren P1 Bahrain-773-crop5184x2670.jpg", CV_LOAD_IMAGE_UNCHANGED);
    imshow("test", test);
    while(true)  {
      char option = waitKey(1); // wait 1 ms before waitKey will return value
      if(option = 27) // 27 is ESCAPE code from the ASCII table
          break; // break loop if the user has pressed escape button 
    }
    return 0;
}