title: Can not match 2 descriptor opencv android
body: <p>I try to do like this theard <a href="https://stackoverflow.com/questions/15544158/error-matching-with-orb-in-android">Error matching with ORB in Android</a></p>
  
  <p>But when i use matcher.match(descriptors1,descriptors2,matches); My app is exit and say "Unfortumatively, Car_Traking_1 has stopped" </p>
  
  <p>This is my code when i not use matcher.match(descriptors1,descriptors2,matches); It's run and i can see data of descriptor1,descriptor1 in logcat</p>
  
  <p>This is my code:</p>
  
  <pre><code> public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) {
      mImageRGBA = inputFrame.rgba();
      Utils.bitmapToMat(icon, img_object);
      Imgproc.cvtColor(mImageRGBA,img_scene,Imgproc.COLOR_RGBA2GRAY);
  
  
      FeatureDetector detector = FeatureDetector.create(FeatureDetector.ORB);
      DescriptorExtractor descriptor = DescriptorExtractor.create(DescriptorExtractor.ORB);;
      DescriptorMatcher matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMING);
  
      //first image
      Mat img1 = img_object;
      Mat descriptors1 = new Mat();
      MatOfKeyPoint keypoints1 = new MatOfKeyPoint();
  
      detector.detect(img1, keypoints1);
      descriptor.compute(img1, keypoints1, descriptors1);
  
      //second image
      Mat img2 = img_scene;
      Mat descriptors2 = new Mat();
      MatOfKeyPoint keypoints2 = new MatOfKeyPoint();
  
      detector.detect(img2, keypoints2);
      descriptor.compute(img2, keypoints2, descriptors2);
  
      //matcher should include 2 different image's descriptors
      Log.i("aaa1", descriptors1.dump());
      Log.i("aaa2",descriptors2.dump());
      Log.i("aaa3",String.valueOf(descriptors1.cols()));
      Log.i("aaa4",String.valueOf(descriptors1.rows()));
      Log.i("aaa5",String.valueOf(descriptors2.cols()));
      Log.i("aaa6",String.valueOf(descriptors2.rows()));
  
  
  
      return mImageRGBA;
  }
  </code></pre>
  
  <p>I see descriptor1 and descriptor2 have data, size of descriptor1 is 32x104 and size of descriptor1 is 32x219 </p>
  
  <p>But now when i add 2 line  </p>
  
  <pre><code>        MatOfDMatch matches = new MatOfDMatch();
      matcher.match(descriptors1,descriptors2,matches);
  </code></pre>
  
  <p>So my code will like </p>
  
  <pre><code> public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) {
      mImageRGBA = inputFrame.rgba();
      Utils.bitmapToMat(icon, img_object);
      Imgproc.cvtColor(mImageRGBA,img_scene,Imgproc.COLOR_RGBA2GRAY);
  
  
      FeatureDetector detector = FeatureDetector.create(FeatureDetector.ORB);
      DescriptorExtractor descriptor = DescriptorExtractor.create(DescriptorExtractor.ORB);;
      DescriptorMatcher matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMING);
  
      //first image
      Mat img1 = img_object;
      Mat descriptors1 = new Mat();
      MatOfKeyPoint keypoints1 = new MatOfKeyPoint();
  
      detector.detect(img1, keypoints1);
      descriptor.compute(img1, keypoints1, descriptors1);
  
      //second image
      Mat img2 = img_scene;
      Mat descriptors2 = new Mat();
      MatOfKeyPoint keypoints2 = new MatOfKeyPoint();
  
      detector.detect(img2, keypoints2);
      descriptor.compute(img2, keypoints2, descriptors2);
  
      //matcher should include 2 different image's descriptors
      MatOfDMatch matches = new MatOfDMatch();
      matcher.match(descriptors1, descriptors2, matches);
  
  
  
      return mImageRGBA;
  }
  </code></pre>
  
  <p>When i run it, it run and exit and say "Unfortumatively, Car_Traking_1 has stopped"
  I don't know what problem with it, or descriptor1 and descriptor2 had to same size. How can i fix it.</p>