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.