title: imread in OpenCV
body: <p>I found that this question has been asked many times here, but I haven't found any solution or work-around to this problem. Here's my code (copied from here: <a href="http://docs.opencv.org/doc/tutorials/introduction/display_image/display_image.html" rel="nofollow">http://docs.opencv.org/doc/tutorials/introduction/display_image/display_image.html</a>):</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;opencv2/highgui/highgui.hpp&gt;
  #include &lt;opencv2/imgproc/imgproc.hpp&gt;
  
  using namespace cv;
  using namespace std;
  
  
  int _tmain(int argc, char** argv)
  {
      if( argc != 2)
      {
          cout &lt;&lt;" Usage: display_image ImageToLoadAndDisplay" &lt;&lt; endl;
          return -1;
      }
  
      Mat image;
      image = imread(argv[1], CV_LOAD_IMAGE_COLOR);   // Read the file
  
      if(! image.data )                              // Check for invalid input
      {
          cout &lt;&lt;  "Could not open or find the image" &lt;&lt; std::endl ;
          return -1;
      }
  
      namedWindow( "Display window", WINDOW_AUTOSIZE );   // Create a window for display.
      imshow( "Display window", image );                   // Show our image inside it.
  
      waitKey(0);                                          // Wait for a keystroke in the window
  
      return 0;
  }
  </code></pre>
  
  <p>I compiled this using Visual Studio 2008 and 2010, and got different results (both don't work). The program compiled using VS 2008 has run-time error at <code>imread()</code>, and the other displays the message "Could not open or find the image".</p>
  
  <p>Anybody can help me with this?</p>