openCV4Android features2d error

可紊 提交于 2019-12-06 07:17:52
PhilLab

The problem is, that you give a filtered list (i.e. matOfSceneGoodKeyPoints) to drawMatches(). But the good matches list gm contains indices based on the original lists. So change to

Features2d.drawMatches(gray1, keypoints_object, gray2,
keypoints_scene, gm, outputImg, Scalar.all(-1), RED,
drawnMatches, Features2d.NOT_DRAW_SINGLE_POINTS);

and you have what you wanted. The drawn matches are still restricted to the best ones, since only those in gm are used.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!