title: Utils.bitmapToMat crashing app
body: <p>I'm trying to convert a bmp file into a Mat, and then convert it to greyscale. But I'm having trouble getting it working. Here's what I've got:</p>
  
  <pre><code>String filename = "/mnt/sdcard/DCIM/01.bmp";    
  Bitmap bmp = BitmapFactory.decodeFile(filename);
  Mat imgToProcess = null;
  
  Utils.bitmapToMat(bmp, imgToProcess);
  </code></pre>
  
  <p>But whenever that final line is used, the app just crashes (the rest of the time it continues on just fine).</p>
  
  <p>The rest of the code was going to be:</p>
  
  <pre><code>Imgproc.cvtColor(imgToProcess, imgToProcess, Imgproc.COLOR_BGR2GRAY);
  Imgproc.cvtColor(imgToProcess, imgToProcess, Imgproc.COLOR_GRAY2RGBA, 4);
  Utils.matToBitmap(imgToProcess, bmp);
  </code></pre>
  
  <p>I've no idea whether or not that works though, since I can't get the file converted to a Mat yet from the earlier part of the code. Looking at the documentation for Utils (found <a href="http://docs.opencv.org/java/org/opencv/android/Utils.html" rel="nofollow">here</a>) I'm using it correctly, but it's still not working.</p>
  
  <p>Can anyone help me out here?</p>