Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. Mat teste = new Mat();
  2. Mat mRgba = teste.clone();
  3. Mat outputMat = new Mat();
  4.  
  5. BitmapDrawable drawable = (BitmapDrawable) imageView.getDrawable();
  6. Bitmap bitmap = drawable.getBitmap();
  7. Utils.bitmapToMat(bitmap, teste);
  8.  
  9. MatOfKeyPoint myKeyPoints = new MatOfKeyPoint();
  10. FeatureDetector orb = FeatureDetector.create(FeatureDetector.ORB);
  11. orb.detect(teste, myKeyPoints);
  12.  
  13. List<KeyPoint> referenceKeypointsList =
  14. myKeyPoints.toList();
  15.  
  16.  
  17. Imgproc.cvtColor(teste, mRgba, Imgproc.COLOR_RGBA2RGB,4);
  18. Features2d.drawKeypoints(mRgba, myKeyPoints, mRgba, new Scalar(2,254,255), Features2d.DRAW_RICH_KEYPOINTS);
  19. Imgproc.cvtColor(mRgba, outputMat, Imgproc.COLOR_RGB2RGBA);
  20. Utils.matToBitmap(outputMat, bitmap);
  21.  
  22. imageView.setImageBitmap(bitmap);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement