title: OpenCV imshow not displaying image in osx
body: <p>I'm working right out of a book, and copied the following code (essentially the openCV equivalent of "hello world"):</p>
  
  <pre><code>//helloCV.cpp
  #include &lt;opencv2/opencv.hpp&gt;
  
  int main(int argc, char** argv){
  
          cv::Mat img = cv::imread(argv[1], -1);
          if (img.empty()) return -1;
  
          cv::namedWindow("Example1", cv::WINDOW_AUTOSIZE);
          cv::imshow("Example1", img);
          cv::waitKey(0);
          cv::destroyWindow("Example1");
  
          return 0;
  
  }//main 
  </code></pre>
  
  <p>Unfortunately, when I run this code, I get a window with the header and nothing in it:</p>
  
  <p><img src="https://i.stack.imgur.com/iatN7.png" alt=""></p>
  
  <p>I suspect that I've messed up the environment or some such when installing OpenCV, but cmake is throwing no errors, and the code runs as expected, exiting correctly on a keystroke and all of that, with the glaring exception of a lack of a displayed photo.</p>
  
  <p>Any tips?</p>
  
  <p>Thanks!</p>