title: let user input image destination through console OpenCV c++
body: <p>I have tried several ways to implement a way to let user input the file destination of a imagefile, so it can be loaded in a <code>Mat</code>. I cant figure out how to do it. I am learning OpenCV through their guides, but i cant find any information about how to load an image through console.</p>
  
  <p>This is the code i have so far, but its not working..</p>
  
  <pre><code>Mat src
  string path;
  cout &lt;&lt; "Load nyt billede" &lt;&lt; endl&lt;&lt;"Fildist(Hele filstien): ";
  
  cin &gt;&gt; path;
  src=imread(path, CV_LOAD_IMAGE_GRAYSCALE);
  
  imwrite("test", src);
  system("pause");
  </code></pre>