我正在创建一个查找两个图像之间匹配的应用程序.我无法正确找到匹配结果.
匹配方法给出了与输入关键点相同数量的描述符,我也无法绘制此结果.我在工作区中使用OpenCV作为库.
这是我的代码.
Bitmap mBitmap1 = mimage1.copy(Bitmap.Config.ARGB_8888, false);
Bitmap mBitmap2 = mimage2.copy(Bitmap.Config.ARGB_8888, false);
Mat s_image1 = Utils.bitmapToMat(mBitmap1);
Mat s_image2 = Utils.bitmapToMat(mBitmap2);
Mat rgb1 = new Mat();
Mat rgb2 = new Mat();
Mat rgb3 = new Mat();
Mat temp = new Mat();
Mat o_image1 = new Mat();
Mat o_image2 = new Mat();
Mat o_image3 = new Mat();
List<KeyPoint> points1 = new ArrayList<KeyPoint>();
List<KeyPoint> points2 = new ArrayList<KeyPoint>();
List<DMatch> matches = new ArrayList<DMatch>();
FeatureDetector surf = FeatureDetector.create(FeatureDetector.SURF);
surf.detect(s_image1, points1);
surf.detect(s_image2, points2);
Scalar …Run Code Online (Sandbox Code Playgroud)