trainImage queryImage trainIdex queryIdx OpenCV

本文解释了OpenCV中DMatch类的参数含义,特别是query和train的概念。通常,train指预先提取特征的图像集,而query则是运行时用于匹配这些已训练图像的输入图像。

问题之由来

OpenCV中有一个类 DMatch

它有几个成员变量:
imgIdx, train image index
int _queryIdx, query descriptor index
int _trainIdx, train descriptor index
float _distance

但是这些名字的内涵我不了解,所以下文是了解后的内容:

解答

I suppose the reason for choosing these names should be that in some application we have got a set of images (training images) beforehand, for example 10 images taken inside your office.
The features can be extracted and the feature descriptors can be computed for these images.

And at run-time an image is given to the system to query the trained database. Hence the query image refers to this image.

I really don’t like the way they have named these parameters.
Where you have a pair of stereo images and you want to match the features, these names don’t make sense but you have to chose a convention say always call the left image the query image and the right image as the training image.

I did my PhD in computer vision and some naming conventions in OpenCV seem really confusing/silly to me. So if you find these confusing or silly you’re not alone.

To put it even more simple, train is the image you learned (extracted features) beforehand, query is the image that you are trying to match with the ones trained.

来源

What is query and train in openCV features2D

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

培之

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值