title: MattoBitmap error when displaying image from submat
body: <p>I'm using the code below in order to find mat contours of an Image. I found the contours correct. But when I try to crop the image at contour the app crashes.</p>
  
  <pre><code>List&lt;MatOfPoint&gt; contours = new ArrayList&lt;MatOfPoint&gt;();
  Mat contour_mat = new Mat();
  Imgproc.findContours(image, contours, contour_mat, Imgproc.RETR_LIST,    Imgproc.CHAIN_APPROX_NONE);
  
  Mat roi = null; 
  for (int idx = 0; idx &lt; contours.size(); idx++) {
      Mat contour = contours.get(idx);
      double contourarea = Imgproc.contourArea(contour);
  
  if(contourarea&gt;10000){
        Rect rect = Imgproc.boundingRect(contours.get(idx));
                          //to get my target contour
         if (rect.height&lt; 55){
  
         Core.rectangle(hsv_image, new Point(rect.x,rect.y), new Point(rect.x+rect.width,rect.y+rect.height),new Scalar(0,0,255));
         roi = hsv_image.submat(rect.y, rect.y + rect.height, rect.x, rect.x + rect.width);
  
                 }
              }
            }
  Mat image = new Mat(roi.size(), CvType.CV_8UC1);
  roi.copyTo(image);
  Bitmap bm = Bitmap.createBitmap(image.rows(), image.cols(),  
                                Bitmap.Config.ARGB_8888); 
  
   Utils.matToBitmap(image, bm);
  </code></pre>
  
  <p>this is the error log:</p>
  
  <pre><code>05-08 20:07:56.851: E/AndroidRuntime(13331): CvException [org.opencv.core.CvException: /home/reports/ci/slave_desktop/50-SDK/opencv/modules/java/generator/src/cpp/utils.cpp:97: error: (-215) src.dims == 2 &amp;&amp; info.height == (uint32_t)src.rows &amp;&amp; info.width == (uint32_t)src.cols in function void Java_org_opencv_android_Utils_nMatToBitmap2(JNIEnv*, jclass, jlong, jobject, jboolean)
  </code></pre>