title: get(row, col, double[]) Opencv Android
body: <p>I just tried to use a solution found on this website, to access data from my mat from OpenCv, in an Android app.</p>
  
  <pre><code>int size = (int) this.getMyMat().total() * this.getMyMat().channels();
  double[] buff = new double[size];
  this.getMyMat().get(0, 0, buff);
  </code></pre>
  
  <p>The 3rd line crashes my app, and I get this error :
  java.lang.UnsupportedOperationException: Mat data type is not compatible: 0</p>
  
  <p>I don't known why, it's just a copy/past from here : <a href="https://stackoverflow.com/questions/12394364/opencv-for-android-access-elements-of-mat">OpenCV for Android - Access elements of Mat</a></p>
  
  <p>Here a copy/paste from the get method of OpenCV :</p>
  
  <pre><code>public int get(int row, int col, double[] data) {
      int t = type();
      if (data == null || data.length % CvType.channels(t) != 0)
          throw new java.lang.UnsupportedOperationException(
                  "Provided data element number (" +
                          (data == null ? 0 : data.length) +
                          ") should be multiple of the Mat channels count (" +
                          CvType.channels(t) + ")");
      if (CvType.depth(t) == CvType.CV_64F) {
          return nGetD(nativeObj, row, col, data.length, data);
      }
      throw new java.lang.UnsupportedOperationException("Mat data type is not compatible: " + t);
  }
  </code></pre>
  
  <p>Forgot to precise that my this.getMyMat() is obtained from :</p>
  
  <pre><code>Imgproc.adaptiveThreshold(this.getMyGrayMat(), dst, max_BINARY_value, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C, threshold_type, 27, 3);
  </code></pre>
  
  <p>So this a pure black and white mat.</p>