opencv-api FlannBasedMatcher

Fast Library forApproximate Nearest Neighbors

1.创建对象

<FlannBasedMatcher object> = cv.FlannBasedMatcher( [, indexParams[, searchParams]] )

indexParams

参数描述
FLANN_INDEX_LINEAR线性暴力(brute-force)搜索
FLANN_INDEX_KDTREE随机kd树,平行搜索。默认trees=4
FLANN_INDEX_KMEANS层次k均值树。默认branching=32,iterations=11,centers_init = CENTERS_RANDOM, cb_index =0.2
FLANN_INDEX_COMPOSITE随机kd树和层次k均值树来构建索引。默认trees =4,branching =32,iterations =11,centers_init = CENTERS_RANDOM,cb_index =0.2
FLANN_INDEX_KDTREE_SINGLE
FLANN_INDEX_HIERARCHICAL
FLANN_INDEX_LSHmulti-probe LSH方法
FLANN_INDEX_SAVED
FLANN_INDEX_AUTOTUNED
LINEAR
KDTREE
KMEANS
COMPOSITE
KDTREE_SINGLE
SAVED
AUTOTUNED自动选取,以提供最好的性能

searchParams
SearchParams (int checks=32, float eps=0, bool sorted=true)

参数描述
checks默认32
eps默认为0
sorted默认True

2.匹配方法

FlannBasedMatcher对象继承了cv::DescriptorMatcher.

matches	=	cv.DescriptorMatcher.knnMatch(	queryDescriptors, trainDescriptors, k[, mask[, compactResult]]	)
matches	=	cv.DescriptorMatcher.knnMatch(	queryDescriptors, k[, masks[, compactResult]]	)
参数描述
queryDescriptors原图
trainDescriptors搜索的图片
matches匹配的结果
kCount of best matches found per each query descriptor or less if a query descriptor has less than k possible matches in total.设置阈值,越高精度越高,匹配的数量越少
masksSet of masks.
compactResultParameter used when the mask (or masks) is not empty.

matches

参数描述
distance
imgIdx训练图片的索引
queryIdxquery descriptor index
trainIdxtrain descriptor index

参考文献:
https://www.jianshu.com/p/d70d9c8b2bec
https://docs.opencv.org/3.4.3/d5/d03/structcv_1_1flann_1_1SearchParams.html
https://docs.opencv.org/3.4.3/dc/d8c/namespacecvflann.html#a4e3e6c98d774ea77fd7f0045c9bc7817af67e191e4866496ff7db55c24277f4a4
https://docs.opencv.org/master/db/d39/classcv_1_1DescriptorMatcher.html#a38f18a66b3498fa5c960e29ed0056d44

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值