title: Displaying image and converting to grayscale - OpenCV for Android, Java API
body: <p>I'm writing an Android app in Eclipse that uses the <a href="http://code.opencv.org/projects/opencv/wiki/OpenCV4Android" rel="nofollow noreferrer">OpenCV4Android</a> API.  How can I display a <code>Mat</code> image easily, for debugging only?  In C++, according to the OpenCV tutorials, you'd do something like:</p>
  
  <pre><code>namedWindow( "Display window", CV_WINDOW_AUTOSIZE );// Create a window for display.
  imshow( "Display window", image ); // Show our image inside it.
  </code></pre>
  
  <p>but the Java API for Android doesn't seem to have a <code>namedWindow</code> function inside <code>org.opencv.highgui.Highgui</code>.</p>
  
  <p>Also, I'd like to load the image as grayscale.  In C++, according to <a href="https://stackoverflow.com/questions/7417637/imread-in-opencv">imread not working in Opencv</a>, you'd do:</p>
  
  <pre><code>imread("blackandwhite.jpg", 0);
  </code></pre>
  
  <p>but the Java API's <code>Highgui.imread()</code> has only the filename argument.</p>