title: Displaying bitmap image on Android (OpenCV)
body: <p>I'm trying to read an image from external storage as an OpenCV Mat file, convert it to a bitmap image and then display the image (review image after picture is taken).  After debugging, it looks like everything is working except the setImageBitmap part.  Please let me know what I might be doing wrong.  Thanks!</p>
  
  <pre><code>public boolean onTouch(View v, MotionEvent event) {
      Mat img = Highgui.imread(Environment.getExternalStorageDirectory().getPath() + "/sample_picture_2015-06-09_13-24-53.jpeg");
      displayBitmap(img);
      return false;
  }
  
  public void displayBitmap(Mat img){
      Bitmap bm = Bitmap.createBitmap(img.cols(), img.rows(),Bitmap.Config.ARGB_8888);
      Utils.matToBitmap(img, bm);
  
      // find the imageview and draw it!
  
      ImageView iv = (ImageView) findViewById(R.id.imageView1);
      iv.setImageBitmap(bm);
  
      Log.i(TAG, "Here");
  }
  </code></pre>
  
  <p>And here is my xml file</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent" &gt;
  
  &lt;org.opencv.samples.tutorial3.Tutorial3View
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:visibility="gone"
      android:id="@+id/tutorial3_activity_java_surface_view" /&gt;
  
  &lt;ImageView
      android:id="@+id/imageView1"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_marginLeft="2dp"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>