What is `query` and `train` in openCV features2D

Larry Cinnabar picture Larry Cinnabar · May 26, 2012 · Viewed 10.3k times · Source

Everywhere in features2D classes I see terms query and train. For example matches have trainIdx and queryIdx, and Matchers have train() method.

I know the definition of words train and query in English, but I can't understand the meaning of this properties or methods.

P.S. I understand, that it's very silly question, but maybe it's because English is not my native language.

Answer

fireant picture fireant · May 26, 2012

To complete sansuiso's answer, 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.