2

我正在编写一个程序来识别钞票。以下是我查找匹配项的功能。我有 5 张来自手机内存的图像和一张通过相机拍摄的图像。此代码在 for 循环中执行以查找匹配数量最多的图像。从可变匹配中获得良好匹配的好方法是什么?

object_desc = new Mat();
scene_desc = new Mat();

object_keys = new MatOfKeyPoint();
scene_keys = new MatOfKeyPoint();

matches = new MatOfDMatch();
good_matches = new MatOfDMatch();

Utils.bitmapToMat(image, object); 
surf = FeatureDetector.create(FeatureDetector.FAST);
surf.detect(object, object_keys);
surf.detect(mRgba, scene_keys);

surfEX = DescriptorExtractor.create(DescriptorExtractor.FREAK);
surfEX.compute(object, object_keys, object_desc);
surfEX.compute(mRgba, scene_keys, scene_desc);
dm = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMING);

dm.match(object_desc, scene_desc, matches);
4

0 回答 0